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

ihevc_intra_pred_chroma_ref_substitution:
  133|  7.91M|{
  134|  7.91M|    UWORD8 pu1_ref_u, pu1_ref_v;
  135|  7.91M|    WORD32 dc_val, i, j;
  136|  7.91M|    WORD32 total_samples = (4 * nt) + 1;
  137|  7.91M|    WORD32 get_bits;
  138|  7.91M|    WORD32 next;
  139|  7.91M|    WORD32 bot_left, left, top, tp_right, tp_left;
  140|  7.91M|    WORD32 idx, nbr_id_from_bl, frwd_nbr_flag;
  141|  7.91M|    WORD32 a_nbr_flag[5];
  142|  7.91M|    UNUSED(dst_strd);
  ------------------
  |  |   38|  7.91M|#define UNUSED(x) ((void)(x))
  ------------------
  143|       |    /* Neighbor Flag Structure*/
  144|       |    /* WORD32 nbr_flags MSB-->LSB   TOP LEFT | TOP-RIGHT |  TOP   | LEFT    | BOTTOM LEFT*/
  145|       |    /*                              (1 bit)     (4 bits)  (4 bits) (4 bits)  (4 bits)  */
  146|       |
  147|  7.91M|    if(nbr_flags == 0)
  ------------------
  |  Branch (147:8): [True: 8.13k, False: 7.90M]
  ------------------
  148|  8.13k|    {
  149|       |/* If no neighbor flags are present, fill the neighbor samples with DC value */
  150|       |        /*dc_val = 1 << (BIT_DEPTH - 1);*/
  151|  8.13k|        dc_val = 1 << (8 - 1);
  152|   842k|        for(i = 0; i < (2 * total_samples); i++)
  ------------------
  |  Branch (152:20): [True: 834k, False: 8.13k]
  ------------------
  153|   834k|        {
  154|   834k|            pu1_dst[i] = dc_val;
  155|   834k|        }
  156|  8.13k|    }
  157|  7.90M|    else
  158|  7.90M|    {
  159|       |        /* Else fill the corresponding samples */
  160|       |
  161|       |        /* Check for the neighbors availibility */
  162|  7.90M|        tp_left     = (nbr_flags & 0x10000);
  163|  7.90M|        tp_right    = (nbr_flags & 0x0f000);
  164|  7.90M|        top         = (nbr_flags & 0x00f00);
  165|  7.90M|        left        = (nbr_flags & 0x000f0);
  166|  7.90M|        bot_left    = (nbr_flags & 0x0000f);
  167|       |
  168|       |        /* Fill nbrs depending on avalibility */
  169|       |        /* Top -Left nbrs  */
  170|  7.90M|        if(0 != tp_left)
  ------------------
  |  Branch (170:12): [True: 7.37M, False: 530k]
  ------------------
  171|  7.37M|        {
  172|  7.37M|            pu1_dst[(4 * nt)] = *pu1_top_left; // U top-left sample
  173|  7.37M|            pu1_dst[(4 * nt) + 1] = *(pu1_top_left + 1); // V top-left sample
  174|  7.37M|        }
  175|       |        /* Left nbrs  */
  176|  7.90M|        if(0 != left)
  ------------------
  |  Branch (176:12): [True: 7.83M, False: 70.3k]
  ------------------
  177|  7.83M|        {
  178|  85.0M|            for(i = 0, j = 0; i < (2 * nt); i += 2)
  ------------------
  |  Branch (178:31): [True: 77.1M, False: 7.83M]
  ------------------
  179|  77.1M|            {
  180|  77.1M|                pu1_dst[(4 * nt) - 2 - i] = pu1_left[j * src_strd]; // U left samples
  181|  77.1M|                pu1_dst[(4 * nt) - 1 - i] = pu1_left[(j * src_strd) + 1]; // V left samples
  182|  77.1M|                j++;
  183|  77.1M|            }
  184|  7.83M|        }
  185|       |        /* Bottom - Left nbrs  */
  186|  7.90M|        if(0 != bot_left)
  ------------------
  |  Branch (186:12): [True: 2.28M, False: 5.62M]
  ------------------
  187|  2.28M|        {
  188|  23.6M|            for(i = (2 * nt), j = nt; i < (4 * nt); i += 2)
  ------------------
  |  Branch (188:39): [True: 21.3M, False: 2.28M]
  ------------------
  189|  21.3M|            {
  190|  21.3M|                pu1_dst[(4 * nt) - 2 - i] = pu1_left[j * src_strd]; // U left samples
  191|  21.3M|                pu1_dst[(4 * nt) - 1 - i] = pu1_left[(j * src_strd) + 1]; // V left samples
  192|  21.3M|                j++;
  193|  21.3M|            }
  194|  2.28M|        }
  195|       |        /* Top nbrs  */
  196|  7.90M|        if(0 != top)
  ------------------
  |  Branch (196:12): [True: 7.45M, False: 455k]
  ------------------
  197|  7.45M|        {
  198|  7.45M|            ihevc_memcpy_mul_8(&pu1_dst[(4 * nt) + 2], pu1_top, 2 * nt);
  199|       |            // U-V interleaved Top-top right samples
  200|  7.45M|        }
  201|       |
  202|       |        /* Top - Right nbrs  */
  203|  7.90M|        if(0 != tp_right)
  ------------------
  |  Branch (203:12): [True: 5.10M, False: 2.80M]
  ------------------
  204|  5.10M|        {
  205|  5.10M|            ihevc_memcpy_mul_8(&pu1_dst[(4 * nt) + 2 + 2 * nt], pu1_top + 2 * nt, 2 * nt);
  206|       |            // U-V interleaved Top-top right samples
  207|  5.10M|        }
  208|       |
  209|  7.90M|        if(nt == 4)
  ------------------
  |  Branch (209:12): [True: 1.77M, False: 6.13M]
  ------------------
  210|  1.77M|        {
  211|       |            /* 1 bit extraction for all the neighboring blocks */
  212|  1.77M|            tp_left = (nbr_flags & 0x10000) >> 16;
  213|  1.77M|            bot_left = (nbr_flags & 0x8) >> 3;
  214|  1.77M|            left = (nbr_flags & 0x80) >> 7;
  215|  1.77M|            top = (nbr_flags & 0x100) >> 8;
  216|  1.77M|            tp_right = (nbr_flags & 0x1000) >> 12;
  217|       |
  218|  1.77M|            next = 1;
  219|  1.77M|            a_nbr_flag[0] = bot_left;
  220|  1.77M|            a_nbr_flag[1] = left;
  221|  1.77M|            a_nbr_flag[2] = tp_left;
  222|  1.77M|            a_nbr_flag[3] = top;
  223|  1.77M|            a_nbr_flag[4] = tp_right;
  224|       |
  225|       |            /* If bottom -left is not available, reverse substitution process*/
  226|  1.77M|            if(bot_left == 0)
  ------------------
  |  Branch (226:16): [True: 1.20M, False: 566k]
  ------------------
  227|  1.20M|            {
  228|       |                /* Check for the 1st available sample from bottom-left*/
  229|  1.23M|                while(!a_nbr_flag[next])
  ------------------
  |  Branch (229:23): [True: 28.3k, False: 1.20M]
  ------------------
  230|  28.3k|                    next++;
  231|       |
  232|       |                /* If Left, top-left are available*/
  233|  1.20M|                if(next <= 2)
  ------------------
  |  Branch (233:20): [True: 1.19M, False: 14.1k]
  ------------------
  234|  1.19M|                {
  235|  1.19M|                    UWORD16 *pu2_dst;
  236|  1.19M|                    idx = (nt * next);
  237|  1.19M|                    pu2_dst = (UWORD16 *)&pu1_dst[2 * idx];
  238|  1.19M|                    ihevc_memset_16bit((UWORD16 *)pu1_dst, pu2_dst[0], idx);
  239|  1.19M|                }
  240|  14.1k|                else /* If top, top-right are available */
  241|  14.1k|                {
  242|  14.1k|                    UWORD16 *pu2_dst;
  243|       |                    /* Idx is changed to copy 1 pixel value for top-left ,if top-left is not available*/
  244|  14.1k|                    idx = (nt * (next - 1)) + 1;
  245|  14.1k|                    pu2_dst = (UWORD16 *)&pu1_dst[2 * idx];
  246|  14.1k|                    ihevc_memset_16bit((UWORD16 *)pu1_dst, pu2_dst[0], idx);
  247|  14.1k|                }
  248|  1.20M|            }
  249|       |
  250|  1.77M|            if(left == 0)
  ------------------
  |  Branch (250:16): [True: 14.2k, False: 1.76M]
  ------------------
  251|  14.2k|            {
  252|  14.2k|                UWORD16 *pu2_dst = (UWORD16 *)&pu1_dst[(2 * nt) - 2];
  253|  14.2k|                ihevc_memset_16bit((UWORD16 *)&pu1_dst[(2 * nt)], pu2_dst[0], nt);
  254|       |
  255|       |
  256|  14.2k|            }
  257|  1.77M|            if(tp_left == 0)
  ------------------
  |  Branch (257:16): [True: 55.0k, False: 1.71M]
  ------------------
  258|  55.0k|            {
  259|  55.0k|                pu1_dst[4 * nt] = pu1_dst[(4 * nt) - 2];
  260|  55.0k|                pu1_dst[(4 * nt) + 1] = pu1_dst[(4 * nt) - 1];
  261|  55.0k|            }
  262|  1.77M|            if(top == 0)
  ------------------
  |  Branch (262:16): [True: 40.9k, False: 1.73M]
  ------------------
  263|  40.9k|            {
  264|  40.9k|                UWORD16 *pu2_dst = (UWORD16 *)&pu1_dst[(4 * nt)];
  265|  40.9k|                ihevc_memset_16bit((UWORD16 *)&pu1_dst[(4 * nt) + 2], pu2_dst[0], nt);
  266|       |
  267|       |
  268|  40.9k|            }
  269|  1.77M|            if(tp_right == 0)
  ------------------
  |  Branch (269:16): [True: 626k, False: 1.14M]
  ------------------
  270|   626k|            {
  271|   626k|                UWORD16 *pu2_dst = (UWORD16 *)&pu1_dst[(6 * nt)];
  272|   626k|                ihevc_memset_16bit((UWORD16 *)&pu1_dst[(6 * nt) + 2], pu2_dst[0], nt);
  273|       |
  274|       |
  275|   626k|            }
  276|  1.77M|        }
  277|  6.13M|        else if(nt == 8)
  ------------------
  |  Branch (277:17): [True: 3.39M, False: 2.73M]
  ------------------
  278|  3.39M|        {
  279|  3.39M|            WORD32 nbr_flags_temp = 0;
  280|  3.39M|            nbr_flags_temp = ((nbr_flags & 0xC) >> 2) + ((nbr_flags & 0xC0) >> 4)
  281|  3.39M|                            + ((nbr_flags & 0x300) >> 4)
  282|  3.39M|                            + ((nbr_flags & 0x3000) >> 6)
  283|  3.39M|                            + ((nbr_flags & 0x10000) >> 8);
  284|       |
  285|       |            /* compute trailing zeors based on nbr_flag for substitution process of below left see section .*/
  286|       |            /* as each bit in nbr flags corresponds to 8 pels for bot_left, left, top and topright but 1 pel for topleft */
  287|  3.39M|            {
  288|  3.39M|                nbr_id_from_bl = look_up_trailing_zeros(nbr_flags_temp & 0XF) * 4; /* for bottom left and left */
  ------------------
  |  |   43|  3.39M|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 8.48k, False: 3.38M]
  |  |  ------------------
  ------------------
  289|  3.39M|                if(nbr_id_from_bl == 32)
  ------------------
  |  Branch (289:20): [True: 8.48k, False: 3.38M]
  ------------------
  290|  8.48k|                    nbr_id_from_bl = 16;
  291|  3.39M|                if(nbr_id_from_bl == 16)
  ------------------
  |  Branch (291:20): [True: 8.48k, False: 3.38M]
  ------------------
  292|  8.48k|                {
  293|       |                    /* for top left : 1 pel per nbr bit */
  294|  8.48k|                    if(!((nbr_flags_temp >> 8) & 0x1))
  ------------------
  |  Branch (294:24): [True: 8.48k, False: 2]
  ------------------
  295|  8.48k|                    {
  296|  8.48k|                        nbr_id_from_bl++;
  297|  8.48k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags_temp >> 4) & 0xF) * 4; /* top and top right;  8 pels per nbr bit */
  ------------------
  |  |   43|  8.48k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 8.48k]
  |  |  ------------------
  ------------------
  298|       |
  299|  8.48k|                    }
  300|  8.48k|                }
  301|       |                /* Reverse Substitution Process*/
  302|  3.39M|                if(nbr_id_from_bl)
  ------------------
  |  Branch (302:20): [True: 2.34M, False: 1.04M]
  ------------------
  303|  2.34M|                {
  304|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  305|  2.34M|                    pu1_ref_u = pu1_dst[2 * nbr_id_from_bl];
  306|  2.34M|                    pu1_ref_v = pu1_dst[(2 * nbr_id_from_bl) + 1];
  307|  21.1M|                    for(i = 2 * (nbr_id_from_bl - 1); i >= 0; i -= 2)
  ------------------
  |  Branch (307:55): [True: 18.8M, False: 2.34M]
  ------------------
  308|  18.8M|                    {
  309|  18.8M|                        pu1_dst[i] = pu1_ref_u;
  310|  18.8M|                        pu1_dst[i + 1] = pu1_ref_v;
  311|  18.8M|                    }
  312|  2.34M|                }
  313|  3.39M|            }
  314|       |
  315|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  316|  29.2M|            while(nbr_id_from_bl < ((T8C_4NT)+1))
  ------------------
  |  |   83|  29.2M|#define T8C_4NT 32
  ------------------
  |  Branch (316:19): [True: 25.8M, False: 3.39M]
  ------------------
  317|  25.8M|            {
  318|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  319|       |                /* Divide by 8 to obtain the original index */
  320|  25.8M|                frwd_nbr_flag = (nbr_id_from_bl >> 2); /*+ (nbr_id_from_bl & 0x1);*/
  321|       |
  322|       |                /* The Top-left flag is at the last bit location of nbr_flags*/
  323|  25.8M|                if(nbr_id_from_bl == (T8C_4NT / 2))
  ------------------
  |  |   83|  25.8M|#define T8C_4NT 32
  ------------------
  |  Branch (323:20): [True: 3.38M, False: 22.4M]
  ------------------
  324|  3.38M|                {
  325|  3.38M|                    get_bits = GET_BIT(nbr_flags_temp, 8);
  ------------------
  |  |   45|  3.38M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  326|       |
  327|       |                    /* only pel substitution for TL */
  328|  3.38M|                    if(!get_bits)
  ------------------
  |  Branch (328:24): [True: 86.1k, False: 3.30M]
  ------------------
  329|  86.1k|                    {
  330|  86.1k|                        pu1_dst[2 * nbr_id_from_bl] = pu1_dst[(2 * nbr_id_from_bl) - 2];
  331|  86.1k|                        pu1_dst[(2 * nbr_id_from_bl) + 1] = pu1_dst[(2 * nbr_id_from_bl) - 1];
  332|  86.1k|                    }
  333|  3.38M|                }
  334|  22.4M|                else
  335|  22.4M|                {
  336|  22.4M|                    get_bits = GET_BIT(nbr_flags_temp, frwd_nbr_flag);
  ------------------
  |  |   45|  22.4M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  337|  22.4M|                    if(!get_bits)
  ------------------
  |  Branch (337:24): [True: 2.52M, False: 19.9M]
  ------------------
  338|  2.52M|                    {
  339|  2.52M|                        UWORD16 *pu2_dst;
  340|       |                        /* 8 pel substitution (other than TL) */
  341|  2.52M|                        pu2_dst = (UWORD16 *)&pu1_dst[(2 * nbr_id_from_bl) - 2];
  342|  2.52M|                        ihevc_memset_16bit((UWORD16 *)(pu1_dst + (2 * nbr_id_from_bl)), pu2_dst[0], 4);
  343|  2.52M|                    }
  344|       |
  345|  22.4M|                }
  346|  25.8M|                nbr_id_from_bl += (nbr_id_from_bl == (T8C_4NT / 2)) ? 1 : 4;
  ------------------
  |  |   83|  25.8M|#define T8C_4NT 32
  ------------------
  |  Branch (346:35): [True: 3.38M, False: 22.4M]
  ------------------
  347|  25.8M|            }
  348|       |
  349|  3.39M|        }
  350|  2.73M|        else if(nt == 16)
  ------------------
  |  Branch (350:17): [True: 2.74M, False: 18.4E]
  ------------------
  351|  2.74M|        {
  352|       |            /* compute trailing ones based on mbr_flag for substitution process of below left see section .*/
  353|       |            /* as each bit in nbr flags corresponds to 4 pels for bot_left, left, top and topright but 1 pel for topleft */
  354|  2.74M|            {
  355|  2.74M|                nbr_id_from_bl = look_up_trailing_zeros((nbr_flags & 0XFF)) * 4; /* for bottom left and left */
  ------------------
  |  |   43|  2.74M|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 47.7k, False: 2.69M]
  |  |  ------------------
  ------------------
  356|       |
  357|  2.74M|                if(nbr_id_from_bl == 32)
  ------------------
  |  Branch (357:20): [True: 47.7k, False: 2.69M]
  ------------------
  358|  47.7k|                {
  359|       |                    /* for top left : 1 pel per nbr bit */
  360|  47.7k|                    if(!((nbr_flags >> 16) & 0x1))
  ------------------
  |  Branch (360:24): [True: 47.7k, False: 2]
  ------------------
  361|  47.7k|                    {
  362|       |                        /* top left not available */
  363|  47.7k|                        nbr_id_from_bl++;
  364|       |                        /* top and top right;  4 pels per nbr bit */
  365|  47.7k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags >> 8) & 0xFF) * 4;
  ------------------
  |  |   43|  47.7k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 47.7k]
  |  |  ------------------
  ------------------
  366|  47.7k|                    }
  367|  47.7k|                }
  368|       |                /* Reverse Substitution Process*/
  369|  2.74M|                if(nbr_id_from_bl)
  ------------------
  |  Branch (369:20): [True: 2.07M, False: 667k]
  ------------------
  370|  2.07M|                {
  371|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  372|  2.07M|                    pu1_ref_u = pu1_dst[2 * nbr_id_from_bl];
  373|  2.07M|                    pu1_ref_v = pu1_dst[2 * nbr_id_from_bl + 1];
  374|  36.0M|                    for(i = (2 * (nbr_id_from_bl - 1)); i >= 0; i -= 2)
  ------------------
  |  Branch (374:57): [True: 34.0M, False: 2.07M]
  ------------------
  375|  34.0M|                    {
  376|  34.0M|                        pu1_dst[i] = pu1_ref_u;
  377|  34.0M|                        pu1_dst[i + 1] = pu1_ref_v;
  378|  34.0M|                    }
  379|  2.07M|                }
  380|  2.74M|            }
  381|       |
  382|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  383|  40.8M|            while(nbr_id_from_bl < ((T16C_4NT)+1))
  ------------------
  |  |   82|  40.8M|#define T16C_4NT 64
  ------------------
  |  Branch (383:19): [True: 38.0M, False: 2.74M]
  ------------------
  384|  38.0M|            {
  385|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  386|       |                /* Devide by 4 to obtain the original index */
  387|  38.0M|                frwd_nbr_flag = (nbr_id_from_bl >> 2); /*+ (nbr_id_from_bl & 0x1);*/
  388|       |
  389|       |                /* The Top-left flag is at the last bit location of nbr_flags*/
  390|  38.0M|                if(nbr_id_from_bl == (T16C_4NT / 2))
  ------------------
  |  |   82|  38.0M|#define T16C_4NT 64
  ------------------
  |  Branch (390:20): [True: 2.69M, False: 35.3M]
  ------------------
  391|  2.69M|                {
  392|  2.69M|                    get_bits = GET_BIT(nbr_flags, 16);
  ------------------
  |  |   45|  2.69M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  393|       |                    /* only pel substitution for TL */
  394|  2.69M|                    if(!get_bits)
  ------------------
  |  Branch (394:24): [True: 333k, False: 2.36M]
  ------------------
  395|   333k|                    {
  396|   333k|                        pu1_dst[2 * nbr_id_from_bl] = pu1_dst[(2 * nbr_id_from_bl) - 2];
  397|   333k|                        pu1_dst[(2 * nbr_id_from_bl) + 1] = pu1_dst[(2 * nbr_id_from_bl) - 1];
  398|   333k|                    }
  399|  2.69M|                }
  400|  35.3M|                else
  401|  35.3M|                {
  402|  35.3M|                    get_bits = GET_BIT(nbr_flags, frwd_nbr_flag);
  ------------------
  |  |   45|  35.3M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  403|  35.3M|                    if(!get_bits)
  ------------------
  |  Branch (403:24): [True: 5.38M, False: 29.9M]
  ------------------
  404|  5.38M|                    {
  405|  5.38M|                        UWORD16 *pu2_dst;
  406|       |                        /* 4 pel substitution (other than TL) */
  407|  5.38M|                        pu2_dst = (UWORD16 *)&pu1_dst[(2 * nbr_id_from_bl) - 2];
  408|  5.38M|                        ihevc_memset_16bit((UWORD16 *)(pu1_dst + (2 * nbr_id_from_bl)), pu2_dst[0], 4);
  409|  5.38M|                    }
  410|       |
  411|  35.3M|                }
  412|  38.0M|                nbr_id_from_bl += (nbr_id_from_bl == (T16C_4NT / 2)) ? 1 : 4;
  ------------------
  |  |   82|  38.0M|#define T16C_4NT 64
  ------------------
  |  Branch (412:35): [True: 2.69M, False: 35.3M]
  ------------------
  413|  38.0M|            }
  414|  2.74M|        }
  415|  7.90M|    }
  416|  7.91M|}
ihevc_intra_pred_chroma_planar:
  463|  2.63M|{
  464|       |
  465|  2.63M|    WORD32 row, col;
  466|  2.63M|    WORD32 log2nt = 5;
  467|  2.63M|    WORD32 two_nt, three_nt;
  468|  2.63M|    UNUSED(src_strd);
  ------------------
  |  |   38|  2.63M|#define UNUSED(x) ((void)(x))
  ------------------
  469|  2.63M|    UNUSED(mode);
  ------------------
  |  |   38|  2.63M|#define UNUSED(x) ((void)(x))
  ------------------
  470|  2.63M|    switch(nt)
  471|  2.63M|    {
  472|   837k|        case 16:
  ------------------
  |  Branch (472:9): [True: 837k, False: 1.79M]
  ------------------
  473|   837k|            log2nt = 4;
  474|   837k|            break;
  475|  1.41M|        case 8:
  ------------------
  |  Branch (475:9): [True: 1.41M, False: 1.21M]
  ------------------
  476|  1.41M|            log2nt = 3;
  477|  1.41M|            break;
  478|   380k|        case 4:
  ------------------
  |  Branch (478:9): [True: 380k, False: 2.25M]
  ------------------
  479|   380k|            log2nt = 2;
  480|   380k|            break;
  481|      0|        default:
  ------------------
  |  Branch (481:9): [True: 0, False: 2.63M]
  ------------------
  482|      0|            break;
  483|  2.63M|    }
  484|  2.63M|    two_nt = 2 * nt;
  485|  2.63M|    three_nt = 3 * nt;
  486|       |    /* Planar filtering */
  487|  28.7M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (487:18): [True: 26.0M, False: 2.63M]
  ------------------
  488|  26.0M|    {
  489|   332M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (489:22): [True: 306M, False: 26.0M]
  ------------------
  490|   306M|        {
  491|   306M|            pu1_dst[row * dst_strd + col] = ((nt - 1 - col / 2)
  492|   306M|                            * pu1_ref[2 * (two_nt - 1 - row)]
  493|   306M|                            + (col / 2 + 1) * pu1_ref[2 * (three_nt + 1)]
  494|   306M|                            + (nt - 1 - row) * pu1_ref[2 * (two_nt + 1) + col]
  495|   306M|                            + (row + 1) * pu1_ref[2 * (nt - 1)] + nt) >> (log2nt + 1);
  496|       |
  497|   306M|            pu1_dst[row * dst_strd + col + 1] = ((nt - 1 - col / 2)
  498|   306M|                            * pu1_ref[2 * (two_nt - 1 - row) + 1]
  499|   306M|                            + (col / 2 + 1) * pu1_ref[2 * (three_nt + 1) + 1]
  500|   306M|                            + (nt - 1 - row) * pu1_ref[2 * (two_nt + 1) + col + 1]
  501|   306M|                            + (row + 1) * pu1_ref[2 * (nt - 1) + 1] + nt) >> (log2nt + 1);
  502|   306M|        }
  503|  26.0M|    }
  504|  2.63M|}
ihevc_intra_pred_chroma_dc:
  551|   767k|{
  552|       |
  553|   767k|    WORD32 acc_dc_u, acc_dc_v;
  554|   767k|    WORD32 dc_val_u, dc_val_v;
  555|   767k|    WORD32 i;
  556|   767k|    WORD32 row, col;
  557|   767k|    WORD32 log2nt = 5;
  558|   767k|    UNUSED(mode);
  ------------------
  |  |   38|   767k|#define UNUSED(x) ((void)(x))
  ------------------
  559|   767k|    UNUSED(src_strd);
  ------------------
  |  |   38|   767k|#define UNUSED(x) ((void)(x))
  ------------------
  560|   767k|    switch(nt)
  561|   767k|    {
  562|      0|        case 32:
  ------------------
  |  Branch (562:9): [True: 0, False: 767k]
  ------------------
  563|      0|            log2nt = 5;
  564|      0|            break;
  565|   290k|        case 16:
  ------------------
  |  Branch (565:9): [True: 290k, False: 477k]
  ------------------
  566|   290k|            log2nt = 4;
  567|   290k|            break;
  568|   301k|        case 8:
  ------------------
  |  Branch (568:9): [True: 301k, False: 465k]
  ------------------
  569|   301k|            log2nt = 3;
  570|   301k|            break;
  571|   175k|        case 4:
  ------------------
  |  Branch (571:9): [True: 175k, False: 591k]
  ------------------
  572|   175k|            log2nt = 2;
  573|   175k|            break;
  574|      0|        default:
  ------------------
  |  Branch (574:9): [True: 0, False: 767k]
  ------------------
  575|      0|            break;
  576|   767k|    }
  577|       |
  578|       |
  579|   767k|    acc_dc_u = 0;
  580|   767k|    acc_dc_v = 0;
  581|       |    /* Calculate DC value for the transform block */
  582|  8.51M|    for(i = (2 * nt); i < (4 * nt); i += 2)
  ------------------
  |  Branch (582:23): [True: 7.75M, False: 767k]
  ------------------
  583|  7.75M|    {
  584|  7.75M|        acc_dc_u += pu1_ref[i];
  585|  7.75M|        acc_dc_v += pu1_ref[i + 1];
  586|  7.75M|    }
  587|  8.52M|    for(i = ((4 * nt) + 2); i < ((6 * nt) + 2); i += 2)
  ------------------
  |  Branch (587:29): [True: 7.75M, False: 767k]
  ------------------
  588|  7.75M|    {
  589|  7.75M|        acc_dc_u += pu1_ref[i];
  590|  7.75M|        acc_dc_v += pu1_ref[i + 1];
  591|  7.75M|    }
  592|       |
  593|       |
  594|   767k|    dc_val_u = (acc_dc_u + nt) >> (log2nt + 1);
  595|   767k|    dc_val_v = (acc_dc_v + nt) >> (log2nt + 1);
  596|       |
  597|       |
  598|       |    /* Fill the remaining rows with DC value*/
  599|  8.50M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (599:18): [True: 7.73M, False: 767k]
  ------------------
  600|  7.73M|    {
  601|   103M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (601:22): [True: 96.0M, False: 7.73M]
  ------------------
  602|  96.0M|        {
  603|  96.0M|            pu1_dst[(row * dst_strd) + col] = dc_val_u;
  604|  96.0M|            pu1_dst[(row * dst_strd) + col + 1] = dc_val_v;
  605|  96.0M|        }
  606|  7.73M|    }
  607|       |
  608|   767k|}
ihevc_intra_pred_chroma_horz:
  655|   193k|{
  656|       |
  657|   193k|    WORD32 row, col;
  658|   193k|    UNUSED(mode);
  ------------------
  |  |   38|   193k|#define UNUSED(x) ((void)(x))
  ------------------
  659|   193k|    UNUSED(src_strd);
  ------------------
  |  |   38|   193k|#define UNUSED(x) ((void)(x))
  ------------------
  660|       |    /* Replication to next rows*/
  661|  1.93M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (661:18): [True: 1.74M, False: 193k]
  ------------------
  662|  1.74M|    {
  663|  21.9M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (663:22): [True: 20.2M, False: 1.74M]
  ------------------
  664|  20.2M|        {
  665|  20.2M|            pu1_dst[(row * dst_strd) + col] = pu1_ref[(4 * nt) - 2 - 2 * row];
  666|  20.2M|            pu1_dst[(row * dst_strd) + col + 1] = pu1_ref[(4 * nt) - 1 - 2 * row];
  667|  20.2M|        }
  668|  1.74M|    }
  669|   193k|}
ihevc_intra_pred_chroma_ver:
  717|   882k|{
  718|   882k|    WORD32 row, col;
  719|   882k|    UNUSED(mode);
  ------------------
  |  |   38|   882k|#define UNUSED(x) ((void)(x))
  ------------------
  720|   882k|    UNUSED(src_strd);
  ------------------
  |  |   38|   882k|#define UNUSED(x) ((void)(x))
  ------------------
  721|       |    /* Replication to next columns*/
  722|  9.84M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (722:18): [True: 8.95M, False: 882k]
  ------------------
  723|  8.95M|    {
  724|   120M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (724:22): [True: 111M, False: 8.95M]
  ------------------
  725|   111M|        {
  726|   111M|            pu1_dst[(row * dst_strd) + col] = pu1_ref[(4 * nt) + 2 + col];
  727|   111M|            pu1_dst[(row * dst_strd) + col + 1] = pu1_ref[(4 * nt) + 3 + col];
  728|   111M|        }
  729|  8.95M|    }
  730|   882k|}
ihevc_intra_pred_chroma_mode2:
  777|   228k|{
  778|   228k|    WORD32 row, col;
  779|       |
  780|   228k|    WORD32 intra_pred_ang = 32;
  781|   228k|    WORD32 idx_u, idx_v;
  782|   228k|    UNUSED(src_strd);
  ------------------
  |  |   38|   228k|#define UNUSED(x) ((void)(x))
  ------------------
  783|   228k|    UNUSED(mode);
  ------------------
  |  |   38|   228k|#define UNUSED(x) ((void)(x))
  ------------------
  784|       |    /* For the angle 45, replication is done from the corresponding angle */
  785|       |    /* intra_pred_ang = tan(angle) in q5 format */
  786|  2.28M|    for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (786:18): [True: 2.05M, False: 228k]
  ------------------
  787|  2.05M|    {
  788|  2.05M|        idx_u = ((col + 1) * intra_pred_ang) >> 5; /* Use idx++ */
  789|  2.05M|        idx_v = (((col + 1) + 1) * intra_pred_ang) >> 5; /* Use idx++ */
  790|  24.7M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (790:22): [True: 22.6M, False: 2.05M]
  ------------------
  791|  22.6M|        {
  792|  22.6M|            pu1_dst[col + (row * dst_strd)] = pu1_ref[(4 * nt) - 2 * row - idx_u - 3];
  793|  22.6M|            pu1_dst[(col + 1) + (row * dst_strd)] = pu1_ref[(4 * nt) - 2 * row - idx_v - 1];
  794|  22.6M|        }
  795|  2.05M|    }
  796|       |
  797|   228k|}
ihevc_intra_pred_chroma_mode_18_34:
  844|   246k|{
  845|   246k|    WORD32 row, col;
  846|   246k|    WORD32 intra_pred_ang;
  847|   246k|    WORD32 idx = 0;
  848|   246k|    UNUSED(src_strd);
  ------------------
  |  |   38|   246k|#define UNUSED(x) ((void)(x))
  ------------------
  849|   246k|    intra_pred_ang = 32; /*Default value*/
  850|       |    /* For mode 18, angle is -45degree */
  851|   246k|    if(mode == 18)
  ------------------
  |  Branch (851:8): [True: 44.0k, False: 202k]
  ------------------
  852|  44.0k|        intra_pred_ang = -32;
  853|       |    /* For mode 34, angle is 45degree */
  854|   202k|    else if(mode == 34)
  ------------------
  |  Branch (854:13): [True: 202k, False: 18.4E]
  ------------------
  855|   202k|        intra_pred_ang = 32;
  856|       |    /* For the angle 45 and -45, replication is done from the corresponding angle */
  857|       |    /* No interpolation is done for 45 degree*/
  858|  2.70M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (858:18): [True: 2.45M, False: 246k]
  ------------------
  859|  2.45M|    {
  860|  2.45M|        idx = ((row + 1) * intra_pred_ang) >> 5;
  861|       |
  862|  32.1M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (862:22): [True: 29.7M, False: 2.45M]
  ------------------
  863|  29.7M|        {
  864|  29.7M|            pu1_dst[col + (row * dst_strd)] = pu1_ref[(4 * nt) + col + 2 * idx + 2];
  865|  29.7M|            pu1_dst[(col + 1) + (row * dst_strd)] = pu1_ref[(4 * nt) + (col + 1) + 2 * idx + 2];
  866|  29.7M|        }
  867|       |
  868|  2.45M|    }
  869|       |
  870|   246k|}
ihevc_intra_pred_chroma_mode_3_to_9:
  917|   399k|{
  918|   399k|    WORD32 row, col;
  919|       |
  920|   399k|    WORD32 intra_pred_ang;
  921|   399k|    WORD32 idx_u, ref_main_idx_u;
  922|   399k|    WORD32 idx_v, ref_main_idx_v;
  923|   399k|    WORD32 pos_u, fract_u;
  924|   399k|    WORD32 pos_v, fract_v;
  925|   399k|    UNUSED(src_strd);
  ------------------
  |  |   38|   399k|#define UNUSED(x) ((void)(x))
  ------------------
  926|       |    /* Intra Pred Angle according to the mode */
  927|   399k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
  928|       |
  929|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
  930|       |    /* samples dependent on distance to obtain destination sample */
  931|       |
  932|  4.07M|    for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (932:18): [True: 3.67M, False: 399k]
  ------------------
  933|  3.67M|    {
  934|  3.67M|        pos_u = ((col / 2 + 1) * intra_pred_ang);
  935|  3.67M|        pos_v = ((col / 2 + 1) * intra_pred_ang);
  936|       |
  937|  3.67M|        idx_u = pos_u >> 5;
  938|  3.67M|        fract_u = pos_u & (31);
  939|       |
  940|  3.67M|        idx_v = pos_v >> 5;
  941|  3.67M|        fract_v = pos_v & (31);
  942|       |        // Do linear filtering
  943|  46.6M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (943:22): [True: 42.9M, False: 3.67M]
  ------------------
  944|  42.9M|        {
  945|  42.9M|            ref_main_idx_u = (4 * nt) - 2 * row - 2 * idx_u - 2;
  946|  42.9M|            ref_main_idx_v = (4 * nt) - 2 * row - 2 * idx_v - 1;
  947|       |
  948|  42.9M|            pu1_dst[col + (row * dst_strd)] = (((32 - fract_u)
  949|  42.9M|                            * pu1_ref[ref_main_idx_u]
  950|  42.9M|                            + fract_u * pu1_ref[ref_main_idx_u - 2] + 16) >> 5);
  951|       |
  952|  42.9M|            pu1_dst[(col + 1) + (row * dst_strd)] = (((32 - fract_v)
  953|  42.9M|                            * pu1_ref[ref_main_idx_v]
  954|  42.9M|                            + fract_v * pu1_ref[ref_main_idx_v - 2] + 16) >> 5);
  955|  42.9M|        }
  956|       |
  957|  3.67M|    }
  958|       |
  959|   399k|}
ihevc_intra_pred_chroma_mode_11_to_17:
 1006|   367k|{
 1007|       |    /* This function and ihevc_intra_pred_CHROMA_mode_19_to_25 are same except*/
 1008|       |    /* for ref main & side samples assignment,can be combined for */
 1009|       |    /* optimzation*/
 1010|       |
 1011|   367k|    WORD32 row, col, k;
 1012|   367k|    WORD32 intra_pred_ang, inv_ang, inv_ang_sum;
 1013|   367k|    WORD32 idx_u, idx_v, ref_main_idx_u, ref_main_idx_v, ref_idx;
 1014|   367k|    WORD32 pos_u, pos_v, fract_u, fract_v;
 1015|       |
 1016|   367k|    UWORD8 ref_temp[2 * MAX_CU_SIZE + 2];
 1017|   367k|    UWORD8 *ref_main;
 1018|   367k|    UNUSED(src_strd);
  ------------------
  |  |   38|   367k|#define UNUSED(x) ((void)(x))
  ------------------
 1019|   367k|    inv_ang_sum = 128;
 1020|       |
 1021|   367k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1022|       |
 1023|   367k|    inv_ang = gai4_ihevc_inv_ang_table[mode - 11];
 1024|       |    /* Intermediate reference samples for negative angle modes */
 1025|       |    /* This have to be removed during optimization*/
 1026|       |
 1027|       |    /* For horizontal modes, (ref main = ref left) (ref side = ref above) */
 1028|       |
 1029|       |
 1030|   367k|    ref_main = ref_temp + 2 * nt;
 1031|  4.43M|    for(k = 0; k < (2 * (nt + 1)); k += 2)
  ------------------
  |  Branch (1031:16): [True: 4.06M, False: 367k]
  ------------------
 1032|  4.06M|    {
 1033|  4.06M|        ref_temp[k + (2 * (nt - 1))] = pu1_ref[(4 * nt) - k];
 1034|  4.06M|        ref_temp[k + 1 + (2 * (nt - 1))] = pu1_ref[(4 * nt) - k + 1];
 1035|  4.06M|    }
 1036|       |
 1037|   367k|    ref_main = ref_temp + (2 * (nt - 1));
 1038|   367k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1039|       |
 1040|       |    /* SIMD Optimization can be done using look-up table for the loop */
 1041|       |    /* For negative angled derive the main reference samples from side */
 1042|       |    /*  reference samples refer to section 8.4.4.2.6 */
 1043|  1.67M|    for(k = -2; k > (2 * ref_idx); k -= 2)
  ------------------
  |  Branch (1043:17): [True: 1.31M, False: 367k]
  ------------------
 1044|  1.31M|    {
 1045|  1.31M|        inv_ang_sum += inv_ang;
 1046|  1.31M|        ref_main[k] = pu1_ref[(4 * nt) + ((inv_ang_sum >> 8) << 1)];
 1047|  1.31M|        ref_main[k + 1] = pu1_ref[((4 * nt) + 1) + ((inv_ang_sum >> 8) << 1)];
 1048|  1.31M|    }
 1049|       |
 1050|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1051|       |    /* samples dependent on distance to obtain destination sample */
 1052|  4.06M|    for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (1052:18): [True: 3.69M, False: 367k]
  ------------------
 1053|  3.69M|    {
 1054|  3.69M|        pos_u = ((col / 2 + 1) * intra_pred_ang);
 1055|  3.69M|        pos_v = ((col / 2 + 1) * intra_pred_ang);
 1056|  3.69M|        idx_u = pos_u >> 5;
 1057|  3.69M|        idx_v = pos_v >> 5;
 1058|  3.69M|        fract_u = pos_u & (31);
 1059|  3.69M|        fract_v = pos_v & (31);
 1060|       |
 1061|       |        // Do linear filtering
 1062|  50.3M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1062:22): [True: 46.6M, False: 3.69M]
  ------------------
 1063|  46.6M|        {
 1064|  46.6M|            ref_main_idx_u = 2 * (row + idx_u + 1);
 1065|  46.6M|            ref_main_idx_v = 2 * (row + idx_v + 1) + 1;
 1066|       |
 1067|  46.6M|            pu1_dst[col + (dst_strd * row)] = (UWORD8)(((32 - fract_u)
 1068|  46.6M|                            * ref_main[ref_main_idx_u]
 1069|  46.6M|                            + fract_u * ref_main[ref_main_idx_u + 2] + 16) >> 5);
 1070|  46.6M|            pu1_dst[(col + 1) + (dst_strd * row)] = (UWORD8)(((32 - fract_v)
 1071|  46.6M|                            * ref_main[ref_main_idx_v]
 1072|  46.6M|                            + fract_v * ref_main[ref_main_idx_v + 2] + 16) >> 5);
 1073|       |
 1074|  46.6M|        }
 1075|       |
 1076|  3.69M|    }
 1077|       |
 1078|   367k|}
ihevc_intra_pred_chroma_mode_19_to_25:
 1126|   378k|{
 1127|       |
 1128|   378k|    WORD32 row, col, k;
 1129|   378k|    WORD32 intra_pred_ang, idx;
 1130|   378k|    WORD32 inv_ang, inv_ang_sum, pos, fract;
 1131|   378k|    WORD32 ref_main_idx_u, ref_main_idx_v, ref_idx;
 1132|   378k|    UWORD8 ref_temp[(2 * MAX_CU_SIZE) + 2];
 1133|   378k|    UWORD8 *ref_main;
 1134|   378k|    UNUSED(src_strd);
  ------------------
  |  |   38|   378k|#define UNUSED(x) ((void)(x))
  ------------------
 1135|       |
 1136|       |
 1137|   378k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 1138|   378k|    inv_ang = gai4_ihevc_inv_ang_table_chroma[mode - 12];
 1139|       |
 1140|       |    /* Intermediate reference samples for negative angle modes */
 1141|       |    /* This have to be removed during optimization*/
 1142|       |    /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 1143|   378k|    ref_main = ref_temp + 2 * nt;
 1144|  4.15M|    for(k = 0; k < (2 * (nt + 1)); k += 2)
  ------------------
  |  Branch (1144:16): [True: 3.77M, False: 378k]
  ------------------
 1145|  3.77M|    {
 1146|  3.77M|        ref_temp[k + (2 * (nt - 1))] = pu1_ref[(4 * nt) + k];
 1147|  3.77M|        ref_temp[k + 1 + (2 * (nt - 1))] = pu1_ref[(4 * nt) + k + 1];
 1148|  3.77M|    }
 1149|       |
 1150|       |
 1151|   378k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1152|   378k|    inv_ang_sum = 128;
 1153|   378k|    ref_main = ref_temp + (2 * (nt - 1));
 1154|       |    /* SIMD Optimization can be done using look-up table for the loop */
 1155|       |    /* For negative angled derive the main reference samples from side */
 1156|       |    /*  reference samples refer to section 8.4.4.2.6 */
 1157|  1.50M|    for(k = -2; k > (2 * ref_idx); k -= 2)
  ------------------
  |  Branch (1157:17): [True: 1.13M, False: 378k]
  ------------------
 1158|  1.13M|    {
 1159|  1.13M|        inv_ang_sum += inv_ang;
 1160|  1.13M|        ref_main[k] = pu1_ref[(4 * nt) - (inv_ang_sum >> 8) * 2];
 1161|  1.13M|        ref_main[k + 1] = pu1_ref[((4 * nt) + 1) - (inv_ang_sum >> 8) * 2];
 1162|  1.13M|    }
 1163|       |
 1164|  3.77M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1164:18): [True: 3.39M, False: 378k]
  ------------------
 1165|  3.39M|    {
 1166|  3.39M|        pos = ((row + 1) * intra_pred_ang);
 1167|  3.39M|        idx = pos >> 5;
 1168|  3.39M|        fract = pos & (31);
 1169|       |
 1170|       |        // Do linear filtering
 1171|  41.9M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (1171:22): [True: 38.5M, False: 3.39M]
  ------------------
 1172|  38.5M|        {
 1173|  38.5M|            ref_main_idx_u = col + 2 * idx + 2;
 1174|  38.5M|            ref_main_idx_v = (col + 1) + 2 * idx + 2;
 1175|  38.5M|            pu1_dst[(row * dst_strd) + col] = (UWORD8)(((32 - fract)
 1176|  38.5M|                            * ref_main[ref_main_idx_u]
 1177|  38.5M|                            + fract * ref_main[ref_main_idx_u + 2] + 16) >> 5);
 1178|  38.5M|            pu1_dst[(row * dst_strd) + (col + 1)] = (UWORD8)(((32 - fract)
 1179|  38.5M|                            * ref_main[ref_main_idx_v]
 1180|  38.5M|                            + fract * ref_main[ref_main_idx_v + 2] + 16) >> 5);
 1181|       |
 1182|  38.5M|        }
 1183|       |
 1184|  3.39M|    }
 1185|       |
 1186|   378k|}
ihevc_intra_pred_chroma_mode_27_to_33:
 1234|   422k|{
 1235|   422k|    WORD32 row, col;
 1236|   422k|    WORD32 pos, fract;
 1237|   422k|    WORD32 intra_pred_ang;
 1238|   422k|    WORD32 idx, ref_main_idx_u, ref_main_idx_v;
 1239|   422k|    UNUSED(src_strd);
  ------------------
  |  |   38|   422k|#define UNUSED(x) ((void)(x))
  ------------------
 1240|       |
 1241|       |
 1242|   422k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 1243|       |
 1244|  4.03M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1244:18): [True: 3.60M, False: 422k]
  ------------------
 1245|  3.60M|    {
 1246|  3.60M|        pos = ((row + 1) * intra_pred_ang);
 1247|  3.60M|        idx = pos >> 5;
 1248|  3.60M|        fract = pos & (31);
 1249|       |
 1250|       |
 1251|       |        // Do linear filtering
 1252|  43.6M|        for(col = 0; col < (2 * nt); col += 2)
  ------------------
  |  Branch (1252:22): [True: 40.0M, False: 3.60M]
  ------------------
 1253|  40.0M|        {
 1254|  40.0M|            ref_main_idx_u = (4 * nt) + col + 2 * idx + 2;
 1255|  40.0M|            ref_main_idx_v = (4 * nt) + (col + 1) + 2 * idx + 2;
 1256|  40.0M|            pu1_dst[col + (row * dst_strd)] = (((32 - fract)
 1257|  40.0M|                            * pu1_ref[ref_main_idx_u]
 1258|  40.0M|                            + fract * pu1_ref[ref_main_idx_u + 2] + 16) >> 5);
 1259|  40.0M|            pu1_dst[(col + 1) + (row * dst_strd)] = (((32 - fract)
 1260|  40.0M|                            * pu1_ref[ref_main_idx_v]
 1261|  40.0M|                            + fract * pu1_ref[ref_main_idx_v + 2] + 16) >> 5);
 1262|       |
 1263|  40.0M|        }
 1264|  3.60M|    }
 1265|       |
 1266|   422k|}

ihevc_chroma_itrans_recon_4x4:
  116|   129k|{
  117|   129k|    WORD32 j;
  118|   129k|    WORD32 e[2], o[2];
  119|   129k|    WORD32 add;
  120|   129k|    WORD32 shift;
  121|   129k|    WORD16 *pi2_tmp_orig;
  122|   129k|    WORD32 trans_size;
  123|   129k|    UNUSED(zero_rows);
  ------------------
  |  |   38|   129k|#define UNUSED(x) ((void)(x))
  ------------------
  124|   129k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  419|   129k|#define TRANS_SIZE_4   4
  ------------------
  125|       |
  126|   129k|    pi2_tmp_orig = pi2_tmp;
  127|       |
  128|       |    /* Inverse Transform 1st stage */
  129|   129k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|   129k|#define IT_SHIFT_STAGE_1 7
  ------------------
  130|   129k|    add = 1 << (shift - 1);
  131|       |
  132|   645k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (132:16): [True: 516k, False: 129k]
  ------------------
  133|   516k|    {
  134|       |        /* Checking for Zero Cols */
  135|   516k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (135:12): [True: 284k, False: 231k]
  ------------------
  136|   284k|        {
  137|   284k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  138|   284k|        }
  139|   231k|        else
  140|   231k|        {
  141|       |
  142|       |            /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  143|   231k|            o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_src[src_strd]
  144|   231k|                            + g_ai2_ihevc_trans_4[3][0] * pi2_src[3 * src_strd];
  145|   231k|            o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_src[src_strd]
  146|   231k|                            + g_ai2_ihevc_trans_4[3][1] * pi2_src[3 * src_strd];
  147|   231k|            e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_src[0]
  148|   231k|                            + g_ai2_ihevc_trans_4[2][0] * pi2_src[2 * src_strd];
  149|   231k|            e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_src[0]
  150|   231k|                            + g_ai2_ihevc_trans_4[2][1] * pi2_src[2 * src_strd];
  151|       |
  152|   231k|            pi2_tmp[0] =
  153|   231k|                            CLIP_S16(((e[0] + o[0] + add) >> shift));
  ------------------
  |  |   53|   231k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   231k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 229, False: 231k]
  |  |  |  |  |  Branch (40:53): [True: 161, False: 231k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  154|   231k|            pi2_tmp[1] =
  155|   231k|                            CLIP_S16(((e[1] + o[1] + add) >> shift));
  ------------------
  |  |   53|   231k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   231k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 75, False: 231k]
  |  |  |  |  |  Branch (40:53): [True: 47, False: 231k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  156|   231k|            pi2_tmp[2] =
  157|   231k|                            CLIP_S16(((e[1] - o[1] + add) >> shift));
  ------------------
  |  |   53|   231k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   231k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 73, False: 231k]
  |  |  |  |  |  Branch (40:53): [True: 39, False: 231k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  158|   231k|            pi2_tmp[3] =
  159|   231k|                            CLIP_S16(((e[0] - o[0] + add) >> shift));
  ------------------
  |  |   53|   231k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   231k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 170, False: 231k]
  |  |  |  |  |  Branch (40:53): [True: 284, False: 231k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  160|       |
  161|   231k|        }
  162|   516k|        pi2_src++;
  163|   516k|        pi2_tmp += trans_size;
  164|   516k|        zero_cols = zero_cols >> 1;
  165|   516k|    }
  166|       |
  167|   129k|    pi2_tmp = pi2_tmp_orig;
  168|       |
  169|       |    /* Inverse Transform 2nd stage */
  170|   129k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|   129k|#define IT_SHIFT_STAGE_2 12
  ------------------
  171|   129k|    add = 1 << (shift - 1);
  172|       |
  173|   645k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (173:16): [True: 516k, False: 129k]
  ------------------
  174|   516k|    {
  175|   516k|        WORD32 itrans_out;
  176|       |        /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  177|   516k|        o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_tmp[trans_size]
  178|   516k|                        + g_ai2_ihevc_trans_4[3][0] * pi2_tmp[3 * trans_size];
  179|   516k|        o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_tmp[trans_size]
  180|   516k|                        + g_ai2_ihevc_trans_4[3][1] * pi2_tmp[3 * trans_size];
  181|   516k|        e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_tmp[0]
  182|   516k|                        + g_ai2_ihevc_trans_4[2][0] * pi2_tmp[2 * trans_size];
  183|   516k|        e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_tmp[0]
  184|   516k|                        + g_ai2_ihevc_trans_4[2][1] * pi2_tmp[2 * trans_size];
  185|       |
  186|   516k|        itrans_out =
  187|   516k|                        CLIP_S16(((e[0] + o[0] + add) >> shift));
  ------------------
  |  |   53|   516k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   516k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 516k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 516k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  188|   516k|        pu1_dst[0 * 2] = CLIP_U8((itrans_out + pu1_pred[0 * 2]));
  ------------------
  |  |   40|   516k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   516k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 66.9k, False: 449k]
  |  |  |  |  |  Branch (40:53): [True: 45.4k, False: 404k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  189|   516k|        itrans_out =
  190|   516k|                        CLIP_S16(((e[1] + o[1] + add) >> shift));
  ------------------
  |  |   53|   516k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   516k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 516k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 516k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|   516k|        pu1_dst[1 * 2] = CLIP_U8((itrans_out + pu1_pred[1 * 2]));
  ------------------
  |  |   40|   516k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   516k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 57.1k, False: 459k]
  |  |  |  |  |  Branch (40:53): [True: 40.7k, False: 418k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|   516k|        itrans_out =
  193|   516k|                        CLIP_S16(((e[1] - o[1] + add) >> shift));
  ------------------
  |  |   53|   516k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   516k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 516k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 516k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  194|   516k|        pu1_dst[2 * 2] = CLIP_U8((itrans_out + pu1_pred[2 * 2]));
  ------------------
  |  |   40|   516k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   516k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 57.1k, False: 459k]
  |  |  |  |  |  Branch (40:53): [True: 40.6k, False: 418k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|   516k|        itrans_out =
  196|   516k|                        CLIP_S16(((e[0] - o[0] + add) >> shift));
  ------------------
  |  |   53|   516k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   516k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 516k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 516k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|   516k|        pu1_dst[3 * 2] = CLIP_U8((itrans_out + pu1_pred[3 * 2]));
  ------------------
  |  |   40|   516k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   516k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 65.7k, False: 450k]
  |  |  |  |  |  Branch (40:53): [True: 48.9k, False: 401k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  198|       |
  199|   516k|        pi2_tmp++;
  200|   516k|        pu1_pred += pred_strd;
  201|   516k|        pu1_dst += dst_strd;
  202|       |
  203|   516k|    }
  204|   129k|}

ihevc_chroma_itrans_recon_16x16:
  117|   481k|{
  118|   481k|    WORD32 j, k;
  119|   481k|    WORD32 e[8], o[8];
  120|   481k|    WORD32 ee[4], eo[4];
  121|   481k|    WORD32 eee[2], eeo[2];
  122|   481k|    WORD32 add;
  123|   481k|    WORD32 shift;
  124|   481k|    WORD16 *pi2_tmp_orig;
  125|   481k|    WORD32 trans_size;
  126|   481k|    WORD32 row_limit_2nd_stage, zero_rows_2nd_stage = zero_cols;
  127|       |
  128|   481k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  421|   481k|#define TRANS_SIZE_16 16
  ------------------
  129|   481k|    pi2_tmp_orig = pi2_tmp;
  130|       |
  131|   481k|    if((zero_cols & 0xFFF0) == 0xFFF0)
  ------------------
  |  Branch (131:8): [True: 329k, False: 152k]
  ------------------
  132|   329k|        row_limit_2nd_stage = 4;
  133|   152k|    else if((zero_cols & 0xFF00) == 0xFF00)
  ------------------
  |  Branch (133:13): [True: 67.8k, False: 84.4k]
  ------------------
  134|  67.8k|        row_limit_2nd_stage = 8;
  135|  84.4k|    else
  136|  84.4k|        row_limit_2nd_stage = TRANS_SIZE_16;
  ------------------
  |  |  421|  84.4k|#define TRANS_SIZE_16 16
  ------------------
  137|       |
  138|   481k|    if((zero_rows & 0xFFF0) == 0xFFF0) /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (138:8): [True: 200k, False: 280k]
  ------------------
  139|   200k|    {
  140|       |        /************************************************************************************************/
  141|       |        /**********************************START - IT_RECON_16x16****************************************/
  142|       |        /************************************************************************************************/
  143|       |
  144|       |        /* Inverse Transform 1st stage */
  145|   200k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|   200k|#define IT_SHIFT_STAGE_1 7
  ------------------
  146|   200k|        add = 1 << (shift - 1);
  147|       |
  148|  1.33M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (148:20): [True: 1.13M, False: 200k]
  ------------------
  149|  1.13M|        {
  150|       |            /* Checking for Zero Cols */
  151|  1.13M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (151:16): [True: 621k, False: 510k]
  ------------------
  152|   621k|            {
  153|   621k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  154|   621k|            }
  155|   510k|            else
  156|   510k|            {
  157|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  158|  4.60M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (158:28): [True: 4.09M, False: 510k]
  ------------------
  159|  4.09M|                {
  160|  4.09M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  161|  4.09M|                                    + g_ai2_ihevc_trans_16[3][k]
  162|  4.09M|                                                    * pi2_src[3 * src_strd];
  163|  4.09M|                }
  164|  2.55M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (164:28): [True: 2.04M, False: 510k]
  ------------------
  165|  2.04M|                {
  166|  2.04M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd];
  167|  2.04M|                }
  168|   510k|                eeo[0] = 0;
  169|   510k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  170|   510k|                eeo[1] = 0;
  171|   510k|                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|  1.53M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (174:28): [True: 1.02M, False: 510k]
  ------------------
  175|  1.02M|                {
  176|  1.02M|                    ee[k] = eee[k] + eeo[k];
  177|  1.02M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  178|  1.02M|                }
  179|  2.55M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (179:28): [True: 2.04M, False: 510k]
  ------------------
  180|  2.04M|                {
  181|  2.04M|                    e[k] = ee[k] + eo[k];
  182|  2.04M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  183|  2.04M|                }
  184|  4.59M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (184:28): [True: 4.08M, False: 510k]
  ------------------
  185|  4.08M|                {
  186|  4.08M|                    pi2_tmp[k] =
  187|  4.08M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  4.08M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 302, False: 4.08M]
  |  |  |  |  |  Branch (40:53): [True: 560, False: 4.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  188|  4.08M|                    pi2_tmp[k + 8] =
  189|  4.08M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  4.08M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.08M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 533, False: 4.08M]
  |  |  |  |  |  Branch (40:53): [True: 1.24k, False: 4.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|  4.08M|                }
  191|   510k|            }
  192|  1.13M|            pi2_src++;
  193|  1.13M|            pi2_tmp += trans_size;
  194|  1.13M|            zero_cols = zero_cols >> 1;
  195|  1.13M|        }
  196|       |
  197|   200k|        pi2_tmp = pi2_tmp_orig;
  198|       |
  199|       |        /* Inverse Transform 2nd stage */
  200|   200k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|   200k|#define IT_SHIFT_STAGE_2 12
  ------------------
  201|   200k|        add = 1 << (shift - 1);
  202|   200k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (202:12): [True: 143k, False: 57.6k]
  ------------------
  203|   143k|        {
  204|  2.43M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (204:24): [True: 2.28M, False: 143k]
  ------------------
  205|  2.28M|            {
  206|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  207|  20.5M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (207:28): [True: 18.2M, False: 2.28M]
  ------------------
  208|  18.2M|                {
  209|  18.2M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  210|  18.2M|                                    + g_ai2_ihevc_trans_16[3][k]
  211|  18.2M|                                                    * pi2_tmp[3 * trans_size];
  212|  18.2M|                }
  213|  11.4M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (213:28): [True: 9.15M, False: 2.28M]
  ------------------
  214|  9.15M|                {
  215|  9.15M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  216|  9.15M|                }
  217|  2.28M|                eeo[0] = 0;
  218|  2.28M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  219|  2.28M|                eeo[1] = 0;
  220|  2.28M|                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|  6.86M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (223:28): [True: 4.57M, False: 2.28M]
  ------------------
  224|  4.57M|                {
  225|  4.57M|                    ee[k] = eee[k] + eeo[k];
  226|  4.57M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  227|  4.57M|                }
  228|  11.4M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (228:28): [True: 9.14M, False: 2.28M]
  ------------------
  229|  9.14M|                {
  230|  9.14M|                    e[k] = ee[k] + eo[k];
  231|  9.14M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  232|  9.14M|                }
  233|  20.5M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (233:28): [True: 18.2M, False: 2.28M]
  ------------------
  234|  18.2M|                {
  235|  18.2M|                    WORD32 itrans_out;
  236|  18.2M|                    itrans_out =
  237|  18.2M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  18.2M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  18.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 18.2M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 18.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|  18.2M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  18.2M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  18.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 487k, False: 17.7M]
  |  |  |  |  |  Branch (40:53): [True: 367k, False: 17.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  239|  18.2M|                    itrans_out =
  240|  18.2M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  18.2M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  18.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 18.2M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 18.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|  18.2M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  18.2M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  18.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 450k, False: 17.8M]
  |  |  |  |  |  Branch (40:53): [True: 384k, False: 17.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  242|  18.2M|                }
  243|  2.28M|                pi2_tmp++;
  244|  2.28M|                pu1_pred += pred_strd;
  245|  2.28M|                pu1_dst += dst_strd;
  246|  2.28M|            }
  247|   143k|        }
  248|  57.6k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (248:17): [True: 45.3k, False: 12.3k]
  ------------------
  249|  45.3k|        {
  250|   767k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (250:24): [True: 721k, False: 45.3k]
  ------------------
  251|   721k|            {
  252|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  253|  6.47M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (253:28): [True: 5.75M, False: 721k]
  ------------------
  254|  5.75M|                {
  255|  5.75M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  256|  5.75M|                                    + g_ai2_ihevc_trans_16[3][k]
  257|  5.75M|                                                    * pi2_tmp[3 * trans_size]
  258|  5.75M|                                    + g_ai2_ihevc_trans_16[5][k]
  259|  5.75M|                                                    * pi2_tmp[5 * trans_size]
  260|  5.75M|                                    + g_ai2_ihevc_trans_16[7][k]
  261|  5.75M|                                                    * pi2_tmp[7 * trans_size];
  262|  5.75M|                }
  263|  3.60M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (263:28): [True: 2.88M, False: 721k]
  ------------------
  264|  2.88M|                {
  265|  2.88M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  266|  2.88M|                                    + g_ai2_ihevc_trans_16[6][k]
  267|  2.88M|                                                    * pi2_tmp[6 * trans_size];
  268|  2.88M|                }
  269|   721k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  270|   721k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  271|   721k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  272|   721k|                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.16M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (275:28): [True: 1.44M, False: 721k]
  ------------------
  276|  1.44M|                {
  277|  1.44M|                    ee[k] = eee[k] + eeo[k];
  278|  1.44M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  279|  1.44M|                }
  280|  3.60M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (280:28): [True: 2.88M, False: 721k]
  ------------------
  281|  2.88M|                {
  282|  2.88M|                    e[k] = ee[k] + eo[k];
  283|  2.88M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  284|  2.88M|                }
  285|  6.44M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (285:28): [True: 5.72M, False: 721k]
  ------------------
  286|  5.72M|                {
  287|  5.72M|                    WORD32 itrans_out;
  288|  5.72M|                    itrans_out =
  289|  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  290|  5.72M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   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: 567k, False: 5.15M]
  |  |  |  |  |  Branch (40:53): [True: 468k, False: 4.68M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  291|  5.72M|                    itrans_out =
  292|  5.72M|                                    CLIP_S16(((e[7 - k] - o[7 - 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  293|  5.72M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   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: 585k, False: 5.13M]
  |  |  |  |  |  Branch (40:53): [True: 461k, False: 4.67M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  294|  5.72M|                }
  295|   721k|                pi2_tmp++;
  296|   721k|                pu1_pred += pred_strd;
  297|   721k|                pu1_dst += dst_strd;
  298|   721k|            }
  299|  45.3k|        }
  300|  12.3k|        else /* All rows of output of 1st stage are non-zero */
  301|  12.3k|        {
  302|   203k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (302:24): [True: 191k, False: 12.3k]
  ------------------
  303|   191k|            {
  304|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  305|  1.70M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (305:28): [True: 1.51M, False: 191k]
  ------------------
  306|  1.51M|                {
  307|  1.51M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  308|  1.51M|                                    + g_ai2_ihevc_trans_16[3][k]
  309|  1.51M|                                                    * pi2_tmp[3 * trans_size]
  310|  1.51M|                                    + g_ai2_ihevc_trans_16[5][k]
  311|  1.51M|                                                    * pi2_tmp[5 * trans_size]
  312|  1.51M|                                    + g_ai2_ihevc_trans_16[7][k]
  313|  1.51M|                                                    * pi2_tmp[7 * trans_size]
  314|  1.51M|                                    + g_ai2_ihevc_trans_16[9][k]
  315|  1.51M|                                                    * pi2_tmp[9 * trans_size]
  316|  1.51M|                                    + g_ai2_ihevc_trans_16[11][k]
  317|  1.51M|                                                    * pi2_tmp[11 * trans_size]
  318|  1.51M|                                    + g_ai2_ihevc_trans_16[13][k]
  319|  1.51M|                                                    * pi2_tmp[13 * trans_size]
  320|  1.51M|                                    + g_ai2_ihevc_trans_16[15][k]
  321|  1.51M|                                                    * pi2_tmp[15 * trans_size];
  322|  1.51M|                }
  323|   958k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (323:28): [True: 766k, False: 191k]
  ------------------
  324|   766k|                {
  325|   766k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  326|   766k|                                    + g_ai2_ihevc_trans_16[6][k]
  327|   766k|                                                    * pi2_tmp[6 * trans_size]
  328|   766k|                                    + g_ai2_ihevc_trans_16[10][k]
  329|   766k|                                                    * pi2_tmp[10 * trans_size]
  330|   766k|                                    + g_ai2_ihevc_trans_16[14][k]
  331|   766k|                                                    * pi2_tmp[14 * trans_size];
  332|   766k|                }
  333|   191k|                eeo[0] =
  334|   191k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  335|   191k|                                                + g_ai2_ihevc_trans_16[12][0]
  336|   191k|                                                                * pi2_tmp[12
  337|   191k|                                                                                * trans_size];
  338|   191k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  339|   191k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  340|   191k|                eeo[1] =
  341|   191k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  342|   191k|                                                + g_ai2_ihevc_trans_16[12][1]
  343|   191k|                                                                * pi2_tmp[12
  344|   191k|                                                                                * trans_size];
  345|   191k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  346|   191k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  347|       |
  348|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  349|   558k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (349:28): [True: 366k, False: 191k]
  ------------------
  350|   366k|                {
  351|   366k|                    ee[k] = eee[k] + eeo[k];
  352|   366k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  353|   366k|                }
  354|   925k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (354:28): [True: 734k, False: 191k]
  ------------------
  355|   734k|                {
  356|   734k|                    e[k] = ee[k] + eo[k];
  357|   734k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  358|   734k|                }
  359|  1.60M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (359:28): [True: 1.41M, False: 191k]
  ------------------
  360|  1.41M|                {
  361|  1.41M|                    WORD32 itrans_out;
  362|  1.41M|                    itrans_out =
  363|  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: 0, False: 1.41M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.41M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  364|  1.41M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  1.41M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.41M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 100k, False: 1.31M]
  |  |  |  |  |  Branch (40:53): [True: 238k, False: 1.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  365|  1.41M|                    itrans_out =
  366|  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: 0, False: 1.41M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.41M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  367|  1.41M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  1.41M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.41M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 89.9k, False: 1.32M]
  |  |  |  |  |  Branch (40:53): [True: 261k, False: 1.06M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  368|  1.41M|                }
  369|   191k|                pi2_tmp++;
  370|   191k|                pu1_pred += pred_strd;
  371|   191k|                pu1_dst += dst_strd;
  372|   191k|            }
  373|  12.3k|        }
  374|       |        /************************************************************************************************/
  375|       |        /************************************END - IT_RECON_16x16****************************************/
  376|       |        /************************************************************************************************/
  377|   200k|    }
  378|   280k|    else if((zero_rows & 0xFF00) == 0xFF00) /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (378:13): [True: 180k, False: 100k]
  ------------------
  379|   180k|    {
  380|       |        /************************************************************************************************/
  381|       |        /**********************************START - IT_RECON_16x16****************************************/
  382|       |        /************************************************************************************************/
  383|       |
  384|       |        /* Inverse Transform 1st stage */
  385|   180k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|   180k|#define IT_SHIFT_STAGE_1 7
  ------------------
  386|   180k|        add = 1 << (shift - 1);
  387|       |
  388|  1.16M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (388:20): [True: 980k, False: 180k]
  ------------------
  389|   980k|        {
  390|       |            /* Checking for Zero Cols */
  391|   980k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (391:16): [True: 494k, False: 486k]
  ------------------
  392|   494k|            {
  393|   494k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  394|   494k|            }
  395|   486k|            else
  396|   486k|            {
  397|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  398|  4.37M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (398:28): [True: 3.89M, False: 486k]
  ------------------
  399|  3.89M|                {
  400|  3.89M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  401|  3.89M|                                    + g_ai2_ihevc_trans_16[3][k]
  402|  3.89M|                                                    * pi2_src[3 * src_strd]
  403|  3.89M|                                    + g_ai2_ihevc_trans_16[5][k]
  404|  3.89M|                                                    * pi2_src[5 * src_strd]
  405|  3.89M|                                    + g_ai2_ihevc_trans_16[7][k]
  406|  3.89M|                                                    * pi2_src[7 * src_strd];
  407|  3.89M|                }
  408|  2.43M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (408:28): [True: 1.94M, False: 486k]
  ------------------
  409|  1.94M|                {
  410|  1.94M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  411|  1.94M|                                    + g_ai2_ihevc_trans_16[6][k]
  412|  1.94M|                                                    * pi2_src[6 * src_strd];
  413|  1.94M|                }
  414|   486k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd];
  415|   486k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  416|   486k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd];
  417|   486k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0];
  418|       |
  419|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  420|  1.45M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (420:28): [True: 973k, False: 486k]
  ------------------
  421|   973k|                {
  422|   973k|                    ee[k] = eee[k] + eeo[k];
  423|   973k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  424|   973k|                }
  425|  2.43M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (425:28): [True: 1.94M, False: 486k]
  ------------------
  426|  1.94M|                {
  427|  1.94M|                    e[k] = ee[k] + eo[k];
  428|  1.94M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  429|  1.94M|                }
  430|  4.37M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (430:28): [True: 3.89M, False: 486k]
  ------------------
  431|  3.89M|                {
  432|  3.89M|                    pi2_tmp[k] =
  433|  3.89M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  3.89M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.89M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.74k, False: 3.89M]
  |  |  |  |  |  Branch (40:53): [True: 1.45k, False: 3.88M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  434|  3.89M|                    pi2_tmp[k + 8] =
  435|  3.89M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  3.89M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.89M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.59k, False: 3.89M]
  |  |  |  |  |  Branch (40:53): [True: 2.06k, False: 3.88M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  436|  3.89M|                }
  437|   486k|            }
  438|   980k|            pi2_src++;
  439|   980k|            pi2_tmp += trans_size;
  440|   980k|            zero_cols = zero_cols >> 1;
  441|   980k|        }
  442|       |
  443|   180k|        pi2_tmp = pi2_tmp_orig;
  444|       |
  445|       |        /* Inverse Transform 2nd stage */
  446|   180k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|   180k|#define IT_SHIFT_STAGE_2 12
  ------------------
  447|   180k|        add = 1 << (shift - 1);
  448|   180k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (448:12): [True: 144k, False: 35.5k]
  ------------------
  449|   144k|        {
  450|  2.45M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (450:24): [True: 2.30M, False: 144k]
  ------------------
  451|  2.30M|            {
  452|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  453|  20.7M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (453:28): [True: 18.4M, False: 2.30M]
  ------------------
  454|  18.4M|                {
  455|  18.4M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  456|  18.4M|                                    + g_ai2_ihevc_trans_16[3][k]
  457|  18.4M|                                                    * pi2_tmp[3 * trans_size];
  458|  18.4M|                }
  459|  11.5M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (459:28): [True: 9.22M, False: 2.30M]
  ------------------
  460|  9.22M|                {
  461|  9.22M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  462|  9.22M|                }
  463|  2.30M|                eeo[0] = 0;
  464|  2.30M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  465|  2.30M|                eeo[1] = 0;
  466|  2.30M|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  467|       |
  468|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  469|  6.91M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (469:28): [True: 4.60M, False: 2.30M]
  ------------------
  470|  4.60M|                {
  471|  4.60M|                    ee[k] = eee[k] + eeo[k];
  472|  4.60M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  473|  4.60M|                }
  474|  11.5M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (474:28): [True: 9.19M, False: 2.30M]
  ------------------
  475|  9.19M|                {
  476|  9.19M|                    e[k] = ee[k] + eo[k];
  477|  9.19M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  478|  9.19M|                }
  479|  20.6M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (479:28): [True: 18.3M, False: 2.30M]
  ------------------
  480|  18.3M|                {
  481|  18.3M|                    WORD32 itrans_out;
  482|  18.3M|                    itrans_out =
  483|  18.3M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  18.3M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  18.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 18.3M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 18.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|  18.3M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   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.76M, False: 16.5M]
  |  |  |  |  |  Branch (40:53): [True: 1.03M, False: 15.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  485|  18.3M|                    itrans_out =
  486|  18.3M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  18.3M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  18.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 18.3M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 18.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|  18.3M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   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.61M, False: 16.7M]
  |  |  |  |  |  Branch (40:53): [True: 1.07M, False: 15.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  488|  18.3M|                }
  489|  2.30M|                pi2_tmp++;
  490|  2.30M|                pu1_pred += pred_strd;
  491|  2.30M|                pu1_dst += dst_strd;
  492|  2.30M|            }
  493|   144k|        }
  494|  35.5k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (494:17): [True: 21.0k, False: 14.5k]
  ------------------
  495|  21.0k|        {
  496|   356k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (496:24): [True: 335k, False: 21.0k]
  ------------------
  497|   335k|            {
  498|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  499|  3.01M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (499:28): [True: 2.68M, False: 335k]
  ------------------
  500|  2.68M|                {
  501|  2.68M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  502|  2.68M|                                    + g_ai2_ihevc_trans_16[3][k]
  503|  2.68M|                                                    * pi2_tmp[3 * trans_size]
  504|  2.68M|                                    + g_ai2_ihevc_trans_16[5][k]
  505|  2.68M|                                                    * pi2_tmp[5 * trans_size]
  506|  2.68M|                                    + g_ai2_ihevc_trans_16[7][k]
  507|  2.68M|                                                    * pi2_tmp[7 * trans_size];
  508|  2.68M|                }
  509|  1.67M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (509:28): [True: 1.34M, False: 335k]
  ------------------
  510|  1.34M|                {
  511|  1.34M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  512|  1.34M|                                    + g_ai2_ihevc_trans_16[6][k]
  513|  1.34M|                                                    * pi2_tmp[6 * trans_size];
  514|  1.34M|                }
  515|   335k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  516|   335k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  517|   335k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  518|   335k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  519|       |
  520|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  521|  1.00M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (521:28): [True: 669k, False: 335k]
  ------------------
  522|   669k|                {
  523|   669k|                    ee[k] = eee[k] + eeo[k];
  524|   669k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  525|   669k|                }
  526|  1.67M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (526:28): [True: 1.34M, False: 335k]
  ------------------
  527|  1.34M|                {
  528|  1.34M|                    e[k] = ee[k] + eo[k];
  529|  1.34M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  530|  1.34M|                }
  531|  3.00M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (531:28): [True: 2.67M, False: 335k]
  ------------------
  532|  2.67M|                {
  533|  2.67M|                    WORD32 itrans_out;
  534|  2.67M|                    itrans_out =
  535|  2.67M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  2.67M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.67M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.67M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.67M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  536|  2.67M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  2.67M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.67M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 300k, False: 2.37M]
  |  |  |  |  |  Branch (40:53): [True: 247k, False: 2.12M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  537|  2.67M|                    itrans_out =
  538|  2.67M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  2.67M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.67M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.67M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.67M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  539|  2.67M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  2.67M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.67M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 272k, False: 2.40M]
  |  |  |  |  |  Branch (40:53): [True: 251k, False: 2.14M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  540|  2.67M|                }
  541|   335k|                pi2_tmp++;
  542|   335k|                pu1_pred += pred_strd;
  543|   335k|                pu1_dst += dst_strd;
  544|   335k|            }
  545|  21.0k|        }
  546|  14.5k|        else /* All rows of output of 1st stage are non-zero */
  547|  14.5k|        {
  548|   248k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (548:24): [True: 233k, False: 14.5k]
  ------------------
  549|   233k|            {
  550|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  551|  2.09M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (551:28): [True: 1.85M, False: 233k]
  ------------------
  552|  1.85M|                {
  553|  1.85M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  554|  1.85M|                                    + g_ai2_ihevc_trans_16[3][k]
  555|  1.85M|                                                    * pi2_tmp[3 * trans_size]
  556|  1.85M|                                    + g_ai2_ihevc_trans_16[5][k]
  557|  1.85M|                                                    * pi2_tmp[5 * trans_size]
  558|  1.85M|                                    + g_ai2_ihevc_trans_16[7][k]
  559|  1.85M|                                                    * pi2_tmp[7 * trans_size]
  560|  1.85M|                                    + g_ai2_ihevc_trans_16[9][k]
  561|  1.85M|                                                    * pi2_tmp[9 * trans_size]
  562|  1.85M|                                    + g_ai2_ihevc_trans_16[11][k]
  563|  1.85M|                                                    * pi2_tmp[11 * trans_size]
  564|  1.85M|                                    + g_ai2_ihevc_trans_16[13][k]
  565|  1.85M|                                                    * pi2_tmp[13 * trans_size]
  566|  1.85M|                                    + g_ai2_ihevc_trans_16[15][k]
  567|  1.85M|                                                    * pi2_tmp[15 * trans_size];
  568|  1.85M|                }
  569|  1.16M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (569:28): [True: 933k, False: 233k]
  ------------------
  570|   933k|                {
  571|   933k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  572|   933k|                                    + g_ai2_ihevc_trans_16[6][k]
  573|   933k|                                                    * pi2_tmp[6 * trans_size]
  574|   933k|                                    + g_ai2_ihevc_trans_16[10][k]
  575|   933k|                                                    * pi2_tmp[10 * trans_size]
  576|   933k|                                    + g_ai2_ihevc_trans_16[14][k]
  577|   933k|                                                    * pi2_tmp[14 * trans_size];
  578|   933k|                }
  579|   233k|                eeo[0] =
  580|   233k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  581|   233k|                                                + g_ai2_ihevc_trans_16[12][0]
  582|   233k|                                                                * pi2_tmp[12
  583|   233k|                                                                                * trans_size];
  584|   233k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  585|   233k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  586|   233k|                eeo[1] =
  587|   233k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  588|   233k|                                                + g_ai2_ihevc_trans_16[12][1]
  589|   233k|                                                                * pi2_tmp[12
  590|   233k|                                                                                * trans_size];
  591|   233k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  592|   233k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  593|       |
  594|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  595|   694k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (595:28): [True: 461k, False: 233k]
  ------------------
  596|   461k|                {
  597|   461k|                    ee[k] = eee[k] + eeo[k];
  598|   461k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  599|   461k|                }
  600|  1.15M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (600:28): [True: 922k, False: 233k]
  ------------------
  601|   922k|                {
  602|   922k|                    e[k] = ee[k] + eo[k];
  603|   922k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  604|   922k|                }
  605|  2.07M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (605:28): [True: 1.84M, False: 233k]
  ------------------
  606|  1.84M|                {
  607|  1.84M|                    WORD32 itrans_out;
  608|  1.84M|                    itrans_out =
  609|  1.84M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.84M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.84M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  610|  1.84M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  1.84M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 125k, False: 1.71M]
  |  |  |  |  |  Branch (40:53): [True: 103k, False: 1.61M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  611|  1.84M|                    itrans_out =
  612|  1.84M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  1.84M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.84M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  613|  1.84M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  1.84M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 144k, False: 1.69M]
  |  |  |  |  |  Branch (40:53): [True: 89.9k, False: 1.60M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  614|  1.84M|                }
  615|   233k|                pi2_tmp++;
  616|   233k|                pu1_pred += pred_strd;
  617|   233k|                pu1_dst += dst_strd;
  618|   233k|            }
  619|  14.5k|        }
  620|       |        /************************************************************************************************/
  621|       |        /************************************END - IT_RECON_16x16****************************************/
  622|       |        /************************************************************************************************/
  623|   180k|    }
  624|   100k|    else /* All rows of input are non-zero */
  625|   100k|    {
  626|       |        /************************************************************************************************/
  627|       |        /**********************************START - IT_RECON_16x16****************************************/
  628|       |        /************************************************************************************************/
  629|       |
  630|       |        /* Inverse Transform 1st stage */
  631|   100k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|   100k|#define IT_SHIFT_STAGE_1 7
  ------------------
  632|   100k|        add = 1 << (shift - 1);
  633|       |
  634|  1.19M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (634:20): [True: 1.09M, False: 100k]
  ------------------
  635|  1.09M|        {
  636|       |            /* Checking for Zero Cols */
  637|  1.09M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (637:16): [True: 673k, False: 420k]
  ------------------
  638|   673k|            {
  639|   673k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  640|   673k|            }
  641|   420k|            else
  642|   420k|            {
  643|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  644|  3.78M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (644:28): [True: 3.36M, False: 420k]
  ------------------
  645|  3.36M|                {
  646|  3.36M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  647|  3.36M|                                    + g_ai2_ihevc_trans_16[3][k]
  648|  3.36M|                                                    * pi2_src[3 * src_strd]
  649|  3.36M|                                    + g_ai2_ihevc_trans_16[5][k]
  650|  3.36M|                                                    * pi2_src[5 * src_strd]
  651|  3.36M|                                    + g_ai2_ihevc_trans_16[7][k]
  652|  3.36M|                                                    * pi2_src[7 * src_strd]
  653|  3.36M|                                    + g_ai2_ihevc_trans_16[9][k]
  654|  3.36M|                                                    * pi2_src[9 * src_strd]
  655|  3.36M|                                    + g_ai2_ihevc_trans_16[11][k]
  656|  3.36M|                                                    * pi2_src[11 * src_strd]
  657|  3.36M|                                    + g_ai2_ihevc_trans_16[13][k]
  658|  3.36M|                                                    * pi2_src[13 * src_strd]
  659|  3.36M|                                    + g_ai2_ihevc_trans_16[15][k]
  660|  3.36M|                                                    * pi2_src[15 * src_strd];
  661|  3.36M|                }
  662|  2.10M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (662:28): [True: 1.68M, False: 420k]
  ------------------
  663|  1.68M|                {
  664|  1.68M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  665|  1.68M|                                    + g_ai2_ihevc_trans_16[6][k]
  666|  1.68M|                                                    * pi2_src[6 * src_strd]
  667|  1.68M|                                    + g_ai2_ihevc_trans_16[10][k]
  668|  1.68M|                                                    * pi2_src[10 * src_strd]
  669|  1.68M|                                    + g_ai2_ihevc_trans_16[14][k]
  670|  1.68M|                                                    * pi2_src[14 * src_strd];
  671|  1.68M|                }
  672|   420k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd]
  673|   420k|                                + g_ai2_ihevc_trans_16[12][0]
  674|   420k|                                                * pi2_src[12 * src_strd];
  675|   420k|                eee[0] =
  676|   420k|                                g_ai2_ihevc_trans_16[0][0] * pi2_src[0]
  677|   420k|                                                + g_ai2_ihevc_trans_16[8][0]
  678|   420k|                                                                * pi2_src[8
  679|   420k|                                                                                * src_strd];
  680|   420k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd]
  681|   420k|                                + g_ai2_ihevc_trans_16[12][1]
  682|   420k|                                                * pi2_src[12 * src_strd];
  683|   420k|                eee[1] =
  684|   420k|                                g_ai2_ihevc_trans_16[0][1] * pi2_src[0]
  685|   420k|                                                + g_ai2_ihevc_trans_16[8][1]
  686|   420k|                                                                * pi2_src[8
  687|   420k|                                                                                * src_strd];
  688|       |
  689|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  690|  1.26M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (690:28): [True: 842k, False: 420k]
  ------------------
  691|   842k|                {
  692|   842k|                    ee[k] = eee[k] + eeo[k];
  693|   842k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  694|   842k|                }
  695|  2.10M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (695:28): [True: 1.68M, False: 420k]
  ------------------
  696|  1.68M|                {
  697|  1.68M|                    e[k] = ee[k] + eo[k];
  698|  1.68M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  699|  1.68M|                }
  700|  3.78M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (700:28): [True: 3.36M, False: 420k]
  ------------------
  701|  3.36M|                {
  702|  3.36M|                    pi2_tmp[k] =
  703|  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: 1.97k, False: 3.36M]
  |  |  |  |  |  Branch (40:53): [True: 3.03k, False: 3.36M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  704|  3.36M|                    pi2_tmp[k + 8] =
  705|  3.36M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  3.36M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.36M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.77k, False: 3.36M]
  |  |  |  |  |  Branch (40:53): [True: 1.16k, False: 3.36M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  706|  3.36M|                }
  707|   420k|            }
  708|  1.09M|            pi2_src++;
  709|  1.09M|            pi2_tmp += trans_size;
  710|  1.09M|            zero_cols = zero_cols >> 1;
  711|  1.09M|        }
  712|       |
  713|   100k|        pi2_tmp = pi2_tmp_orig;
  714|       |
  715|       |        /* Inverse Transform 2nd stage */
  716|   100k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|   100k|#define IT_SHIFT_STAGE_2 12
  ------------------
  717|   100k|        add = 1 << (shift - 1);
  718|   100k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (718:12): [True: 41.3k, False: 58.8k]
  ------------------
  719|  41.3k|        {
  720|   701k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (720:24): [True: 660k, False: 41.3k]
  ------------------
  721|   660k|            {
  722|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  723|  5.93M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (723:28): [True: 5.27M, False: 660k]
  ------------------
  724|  5.27M|                {
  725|  5.27M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  726|  5.27M|                                    + g_ai2_ihevc_trans_16[3][k]
  727|  5.27M|                                                    * pi2_tmp[3 * trans_size];
  728|  5.27M|                }
  729|  3.29M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (729:28): [True: 2.63M, False: 660k]
  ------------------
  730|  2.63M|                {
  731|  2.63M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  732|  2.63M|                }
  733|   660k|                eeo[0] = 0;
  734|   660k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  735|   660k|                eeo[1] = 0;
  736|   660k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  737|       |
  738|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  739|  1.97M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (739:28): [True: 1.31M, False: 660k]
  ------------------
  740|  1.31M|                {
  741|  1.31M|                    ee[k] = eee[k] + eeo[k];
  742|  1.31M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  743|  1.31M|                }
  744|  3.29M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (744:28): [True: 2.63M, False: 660k]
  ------------------
  745|  2.63M|                {
  746|  2.63M|                    e[k] = ee[k] + eo[k];
  747|  2.63M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  748|  2.63M|                }
  749|  5.91M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (749:28): [True: 5.25M, False: 660k]
  ------------------
  750|  5.25M|                {
  751|  5.25M|                    WORD32 itrans_out;
  752|  5.25M|                    itrans_out =
  753|  5.25M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  5.25M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.25M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.25M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.25M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  754|  5.25M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  5.25M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.25M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 654k, False: 4.59M]
  |  |  |  |  |  Branch (40:53): [True: 379k, False: 4.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  755|  5.25M|                    itrans_out =
  756|  5.25M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  5.25M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.25M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.25M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.25M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  757|  5.25M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  5.25M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.25M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 600k, False: 4.65M]
  |  |  |  |  |  Branch (40:53): [True: 424k, False: 4.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  758|  5.25M|                }
  759|   660k|                pi2_tmp++;
  760|   660k|                pu1_pred += pred_strd;
  761|   660k|                pu1_dst += dst_strd;
  762|   660k|            }
  763|  41.3k|        }
  764|  58.8k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (764:17): [True: 1.50k, False: 57.3k]
  ------------------
  765|  1.50k|        {
  766|  25.5k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (766:24): [True: 24.0k, False: 1.50k]
  ------------------
  767|  24.0k|            {
  768|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  769|   216k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (769:28): [True: 192k, False: 24.0k]
  ------------------
  770|   192k|                {
  771|   192k|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  772|   192k|                                    + g_ai2_ihevc_trans_16[3][k]
  773|   192k|                                                    * pi2_tmp[3 * trans_size]
  774|   192k|                                    + g_ai2_ihevc_trans_16[5][k]
  775|   192k|                                                    * pi2_tmp[5 * trans_size]
  776|   192k|                                    + g_ai2_ihevc_trans_16[7][k]
  777|   192k|                                                    * pi2_tmp[7 * trans_size];
  778|   192k|                }
  779|   120k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (779:28): [True: 96.2k, False: 24.0k]
  ------------------
  780|  96.2k|                {
  781|  96.2k|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  782|  96.2k|                                    + g_ai2_ihevc_trans_16[6][k]
  783|  96.2k|                                                    * pi2_tmp[6 * trans_size];
  784|  96.2k|                }
  785|  24.0k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  786|  24.0k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  787|  24.0k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  788|  24.0k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  789|       |
  790|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  791|  72.1k|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (791:28): [True: 48.1k, False: 24.0k]
  ------------------
  792|  48.1k|                {
  793|  48.1k|                    ee[k] = eee[k] + eeo[k];
  794|  48.1k|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  795|  48.1k|                }
  796|   120k|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (796:28): [True: 96.2k, False: 24.0k]
  ------------------
  797|  96.2k|                {
  798|  96.2k|                    e[k] = ee[k] + eo[k];
  799|  96.2k|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  800|  96.2k|                }
  801|   216k|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (801:28): [True: 192k, False: 24.0k]
  ------------------
  802|   192k|                {
  803|   192k|                    WORD32 itrans_out;
  804|   192k|                    itrans_out =
  805|   192k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   192k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   192k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 192k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 192k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  806|   192k|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|   192k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   192k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 33.0k, False: 159k]
  |  |  |  |  |  Branch (40:53): [True: 32.2k, False: 127k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  807|   192k|                    itrans_out =
  808|   192k|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|   192k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   192k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 192k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 192k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  809|   192k|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|   192k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   192k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 35.2k, False: 157k]
  |  |  |  |  |  Branch (40:53): [True: 29.7k, False: 127k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  810|   192k|                }
  811|  24.0k|                pi2_tmp++;
  812|  24.0k|                pu1_pred += pred_strd;
  813|  24.0k|                pu1_dst += dst_strd;
  814|  24.0k|            }
  815|  1.50k|        }
  816|  57.3k|        else /* All rows of output of 1st stage are non-zero */
  817|  57.3k|        {
  818|   968k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (818:24): [True: 911k, False: 57.3k]
  ------------------
  819|   911k|            {
  820|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  821|  8.14M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (821:28): [True: 7.22M, False: 911k]
  ------------------
  822|  7.22M|                {
  823|  7.22M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  824|  7.22M|                                    + g_ai2_ihevc_trans_16[3][k]
  825|  7.22M|                                                    * pi2_tmp[3 * trans_size]
  826|  7.22M|                                    + g_ai2_ihevc_trans_16[5][k]
  827|  7.22M|                                                    * pi2_tmp[5 * trans_size]
  828|  7.22M|                                    + g_ai2_ihevc_trans_16[7][k]
  829|  7.22M|                                                    * pi2_tmp[7 * trans_size]
  830|  7.22M|                                    + g_ai2_ihevc_trans_16[9][k]
  831|  7.22M|                                                    * pi2_tmp[9 * trans_size]
  832|  7.22M|                                    + g_ai2_ihevc_trans_16[11][k]
  833|  7.22M|                                                    * pi2_tmp[11 * trans_size]
  834|  7.22M|                                    + g_ai2_ihevc_trans_16[13][k]
  835|  7.22M|                                                    * pi2_tmp[13 * trans_size]
  836|  7.22M|                                    + g_ai2_ihevc_trans_16[15][k]
  837|  7.22M|                                                    * pi2_tmp[15 * trans_size];
  838|  7.22M|                }
  839|  4.55M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (839:28): [True: 3.64M, False: 911k]
  ------------------
  840|  3.64M|                {
  841|  3.64M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  842|  3.64M|                                    + g_ai2_ihevc_trans_16[6][k]
  843|  3.64M|                                                    * pi2_tmp[6 * trans_size]
  844|  3.64M|                                    + g_ai2_ihevc_trans_16[10][k]
  845|  3.64M|                                                    * pi2_tmp[10 * trans_size]
  846|  3.64M|                                    + g_ai2_ihevc_trans_16[14][k]
  847|  3.64M|                                                    * pi2_tmp[14 * trans_size];
  848|  3.64M|                }
  849|   911k|                eeo[0] =
  850|   911k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  851|   911k|                                                + g_ai2_ihevc_trans_16[12][0]
  852|   911k|                                                                * pi2_tmp[12
  853|   911k|                                                                                * trans_size];
  854|   911k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  855|   911k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  856|   911k|                eeo[1] =
  857|   911k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  858|   911k|                                                + g_ai2_ihevc_trans_16[12][1]
  859|   911k|                                                                * pi2_tmp[12
  860|   911k|                                                                                * trans_size];
  861|   911k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  862|   911k|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  863|       |
  864|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  865|  2.72M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (865:28): [True: 1.81M, False: 911k]
  ------------------
  866|  1.81M|                {
  867|  1.81M|                    ee[k] = eee[k] + eeo[k];
  868|  1.81M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  869|  1.81M|                }
  870|  4.51M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (870:28): [True: 3.60M, False: 911k]
  ------------------
  871|  3.60M|                {
  872|  3.60M|                    e[k] = ee[k] + eo[k];
  873|  3.60M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  874|  3.60M|                }
  875|  8.04M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (875:28): [True: 7.13M, False: 911k]
  ------------------
  876|  7.13M|                {
  877|  7.13M|                    WORD32 itrans_out;
  878|  7.13M|                    itrans_out =
  879|  7.13M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  7.13M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.13M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 7.13M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 7.13M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  880|  7.13M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  7.13M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.13M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.46M, False: 3.66M]
  |  |  |  |  |  Branch (40:53): [True: 245k, False: 3.42M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  881|  7.13M|                    itrans_out =
  882|  7.13M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  7.13M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.13M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 7.13M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 7.13M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  883|  7.13M|                    pu1_dst[(k + 8) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 8) * 2]));
  ------------------
  |  |   40|  7.13M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.13M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.41M, False: 3.72M]
  |  |  |  |  |  Branch (40:53): [True: 253k, False: 3.46M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  884|  7.13M|                }
  885|   911k|                pi2_tmp++;
  886|   911k|                pu1_pred += pred_strd;
  887|   911k|                pu1_dst += dst_strd;
  888|   911k|            }
  889|  57.3k|        }
  890|       |        /************************************************************************************************/
  891|       |        /************************************END - IT_RECON_16x16****************************************/
  892|       |        /************************************************************************************************/
  893|   100k|    }
  894|   481k|}

ihevc_chroma_itrans_recon_8x8:
  116|   476k|{
  117|   476k|    WORD32 j, k;
  118|   476k|    WORD32 e[4], o[4];
  119|   476k|    WORD32 ee[2], eo[2];
  120|   476k|    WORD32 add;
  121|   476k|    WORD32 shift;
  122|   476k|    WORD16 *pi2_tmp_orig;
  123|   476k|    WORD32 trans_size;
  124|   476k|    WORD32 zero_rows_2nd_stage = zero_cols;
  125|   476k|    WORD32 row_limit_2nd_stage;
  126|   476k|    UNUSED(zero_rows);
  ------------------
  |  |   38|   476k|#define UNUSED(x) ((void)(x))
  ------------------
  127|   476k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  420|   476k|#define TRANS_SIZE_8   8
  ------------------
  128|       |
  129|   476k|    pi2_tmp_orig = pi2_tmp;
  130|       |
  131|   476k|    if((zero_cols & 0xF0) == 0xF0)
  ------------------
  |  Branch (131:8): [True: 446k, False: 29.9k]
  ------------------
  132|   446k|        row_limit_2nd_stage = 4;
  133|  29.9k|    else
  134|  29.9k|        row_limit_2nd_stage = TRANS_SIZE_8;
  ------------------
  |  |  420|  29.9k|#define TRANS_SIZE_8   8
  ------------------
  135|       |
  136|       |    /* Inverse Transform 1st stage */
  137|   476k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|   476k|#define IT_SHIFT_STAGE_1 7
  ------------------
  138|   476k|    add = 1 << (shift - 1);
  139|   476k|    {
  140|       |        /************************************************************************************************/
  141|       |        /**********************************START - IT_RECON_8x8******************************************/
  142|       |        /************************************************************************************************/
  143|       |
  144|  2.50M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (144:20): [True: 2.02M, False: 476k]
  ------------------
  145|  2.02M|        {
  146|       |            /* Checking for Zero Cols */
  147|  2.02M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (147:16): [True: 1.18M, False: 836k]
  ------------------
  148|  1.18M|            {
  149|  1.18M|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  150|  1.18M|            }
  151|   836k|            else
  152|   836k|            {
  153|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  154|  4.18M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (154:28): [True: 3.34M, False: 836k]
  ------------------
  155|  3.34M|                {
  156|  3.34M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  157|  3.34M|                                    + g_ai2_ihevc_trans_8[3][k]
  158|  3.34M|                                                    * pi2_src[3 * src_strd]
  159|  3.34M|                                    + g_ai2_ihevc_trans_8[5][k]
  160|  3.34M|                                                    * pi2_src[5 * src_strd]
  161|  3.34M|                                    + g_ai2_ihevc_trans_8[7][k]
  162|  3.34M|                                                    * pi2_src[7 * src_strd];
  163|  3.34M|                }
  164|       |
  165|   836k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd]
  166|   836k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_src[6 * src_strd];
  167|   836k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd]
  168|   836k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_src[6 * src_strd];
  169|   836k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0]
  170|   836k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_src[4 * src_strd];
  171|   836k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0]
  172|   836k|                                + 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|   836k|                e[0] = ee[0] + eo[0];
  176|   836k|                e[3] = ee[0] - eo[0];
  177|   836k|                e[1] = ee[1] + eo[1];
  178|   836k|                e[2] = ee[1] - eo[1];
  179|  4.18M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (179:28): [True: 3.34M, False: 836k]
  ------------------
  180|  3.34M|                {
  181|  3.34M|                    pi2_tmp[k] =
  182|  3.34M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  3.34M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.34M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 242, False: 3.34M]
  |  |  |  |  |  Branch (40:53): [True: 195, False: 3.34M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  183|  3.34M|                    pi2_tmp[k + 4] =
  184|  3.34M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  3.34M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.34M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 180, False: 3.34M]
  |  |  |  |  |  Branch (40:53): [True: 461, False: 3.34M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|  3.34M|                }
  186|   836k|            }
  187|  2.02M|            pi2_src++;
  188|  2.02M|            pi2_tmp += trans_size;
  189|  2.02M|            zero_cols = zero_cols >> 1;
  190|  2.02M|        }
  191|       |
  192|   476k|        pi2_tmp = pi2_tmp_orig;
  193|       |
  194|       |        /* Inverse Transform 2nd stage */
  195|   476k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|   476k|#define IT_SHIFT_STAGE_2 12
  ------------------
  196|   476k|        add = 1 << (shift - 1);
  197|       |
  198|   476k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (198:12): [True: 446k, False: 29.9k]
  ------------------
  199|   446k|        {
  200|  4.01M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (200:24): [True: 3.56M, False: 446k]
  ------------------
  201|  3.56M|            {
  202|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  203|  17.8M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (203:28): [True: 14.2M, False: 3.56M]
  ------------------
  204|  14.2M|                {
  205|  14.2M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  206|  14.2M|                                    + g_ai2_ihevc_trans_8[3][k]
  207|  14.2M|                                                    * pi2_tmp[3 * trans_size];
  208|  14.2M|                }
  209|  3.56M|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  210|  3.56M|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  211|  3.56M|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  212|  3.56M|                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|  3.56M|                e[0] = ee[0] + eo[0];
  216|  3.56M|                e[3] = ee[0] - eo[0];
  217|  3.56M|                e[1] = ee[1] + eo[1];
  218|  3.56M|                e[2] = ee[1] - eo[1];
  219|  17.8M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (219:28): [True: 14.2M, False: 3.56M]
  ------------------
  220|  14.2M|                {
  221|  14.2M|                    WORD32 itrans_out;
  222|  14.2M|                    itrans_out =
  223|  14.2M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  14.2M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  14.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 14.2M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 14.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  224|  14.2M|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|  14.2M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  14.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.84M, False: 11.4M]
  |  |  |  |  |  Branch (40:53): [True: 441k, False: 10.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  225|  14.2M|                    itrans_out =
  226|  14.2M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  14.2M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  14.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 14.2M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 14.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  227|  14.2M|                    pu1_dst[(k + 4) * 2] =
  228|  14.2M|                                    CLIP_U8((itrans_out + pu1_pred[(k + 4) * 2]));
  ------------------
  |  |   40|  14.2M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  14.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.76M, False: 11.4M]
  |  |  |  |  |  Branch (40:53): [True: 447k, False: 11.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  229|  14.2M|                }
  230|  3.56M|                pi2_tmp++;
  231|  3.56M|                pu1_pred += pred_strd;
  232|  3.56M|                pu1_dst += dst_strd;
  233|  3.56M|            }
  234|   446k|        }
  235|  29.9k|        else /* All rows of output of 1st stage are non-zero */
  236|  29.9k|        {
  237|   268k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (237:24): [True: 238k, False: 29.9k]
  ------------------
  238|   238k|            {
  239|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  240|  1.19M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (240:28): [True: 951k, False: 238k]
  ------------------
  241|   951k|                {
  242|   951k|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  243|   951k|                                    + g_ai2_ihevc_trans_8[3][k]
  244|   951k|                                                    * pi2_tmp[3 * trans_size]
  245|   951k|                                    + g_ai2_ihevc_trans_8[5][k]
  246|   951k|                                                    * pi2_tmp[5 * trans_size]
  247|   951k|                                    + g_ai2_ihevc_trans_8[7][k]
  248|   951k|                                                    * pi2_tmp[7 * trans_size];
  249|   951k|                }
  250|       |
  251|   238k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  252|   238k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  253|   238k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  254|   238k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  255|   238k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  256|   238k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  257|   238k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  258|   238k|                                + 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|   238k|                e[0] = ee[0] + eo[0];
  262|   238k|                e[3] = ee[0] - eo[0];
  263|   238k|                e[1] = ee[1] + eo[1];
  264|   238k|                e[2] = ee[1] - eo[1];
  265|  1.18M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (265:28): [True: 948k, False: 238k]
  ------------------
  266|   948k|                {
  267|   948k|                    WORD32 itrans_out;
  268|   948k|                    itrans_out =
  269|   948k|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   948k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   948k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 948k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 948k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  270|   948k|                    pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2]));
  ------------------
  |  |   40|   948k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   948k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 65.0k, False: 883k]
  |  |  |  |  |  Branch (40:53): [True: 58.1k, False: 825k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  271|   948k|                    itrans_out =
  272|   948k|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|   948k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   948k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 948k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 948k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|   948k|                    pu1_dst[(k + 4) * 2] =
  274|   948k|                                    CLIP_U8((itrans_out + pu1_pred[(k + 4) * 2]));
  ------------------
  |  |   40|   948k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   948k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 67.9k, False: 880k]
  |  |  |  |  |  Branch (40:53): [True: 53.9k, False: 827k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  275|   948k|                }
  276|   238k|                pi2_tmp++;
  277|   238k|                pu1_pred += pred_strd;
  278|   238k|                pu1_dst += dst_strd;
  279|   238k|            }
  280|  29.9k|        }
  281|       |        /************************************************************************************************/
  282|       |        /************************************END - IT_RECON_8x8******************************************/
  283|       |        /************************************************************************************************/
  284|   476k|    }
  285|   476k|}

ihevc_chroma_recon_4x4:
  110|   235k|{
  111|   235k|    WORD32 i, j;
  112|   235k|    WORD32 trans_size;
  113|       |
  114|   235k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  419|   235k|#define TRANS_SIZE_4   4
  ------------------
  115|       |
  116|       |    /* Reconstruction */
  117|       |
  118|  1.17M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (118:16): [True: 940k, False: 235k]
  ------------------
  119|   940k|    {
  120|       |        /* Checking for Zero Cols */
  121|   940k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (121:12): [True: 594k, False: 345k]
  ------------------
  122|   594k|        {
  123|  2.97M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (123:24): [True: 2.37M, False: 594k]
  ------------------
  124|  2.37M|            {
  125|  2.37M|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  126|  2.37M|            }
  127|   594k|        }
  128|   345k|        else
  129|   345k|        {
  130|  1.73M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (130:24): [True: 1.38M, False: 345k]
  ------------------
  131|  1.38M|            {
  132|  1.38M|                pu1_dst[j * dst_strd] =
  133|  1.38M|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  1.38M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.38M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 143k, False: 1.24M]
  |  |  |  |  |  Branch (40:53): [True: 89.0k, False: 1.15M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  134|  1.38M|            }
  135|   345k|        }
  136|   940k|        pi2_src++;
  137|   940k|        pu1_dst += 2;
  138|   940k|        pu1_pred += 2;
  139|   940k|        zero_cols = zero_cols >> 1;
  140|   940k|    }
  141|   235k|}
ihevc_chroma_recon_8x8:
  193|  2.70k|{
  194|  2.70k|    WORD32 i, j;
  195|  2.70k|    WORD32 trans_size;
  196|       |
  197|  2.70k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  420|  2.70k|#define TRANS_SIZE_8   8
  ------------------
  198|       |
  199|       |    /* Reconstruction */
  200|       |
  201|  24.3k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (201:16): [True: 21.6k, False: 2.70k]
  ------------------
  202|  21.6k|    {
  203|       |        /* Checking for Zero Cols */
  204|  21.6k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (204:12): [True: 16.9k, False: 4.61k]
  ------------------
  205|  16.9k|        {
  206|   152k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (206:24): [True: 135k, False: 16.9k]
  ------------------
  207|   135k|            {
  208|   135k|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  209|   135k|            }
  210|  16.9k|        }
  211|  4.61k|        else
  212|  4.61k|        {
  213|  41.5k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (213:24): [True: 36.8k, False: 4.61k]
  ------------------
  214|  36.8k|            {
  215|  36.8k|                pu1_dst[j * dst_strd] =
  216|  36.8k|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  36.8k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  36.8k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 51, False: 36.8k]
  |  |  |  |  |  Branch (40:53): [True: 410, False: 36.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  217|  36.8k|            }
  218|  4.61k|        }
  219|  21.6k|        pi2_src++;
  220|  21.6k|        pu1_dst += 2;
  221|  21.6k|        pu1_pred += 2;
  222|  21.6k|        zero_cols = zero_cols >> 1;
  223|  21.6k|    }
  224|  2.70k|}
ihevc_chroma_recon_16x16:
  276|  1.88k|{
  277|  1.88k|    WORD32 i, j;
  278|  1.88k|    WORD32 trans_size;
  279|       |
  280|  1.88k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  421|  1.88k|#define TRANS_SIZE_16 16
  ------------------
  281|       |
  282|       |    /* Reconstruction */
  283|       |
  284|  32.1k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (284:16): [True: 30.2k, False: 1.88k]
  ------------------
  285|  30.2k|    {
  286|       |        /* Checking for Zero Cols */
  287|  30.2k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (287:12): [True: 25.5k, False: 4.64k]
  ------------------
  288|  25.5k|        {
  289|   434k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (289:24): [True: 409k, False: 25.5k]
  ------------------
  290|   409k|            {
  291|   409k|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  292|   409k|            }
  293|  25.5k|        }
  294|  4.64k|        else
  295|  4.64k|        {
  296|  78.8k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (296:24): [True: 74.2k, False: 4.64k]
  ------------------
  297|  74.2k|            {
  298|  74.2k|                pu1_dst[j * dst_strd] =
  299|  74.2k|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  74.2k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  74.2k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 167, False: 74.0k]
  |  |  |  |  |  Branch (40:53): [True: 700, False: 73.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  300|  74.2k|            }
  301|  4.64k|        }
  302|  30.2k|        pi2_src++;
  303|  30.2k|        pu1_dst += 2;
  304|  30.2k|        pu1_pred += 2;
  305|  30.2k|        zero_cols = zero_cols >> 1;
  306|  30.2k|    }
  307|  1.88k|}

ihevc_deblk_luma_vert:
  107|  62.1M|{
  108|  62.1M|    WORD32 qp_luma, beta_indx, tc_indx;
  109|  62.1M|    WORD32 beta, tc;
  110|  62.1M|    WORD32 dp0, dp3, dq0, dq3, d0, d3, dp, dq, d;
  111|  62.1M|    WORD32 d_sam0, d_sam3;
  112|  62.1M|    WORD32 de, dep, deq;
  113|  62.1M|    WORD32 row;
  114|  62.1M|    WORD32 tmp_p0, tmp_p1, tmp_p2, tmp_q0, tmp_q1, tmp_q2;
  115|  62.1M|    WORD32 delta, delta_p, delta_q;
  116|       |
  117|  62.1M|    ASSERT((bs > 0) && (bs <= 3));
  ------------------
  |  |   55|  62.1M|#define ASSERT(x) assert((x))
  ------------------
  118|  62.1M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  62.1M|#define ASSERT(x) assert((x))
  ------------------
  119|       |
  120|  62.1M|    qp_luma = (quant_param_p + quant_param_q + 1) >> 1;
  121|  62.1M|    beta_indx = CLIP3(qp_luma + (beta_offset_div2 << 1), 0, 51);
  ------------------
  |  |   40|  62.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 62.1M]
  |  |  |  Branch (40:53): [True: 2, False: 62.1M]
  |  |  ------------------
  ------------------
  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|  62.1M|    tc_indx = CLIP3(qp_luma + (2 * (bs >> 1)) + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  62.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 62.1M]
  |  |  |  Branch (40:53): [True: 2, False: 62.1M]
  |  |  ------------------
  ------------------
  129|       |
  130|  62.1M|    beta = gai4_ihevc_beta_table[beta_indx];
  131|  62.1M|    tc = gai4_ihevc_tc_table[tc_indx];
  132|  62.1M|    if(0 == tc)
  ------------------
  |  Branch (132:8): [True: 881k, False: 61.3M]
  ------------------
  133|   881k|    {
  134|   881k|        return;
  135|   881k|    }
  136|       |
  137|  61.3M|    dq0 = ABS(pu1_src[2] - 2 * pu1_src[1] + pu1_src[0]);
  ------------------
  |  |   45|  61.3M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 12.5M, False: 48.7M]
  |  |  ------------------
  ------------------
  138|  61.3M|    dq3 = ABS(pu1_src[3 * src_strd + 2] - 2 * pu1_src[3 * src_strd + 1]
  ------------------
  |  |   45|  61.3M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 12.3M, False: 48.9M]
  |  |  ------------------
  ------------------
  139|  61.3M|                    + pu1_src[3 * src_strd + 0]);
  140|  61.3M|    dp0 = ABS(pu1_src[-3] - 2 * pu1_src[-2] + pu1_src[-1]);
  ------------------
  |  |   45|  61.3M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 13.1M, False: 48.1M]
  |  |  ------------------
  ------------------
  141|  61.3M|    dp3 = ABS(pu1_src[3 * src_strd - 3] - 2 * pu1_src[3 * src_strd - 2]
  ------------------
  |  |   45|  61.3M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 13.1M, False: 48.1M]
  |  |  ------------------
  ------------------
  142|  61.3M|                    + pu1_src[3 * src_strd - 1]);
  143|       |
  144|  61.3M|    d0 = dp0 + dq0;
  145|  61.3M|    d3 = dp3 + dq3;
  146|       |
  147|  61.3M|    dp = dp0 + dp3;
  148|  61.3M|    dq = dq0 + dq3;
  149|       |
  150|  61.3M|    d = d0 + d3;
  151|       |
  152|  61.3M|    de = 0;
  153|  61.3M|    dep = 0;
  154|  61.3M|    deq = 0;
  155|       |
  156|  61.3M|    if(d < beta)
  ------------------
  |  Branch (156:8): [True: 54.7M, False: 6.56M]
  ------------------
  157|  54.7M|    {
  158|  54.7M|        d_sam0 = 0;
  159|  54.7M|        if((2 * d0 < (beta >> 2))
  ------------------
  |  Branch (159:12): [True: 45.4M, False: 9.25M]
  ------------------
  160|  54.7M|                        && (ABS(pu1_src[3] - pu1_src[0]) + ABS(pu1_src[-1] - pu1_src[-4])
  ------------------
  |  |   45|  45.4M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 9.64M, False: 35.8M]
  |  |  ------------------
  ------------------
                                      && (ABS(pu1_src[3] - pu1_src[0]) + ABS(pu1_src[-1] - pu1_src[-4])
  ------------------
  |  |   45|  45.4M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 12.2M, False: 33.2M]
  |  |  ------------------
  ------------------
  |  Branch (160:28): [True: 27.9M, False: 17.5M]
  ------------------
  161|  45.4M|                                        < (beta >> 3))
  162|  54.7M|                        && ABS(pu1_src[0] - pu1_src[-1]) < ((5 * tc + 1) >> 1))
  ------------------
  |  |   45|  27.9M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.05M, False: 23.8M]
  |  |  ------------------
  ------------------
  |  Branch (162:28): [True: 27.2M, False: 708k]
  ------------------
  163|  27.2M|        {
  164|  27.2M|            d_sam0 = 1;
  165|  27.2M|        }
  166|       |
  167|  54.7M|        pu1_src += 3 * src_strd;
  168|  54.7M|        d_sam3 = 0;
  169|  54.7M|        if((2 * d3 < (beta >> 2))
  ------------------
  |  Branch (169:12): [True: 45.7M, False: 8.96M]
  ------------------
  170|  54.7M|                        && (ABS(pu1_src[3] - pu1_src[0]) + ABS(pu1_src[-1] - pu1_src[-4])
  ------------------
  |  |   45|  45.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 9.67M, False: 36.1M]
  |  |  ------------------
  ------------------
                                      && (ABS(pu1_src[3] - pu1_src[0]) + ABS(pu1_src[-1] - pu1_src[-4])
  ------------------
  |  |   45|  45.7M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 12.2M, False: 33.5M]
  |  |  ------------------
  ------------------
  |  Branch (170:28): [True: 28.1M, False: 17.6M]
  ------------------
  171|  45.7M|                                        < (beta >> 3))
  172|  54.7M|                        && ABS(pu1_src[0] - pu1_src[-1]) < ((5 * tc + 1) >> 1))
  ------------------
  |  |   45|  28.1M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.01M, False: 24.1M]
  |  |  ------------------
  ------------------
  |  Branch (172:28): [True: 27.3M, False: 741k]
  ------------------
  173|  27.4M|        {
  174|  27.4M|            d_sam3 = 1;
  175|  27.4M|        }
  176|  54.7M|        pu1_src -= 3 * src_strd;
  177|       |
  178|  54.7M|        de = (d_sam0 == 1 && d_sam3 == 1) ? 2 : 1;
  ------------------
  |  Branch (178:15): [True: 27.2M, False: 27.5M]
  |  Branch (178:30): [True: 24.9M, False: 2.25M]
  ------------------
  179|  54.7M|        dep = (dp < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (179:15): [True: 49.3M, False: 5.41M]
  ------------------
  180|  54.7M|        deq = (dq < (beta + (beta >> 1)) >> 3) ? 1 : 0;
  ------------------
  |  Branch (180:15): [True: 47.1M, False: 7.59M]
  ------------------
  181|  54.7M|        if(tc <= 1)
  ------------------
  |  Branch (181:12): [True: 3.71M, False: 51.0M]
  ------------------
  182|  3.71M|        {
  183|  3.71M|            dep = 0;
  184|  3.71M|            deq = 0;
  185|  3.71M|        }
  186|  54.7M|    }
  187|       |
  188|  61.3M|    if(de != 0)
  ------------------
  |  Branch (188:8): [True: 54.7M, False: 6.58M]
  ------------------
  189|  54.7M|    {
  190|   269M|        for(row = 0; row < 4; row++)
  ------------------
  |  Branch (190:22): [True: 214M, False: 54.7M]
  ------------------
  191|   214M|        {
  192|   214M|            tmp_p0 = pu1_src[-1];
  193|   214M|            tmp_p1 = pu1_src[-2];
  194|   214M|            tmp_p2 = pu1_src[-3];
  195|       |
  196|   214M|            tmp_q0 = pu1_src[0];
  197|   214M|            tmp_q1 = pu1_src[1];
  198|   214M|            tmp_q2 = pu1_src[2];
  199|       |
  200|   214M|            if(de == 2)
  ------------------
  |  Branch (200:16): [True: 98.2M, False: 116M]
  ------------------
  201|  98.2M|            {
  202|  98.2M|                tmp_q0 = CLIP3((pu1_src[2] + 2 * pu1_src[1] +
  ------------------
  |  |   40|  98.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 967, False: 98.2M]
  |  |  |  Branch (40:53): [True: 829, False: 98.2M]
  |  |  ------------------
  ------------------
  203|  98.2M|                                2 * pu1_src[0] + 2 * pu1_src[-1] +
  204|  98.2M|                                pu1_src[-2] + 4) >> 3,
  205|  98.2M|                                pu1_src[0] - 2 * tc,
  206|  98.2M|                                pu1_src[0] + 2 * tc);
  207|       |
  208|  98.2M|                tmp_q1 = CLIP3((pu1_src[2] + pu1_src[1] + pu1_src[0] +
  ------------------
  |  |   40|  98.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 707, False: 98.2M]
  |  |  |  Branch (40:53): [True: 1.28k, False: 98.2M]
  |  |  ------------------
  ------------------
  209|  98.2M|                                pu1_src[-1] + 2) >> 2,
  210|  98.2M|                                pu1_src[1] - 2 * tc,
  211|  98.2M|                                pu1_src[1] + 2 * tc);
  212|       |
  213|  98.2M|                tmp_q2 = CLIP3((2 * pu1_src[3] + 3 * pu1_src[2] +
  ------------------
  |  |   40|  98.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 479, False: 98.2M]
  |  |  |  Branch (40:53): [True: 722, False: 98.2M]
  |  |  ------------------
  ------------------
  214|  98.2M|                                pu1_src[1] + pu1_src[0] +
  215|  98.2M|                                pu1_src[-1] + 4) >> 3,
  216|  98.2M|                                pu1_src[2] - 2 * tc,
  217|  98.2M|                                pu1_src[2] + 2 * tc);
  218|       |
  219|  98.2M|                tmp_p0 = CLIP3((pu1_src[1] + 2 * pu1_src[0] +
  ------------------
  |  |   40|  98.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.04k, False: 98.2M]
  |  |  |  Branch (40:53): [True: 980, False: 98.2M]
  |  |  ------------------
  ------------------
  220|  98.2M|                                2 * pu1_src[-1] + 2 * pu1_src[-2] +
  221|  98.2M|                                pu1_src[-3] + 4) >> 3,
  222|  98.2M|                                pu1_src[-1] - 2 * tc,
  223|  98.2M|                                pu1_src[-1] + 2 * tc);
  224|       |
  225|  98.2M|                tmp_p1 = CLIP3((pu1_src[0] + pu1_src[-1] +
  ------------------
  |  |   40|  98.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 527, False: 98.2M]
  |  |  |  Branch (40:53): [True: 709, False: 98.2M]
  |  |  ------------------
  ------------------
  226|  98.2M|                                pu1_src[-2] + pu1_src[-3] + 2) >> 2,
  227|  98.2M|                                pu1_src[-2] - 2 * tc,
  228|  98.2M|                                pu1_src[-2] + 2 * tc);
  229|       |
  230|  98.2M|                tmp_p2 = CLIP3((pu1_src[0] + pu1_src[-1] +
  ------------------
  |  |   40|  98.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 444, False: 98.2M]
  |  |  |  Branch (40:53): [True: 604, False: 98.2M]
  |  |  ------------------
  ------------------
  231|  98.2M|                                pu1_src[-2] + 3 * pu1_src[-3] +
  232|  98.2M|                                2 * pu1_src[-4] + 4) >> 3,
  233|  98.2M|                                pu1_src[-3] - 2 * tc,
  234|  98.2M|                                pu1_src[-3] + 2 * tc);
  235|  98.2M|            }
  236|   116M|            else
  237|   116M|            {
  238|   116M|                delta = (9 * (pu1_src[0] - pu1_src[-1]) -
  239|   116M|                                3 * (pu1_src[1] - pu1_src[-2]) + 8) >> 4;
  240|   116M|                if(ABS(delta) < 10 * tc)
  ------------------
  |  |   45|   116M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 33.2M, False: 82.7M]
  |  |  ------------------
  ------------------
  |  Branch (240:20): [True: 117M, False: 18.4E]
  ------------------
  241|   117M|                {
  242|   117M|                    delta = CLIP3(delta, -tc, tc);
  ------------------
  |  |   40|   117M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 6.76M, False: 110M]
  |  |  |  Branch (40:53): [True: 5.81M, False: 104M]
  |  |  ------------------
  ------------------
  243|       |
  244|   117M|                    tmp_p0 = CLIP_U8(pu1_src[-1] + delta);
  ------------------
  |  |   40|   117M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   117M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 319k, False: 116M]
  |  |  |  |  |  Branch (40:53): [True: 114k, False: 116M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  245|   117M|                    tmp_q0 = CLIP_U8(pu1_src[0] - delta);
  ------------------
  |  |   40|   117M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   117M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 776k, False: 116M]
  |  |  |  |  |  Branch (40:53): [True: 135k, False: 116M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  246|       |
  247|   117M|                    if(dep == 1)
  ------------------
  |  Branch (247:24): [True: 91.2M, False: 25.8M]
  ------------------
  248|  91.2M|                    {
  249|  91.2M|                        delta_p = CLIP3((((pu1_src[-3] + pu1_src[-1] + 1) >> 1)
  ------------------
  |  |   40|  91.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 755k, False: 90.5M]
  |  |  |  Branch (40:53): [True: 1.15M, False: 89.3M]
  |  |  ------------------
  ------------------
  250|  91.2M|                                        - pu1_src[-2] + delta) >> 1,
  251|  91.2M|                                        -(tc >> 1),
  252|  91.2M|                                        (tc >> 1));
  253|  91.2M|                        tmp_p1 = CLIP_U8(pu1_src[-2] + delta_p);
  ------------------
  |  |   40|  91.2M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  91.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 109k, False: 91.1M]
  |  |  |  |  |  Branch (40:53): [True: 87.9k, False: 91.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|  91.2M|                    }
  255|       |
  256|   117M|                    if(deq == 1)
  ------------------
  |  Branch (256:24): [True: 83.3M, False: 33.6M]
  ------------------
  257|  83.3M|                    {
  258|  83.3M|                        delta_q = CLIP3((((pu1_src[2] + pu1_src[0] + 1) >> 1)
  ------------------
  |  |   40|  83.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 790k, False: 82.5M]
  |  |  |  Branch (40:53): [True: 1.24M, False: 81.3M]
  |  |  ------------------
  ------------------
  259|  83.3M|                                        - pu1_src[1] - delta) >> 1,
  260|  83.3M|                                        -(tc >> 1),
  261|  83.3M|                                        (tc >> 1));
  262|  83.3M|                        tmp_q1 = CLIP_U8(pu1_src[1] + delta_q);
  ------------------
  |  |   40|  83.3M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  83.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 196k, False: 83.1M]
  |  |  |  |  |  Branch (40:53): [True: 108k, False: 83.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  263|  83.3M|                    }
  264|   117M|                }
  265|   116M|            }
  266|       |
  267|   214M|            if(filter_flag_p != 0)
  ------------------
  |  Branch (267:16): [True: 214M, False: 60.0k]
  ------------------
  268|   214M|            {
  269|   214M|                pu1_src[-3] = tmp_p2;
  270|   214M|                pu1_src[-2] = tmp_p1;
  271|   214M|                pu1_src[-1] = tmp_p0;
  272|   214M|            }
  273|       |
  274|   214M|            if(filter_flag_q != 0)
  ------------------
  |  Branch (274:16): [True: 213M, False: 611k]
  ------------------
  275|   213M|            {
  276|   213M|                pu1_src[0] = tmp_q0;
  277|   213M|                pu1_src[1] = tmp_q1;
  278|   213M|                pu1_src[2] = tmp_q2;
  279|   213M|            }
  280|       |
  281|   214M|            pu1_src += src_strd;
  282|   214M|        }
  283|  54.7M|    }
  284|       |
  285|  61.3M|}
ihevc_deblk_luma_horz:
  344|  60.3M|{
  345|  60.3M|    WORD32 qp_luma, beta_indx, tc_indx;
  346|  60.3M|    WORD32 beta, tc;
  347|  60.3M|    WORD32 dp0, dp3, dq0, dq3, d0, d3, dp, dq, d;
  348|  60.3M|    WORD32 d_sam0, d_sam3;
  349|  60.3M|    WORD32 de, dep, deq;
  350|  60.3M|    WORD32 col;
  351|  60.3M|    WORD32 tmp_p0, tmp_p1, tmp_p2, tmp_q0, tmp_q1, tmp_q2;
  352|  60.3M|    WORD32 delta, delta_p, delta_q;
  353|       |
  354|  60.3M|    ASSERT((bs > 0));
  ------------------
  |  |   55|  60.3M|#define ASSERT(x) assert((x))
  ------------------
  355|  60.3M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  60.3M|#define ASSERT(x) assert((x))
  ------------------
  356|       |
  357|  60.3M|    qp_luma = (quant_param_p + quant_param_q + 1) >> 1;
  358|  60.3M|    beta_indx = CLIP3(qp_luma + (beta_offset_div2 << 1), 0, 51);
  ------------------
  |  |   40|  60.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 60.3M]
  |  |  |  Branch (40:53): [True: 2, False: 60.3M]
  |  |  ------------------
  ------------------
  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|  60.3M|    tc_indx = CLIP3(qp_luma + 2 * (bs >> 1) + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  60.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 60.3M]
  |  |  |  Branch (40:53): [True: 2, False: 60.3M]
  |  |  ------------------
  ------------------
  366|       |
  367|  60.3M|    beta = gai4_ihevc_beta_table[beta_indx];
  368|  60.3M|    tc = gai4_ihevc_tc_table[tc_indx];
  369|  60.3M|    if(0 == tc)
  ------------------
  |  Branch (369:8): [True: 804k, False: 59.5M]
  ------------------
  370|   804k|    {
  371|   804k|        return;
  372|   804k|    }
  373|       |
  374|  59.5M|    dq0 = ABS(pu1_src[2 * src_strd] - 2 * pu1_src[1 * src_strd] +
  ------------------
  |  |   45|  59.5M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 12.3M, False: 47.2M]
  |  |  ------------------
  ------------------
  375|  59.5M|                    pu1_src[0 * src_strd]);
  376|       |
  377|  59.5M|    dq3 = ABS(pu1_src[3 + 2 * src_strd] - 2 * pu1_src[3 + 1 * src_strd] +
  ------------------
  |  |   45|  59.5M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 12.3M, False: 47.1M]
  |  |  ------------------
  ------------------
  378|  59.5M|                    pu1_src[3 + 0 * src_strd]);
  379|       |
  380|  59.5M|    dp0 = ABS(pu1_src[-3 * src_strd] - 2 * pu1_src[-2 * src_strd] +
  ------------------
  |  |   45|  59.5M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 11.8M, False: 47.7M]
  |  |  ------------------
  ------------------
  381|  59.5M|                    pu1_src[-1 * src_strd]);
  382|       |
  383|  59.5M|    dp3 = ABS(pu1_src[3 - 3 * src_strd] - 2 * pu1_src[3 - 2 * src_strd] +
  ------------------
  |  |   45|  59.5M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 11.9M, False: 47.6M]
  |  |  ------------------
  ------------------
  384|  59.5M|                    pu1_src[3 - 1 * src_strd]);
  385|       |
  386|  59.5M|    d0 = dp0 + dq0;
  387|  59.5M|    d3 = dp3 + dq3;
  388|       |
  389|  59.5M|    dp = dp0 + dp3;
  390|  59.5M|    dq = dq0 + dq3;
  391|       |
  392|  59.5M|    d = d0 + d3;
  393|       |
  394|  59.5M|    de = 0;
  395|  59.5M|    dep = 0;
  396|  59.5M|    deq = 0;
  397|       |
  398|  59.5M|    if(d < beta)
  ------------------
  |  Branch (398:8): [True: 53.2M, False: 6.30M]
  ------------------
  399|  53.2M|    {
  400|  53.2M|        d_sam0 = 0;
  401|  53.2M|        if((2 * d0 < (beta >> 2))
  ------------------
  |  Branch (401:12): [True: 45.5M, False: 7.65M]
  ------------------
  402|  53.2M|                        && (ABS(pu1_src[3 * src_strd] - pu1_src[0 * src_strd]) +
  ------------------
  |  |   45|  45.5M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 10.3M, False: 35.2M]
  |  |  ------------------
  ------------------
  |  Branch (402:28): [True: 28.6M, False: 16.9M]
  ------------------
  403|  45.5M|                                        ABS(pu1_src[-1 * src_strd] - pu1_src[-4 * src_strd])
  ------------------
  |  |   45|  45.5M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 11.6M, False: 33.9M]
  |  |  ------------------
  ------------------
  404|  45.5M|                                        < (beta >> 3))
  405|  53.2M|                        && ABS(pu1_src[0 * src_strd] - pu1_src[-1 * src_strd])
  ------------------
  |  |   45|  28.6M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.00M, False: 24.5M]
  |  |  ------------------
  ------------------
  |  Branch (405:28): [True: 27.5M, False: 1.02M]
  ------------------
  406|  28.6M|                        < ((5 * tc + 1) >> 1))
  407|  27.5M|        {
  408|  27.5M|            d_sam0 = 1;
  409|  27.5M|        }
  410|       |
  411|  53.2M|        pu1_src += 3;
  412|  53.2M|        d_sam3 = 0;
  413|  53.2M|        if((2 * d3 < (beta >> 2))
  ------------------
  |  Branch (413:12): [True: 45.6M, False: 7.59M]
  ------------------
  414|  53.2M|                        && (ABS(pu1_src[3 * src_strd] - pu1_src[0 * src_strd]) +
  ------------------
  |  |   45|  45.6M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 10.3M, False: 35.2M]
  |  |  ------------------
  ------------------
  |  Branch (414:28): [True: 28.5M, False: 17.0M]
  ------------------
  415|  45.6M|                                        ABS(pu1_src[-1 * src_strd] - pu1_src[-4 * src_strd])
  ------------------
  |  |   45|  45.6M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 11.7M, False: 33.9M]
  |  |  ------------------
  ------------------
  416|  45.6M|                                        < (beta >> 3))
  417|  53.2M|                        && ABS(pu1_src[0 * src_strd] - pu1_src[-1 * src_strd])
  ------------------
  |  |   45|  28.5M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 4.08M, False: 24.4M]
  |  |  ------------------
  ------------------
  |  Branch (417:28): [True: 27.5M, False: 1.01M]
  ------------------
  418|  28.5M|                        < ((5 * tc + 1) >> 1))
  419|  27.5M|        {
  420|  27.5M|            d_sam3 = 1;
  421|  27.5M|        }
  422|  53.2M|        pu1_src -= 3;
  423|       |
  424|  53.2M|        de = (d_sam0 == 1 && d_sam3 == 1) ? 2 : 1;
  ------------------
  |  Branch (424:15): [True: 27.5M, False: 25.6M]
  |  Branch (424:30): [True: 24.9M, False: 2.59M]
  ------------------
  425|  53.2M|        dep = (dp < ((beta + (beta >> 1)) >> 3)) ? 1 : 0;
  ------------------
  |  Branch (425:15): [True: 48.7M, False: 4.49M]
  ------------------
  426|  53.2M|        deq = (dq < ((beta + (beta >> 1)) >> 3)) ? 1 : 0;
  ------------------
  |  Branch (426:15): [True: 47.2M, False: 6.04M]
  ------------------
  427|  53.2M|        if(tc <= 1)
  ------------------
  |  Branch (427:12): [True: 3.74M, False: 49.5M]
  ------------------
  428|  3.74M|        {
  429|  3.74M|            dep = 0;
  430|  3.74M|            deq = 0;
  431|  3.74M|        }
  432|  53.2M|    }
  433|       |
  434|  59.5M|    if(de != 0)
  ------------------
  |  Branch (434:8): [True: 53.1M, False: 6.38M]
  ------------------
  435|  53.1M|    {
  436|   262M|        for(col = 0; col < 4; col++)
  ------------------
  |  Branch (436:22): [True: 209M, False: 53.1M]
  ------------------
  437|   209M|        {
  438|   209M|            tmp_p0 = pu1_src[-1 * src_strd];
  439|   209M|            tmp_p1 = pu1_src[-2 * src_strd];
  440|   209M|            tmp_p2 = pu1_src[-3 * src_strd];
  441|       |
  442|   209M|            tmp_q0 = pu1_src[0 * src_strd];
  443|   209M|            tmp_q1 = pu1_src[1 * src_strd];
  444|   209M|            tmp_q2 = pu1_src[2 * src_strd];
  445|   209M|            if(de == 2)
  ------------------
  |  Branch (445:16): [True: 98.2M, False: 110M]
  ------------------
  446|  98.2M|            {
  447|  98.2M|                tmp_q0 = CLIP3((pu1_src[2 * src_strd] +
  ------------------
  |  |   40|  98.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 19.5k, False: 98.2M]
  |  |  |  Branch (40:53): [True: 1.21k, False: 98.2M]
  |  |  ------------------
  ------------------
  448|  98.2M|                                2 * pu1_src[1 * src_strd] +
  449|  98.2M|                                2 * pu1_src[0 * src_strd] +
  450|  98.2M|                                2 * pu1_src[-1 * src_strd] +
  451|  98.2M|                                pu1_src[-2 * src_strd] + 4) >> 3,
  452|  98.2M|                                pu1_src[0 * src_strd] - 2 * tc,
  453|  98.2M|                                pu1_src[0 * src_strd] + 2 * tc);
  454|       |
  455|  98.2M|                tmp_q1 = CLIP3((pu1_src[2 * src_strd] +
  ------------------
  |  |   40|  98.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 855, False: 98.2M]
  |  |  |  Branch (40:53): [True: 1.55k, False: 98.2M]
  |  |  ------------------
  ------------------
  456|  98.2M|                                pu1_src[1 * src_strd] +
  457|  98.2M|                                pu1_src[0 * src_strd] +
  458|  98.2M|                                pu1_src[-1 * src_strd] + 2) >> 2,
  459|  98.2M|                                pu1_src[1 * src_strd] - 2 * tc,
  460|  98.2M|                                pu1_src[1 * src_strd] + 2 * tc);
  461|       |
  462|  98.2M|                tmp_q2 = CLIP3((2 * pu1_src[3 * src_strd] +
  ------------------
  |  |   40|  98.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 604, False: 98.2M]
  |  |  |  Branch (40:53): [True: 1.68k, False: 98.2M]
  |  |  ------------------
  ------------------
  463|  98.2M|                                3 * pu1_src[2 * src_strd] +
  464|  98.2M|                                pu1_src[1 * src_strd] +
  465|  98.2M|                                pu1_src[0 * src_strd] +
  466|  98.2M|                                pu1_src[-1 * src_strd] + 4) >> 3,
  467|  98.2M|                                pu1_src[2 * src_strd] - 2 * tc,
  468|  98.2M|                                pu1_src[2 * src_strd] + 2 * tc);
  469|       |
  470|  98.2M|                tmp_p0 = CLIP3((pu1_src[1 * src_strd] +
  ------------------
  |  |   40|  98.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.26k, False: 98.2M]
  |  |  |  Branch (40:53): [True: 1.58k, False: 98.2M]
  |  |  ------------------
  ------------------
  471|  98.2M|                                2 * pu1_src[0 * src_strd] +
  472|  98.2M|                                2 * pu1_src[-1 * src_strd] +
  473|  98.2M|                                2 * pu1_src[-2 * src_strd] +
  474|  98.2M|                                pu1_src[-3 * src_strd] + 4) >> 3,
  475|  98.2M|                                pu1_src[-1 * src_strd] - 2 * tc,
  476|  98.2M|                                pu1_src[-1 * src_strd] + 2 * tc);
  477|       |
  478|  98.2M|                tmp_p1 = CLIP3((pu1_src[0 * src_strd] +
  ------------------
  |  |   40|  98.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 925, False: 98.2M]
  |  |  |  Branch (40:53): [True: 1.91k, False: 98.2M]
  |  |  ------------------
  ------------------
  479|  98.2M|                                pu1_src[-1 * src_strd] +
  480|  98.2M|                                pu1_src[-2 * src_strd] +
  481|  98.2M|                                pu1_src[-3 * src_strd] + 2) >> 2,
  482|  98.2M|                                pu1_src[-2 * src_strd] - 2 * tc,
  483|  98.2M|                                pu1_src[-2 * src_strd] + 2 * tc);
  484|       |
  485|  98.2M|                tmp_p2 = CLIP3((pu1_src[0 * src_strd] +
  ------------------
  |  |   40|  98.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 756, False: 98.2M]
  |  |  |  Branch (40:53): [True: 2.61k, False: 98.2M]
  |  |  ------------------
  ------------------
  486|  98.2M|                                pu1_src[-1 * src_strd] +
  487|  98.2M|                                pu1_src[-2 * src_strd] +
  488|  98.2M|                                3 * pu1_src[-3 * src_strd] +
  489|  98.2M|                                2 * pu1_src[-4 * src_strd] + 4) >> 3,
  490|  98.2M|                                pu1_src[-3 * src_strd] - 2 * tc,
  491|  98.2M|                                pu1_src[-3 * src_strd] + 2 * tc);
  492|  98.2M|            }
  493|   110M|            else
  494|   110M|            {
  495|   110M|                delta = (9 * (pu1_src[0 * src_strd] - pu1_src[-1 * src_strd]) -
  496|   110M|                                3 * (pu1_src[1 * src_strd] - pu1_src[-2 * src_strd]) +
  497|   110M|                                8) >> 4;
  498|   110M|                if(ABS(delta) < 10 * tc)
  ------------------
  |  |   45|   110M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 35.2M, False: 75.6M]
  |  |  ------------------
  ------------------
  |  Branch (498:20): [True: 110M, False: 125k]
  ------------------
  499|   110M|                {
  500|   110M|                    delta = CLIP3(delta, -tc, tc);
  ------------------
  |  |   40|   110M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 7.89M, False: 102M]
  |  |  |  Branch (40:53): [True: 6.82M, False: 95.9M]
  |  |  ------------------
  ------------------
  501|       |
  502|   110M|                    tmp_p0 = CLIP_U8(pu1_src[-1 * src_strd] + delta);
  ------------------
  |  |   40|   110M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   110M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 368k, False: 110M]
  |  |  |  |  |  Branch (40:53): [True: 108k, False: 110M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  503|   110M|                    tmp_q0 = CLIP_U8(pu1_src[0 * src_strd] - delta);
  ------------------
  |  |   40|   110M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   110M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 781k, False: 109M]
  |  |  |  |  |  Branch (40:53): [True: 105k, False: 109M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  504|       |
  505|   110M|                    if(dep == 1)
  ------------------
  |  Branch (505:24): [True: 88.7M, False: 21.9M]
  ------------------
  506|  88.7M|                    {
  507|  88.7M|                        delta_p = CLIP3((((pu1_src[-3 * src_strd] +
  ------------------
  |  |   40|  88.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 708k, False: 88.0M]
  |  |  |  Branch (40:53): [True: 886k, False: 87.2M]
  |  |  ------------------
  ------------------
  508|  88.7M|                                        pu1_src[-1 * src_strd] + 1) >> 1) -
  509|  88.7M|                                        pu1_src[-2 * src_strd] + delta) >> 1,
  510|  88.7M|                                        -(tc >> 1),
  511|  88.7M|                                        (tc >> 1));
  512|  88.7M|                        tmp_p1 = CLIP_U8(pu1_src[-2 * src_strd] + delta_p);
  ------------------
  |  |   40|  88.7M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  88.7M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 102k, False: 88.6M]
  |  |  |  |  |  Branch (40:53): [True: 79.9k, False: 88.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  513|  88.7M|                    }
  514|       |
  515|   110M|                    if(deq == 1)
  ------------------
  |  Branch (515:24): [True: 83.3M, False: 27.3M]
  ------------------
  516|  83.3M|                    {
  517|  83.3M|                        delta_q = CLIP3((((pu1_src[2 * src_strd] +
  ------------------
  |  |   40|  83.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 803k, False: 82.5M]
  |  |  |  Branch (40:53): [True: 1.26M, False: 81.3M]
  |  |  ------------------
  ------------------
  518|  83.3M|                                        pu1_src[0 * src_strd] + 1) >> 1) -
  519|  83.3M|                                        pu1_src[1 * src_strd] - delta) >> 1,
  520|  83.3M|                                        -(tc >> 1),
  521|  83.3M|                                        (tc >> 1));
  522|  83.3M|                        tmp_q1 = CLIP_U8(pu1_src[1 * src_strd] + delta_q);
  ------------------
  |  |   40|  83.3M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  83.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 261k, False: 83.1M]
  |  |  |  |  |  Branch (40:53): [True: 76.4k, False: 83.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  523|  83.3M|                    }
  524|   110M|                }
  525|   110M|            }
  526|       |
  527|   209M|            if(filter_flag_p != 0)
  ------------------
  |  Branch (527:16): [True: 209M, False: 102k]
  ------------------
  528|   209M|            {
  529|   209M|                pu1_src[-3 * src_strd] = tmp_p2;
  530|   209M|                pu1_src[-2 * src_strd] = tmp_p1;
  531|   209M|                pu1_src[-1 * src_strd] = tmp_p0;
  532|   209M|            }
  533|       |
  534|   209M|            if(filter_flag_q != 0)
  ------------------
  |  Branch (534:16): [True: 209M, False: 18.4E]
  ------------------
  535|   209M|            {
  536|   209M|                pu1_src[0 * src_strd] = tmp_q0;
  537|   209M|                pu1_src[1 * src_strd] = tmp_q1;
  538|   209M|                pu1_src[2 * src_strd] = tmp_q2;
  539|   209M|            }
  540|       |
  541|   209M|            pu1_src += 1;
  542|   209M|        }
  543|  53.1M|    }
  544|       |
  545|  59.5M|}
ihevc_deblk_chroma_vert:
  602|  27.1M|{
  603|  27.1M|    WORD32 qp_indx_u, qp_chroma_u;
  604|  27.1M|    WORD32 qp_indx_v, qp_chroma_v;
  605|  27.1M|    WORD32 tc_indx_u, tc_u;
  606|  27.1M|    WORD32 tc_indx_v, tc_v;
  607|  27.1M|    WORD32 delta_u, tmp_p0_u, tmp_q0_u;
  608|  27.1M|    WORD32 delta_v, tmp_p0_v, tmp_q0_v;
  609|  27.1M|    WORD32 row;
  610|       |
  611|  27.1M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  27.1M|#define ASSERT(x) assert((x))
  ------------------
  612|       |
  613|       |    /* chroma processing is done only if BS is 2             */
  614|       |    /* this function is assumed to be called only if BS is 2 */
  615|  27.1M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
  616|  27.1M|    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 (616:19): [True: 22.3k, False: 27.0M]
  |  Branch (616:48): [True: 0, False: 27.0M]
  ------------------
  617|       |
  618|  27.1M|    qp_indx_v = qp_offset_v + ((quant_param_p + quant_param_q + 1) >> 1);
  619|  27.1M|    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 (619:19): [True: 11.7k, False: 27.0M]
  |  Branch (619:48): [True: 9.64k, False: 27.0M]
  ------------------
  620|       |
  621|  27.1M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  27.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 27.1M]
  |  |  |  Branch (40:53): [True: 237, False: 27.1M]
  |  |  ------------------
  ------------------
  622|  27.1M|    tc_u = gai4_ihevc_tc_table[tc_indx_u];
  623|       |
  624|  27.1M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  27.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 9.64k, False: 27.0M]
  |  |  |  Branch (40:53): [True: 0, False: 27.0M]
  |  |  ------------------
  ------------------
  625|  27.1M|    tc_v = gai4_ihevc_tc_table[tc_indx_v];
  626|       |
  627|  27.1M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (627:8): [True: 389k, False: 26.7M]
  |  Branch (627:21): [True: 388k, False: 1.00k]
  ------------------
  628|   388k|    {
  629|   388k|        return;
  630|   388k|    }
  631|       |
  632|   133M|    for(row = 0; row < 4; row++)
  ------------------
  |  Branch (632:18): [True: 106M, False: 26.7M]
  ------------------
  633|   106M|    {
  634|   106M|        delta_u = CLIP3((((pu1_src[0] - pu1_src[-2]) << 2) +
  ------------------
  |  |   40|   106M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.71M, False: 103M]
  |  |  |  Branch (40:53): [True: 2.60M, False: 101M]
  |  |  ------------------
  ------------------
  635|   106M|                        pu1_src[-4] - pu1_src[2] + 4) >> 3,
  636|   106M|                        -tc_u, tc_u);
  637|       |
  638|   106M|        tmp_p0_u = CLIP_U8(pu1_src[-2] + delta_u);
  ------------------
  |  |   40|   106M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   106M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 53.4k, False: 106M]
  |  |  |  |  |  Branch (40:53): [True: 20.5k, False: 106M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  639|   106M|        tmp_q0_u = CLIP_U8(pu1_src[0] - delta_u);
  ------------------
  |  |   40|   106M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   106M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 97.3k, False: 106M]
  |  |  |  |  |  Branch (40:53): [True: 15.5k, False: 106M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  640|       |
  641|   106M|        delta_v = CLIP3((((pu1_src[1] - pu1_src[-1]) << 2) +
  ------------------
  |  |   40|   106M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.58M, False: 103M]
  |  |  |  Branch (40:53): [True: 2.45M, False: 101M]
  |  |  ------------------
  ------------------
  642|   106M|                        pu1_src[-3] - pu1_src[3] + 4) >> 3,
  643|   106M|                        -tc_v, tc_v);
  644|       |
  645|   106M|        tmp_p0_v = CLIP_U8(pu1_src[-1] + delta_v);
  ------------------
  |  |   40|   106M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   106M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 47.8k, False: 106M]
  |  |  |  |  |  Branch (40:53): [True: 18.0k, False: 106M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  646|   106M|        tmp_q0_v = CLIP_U8(pu1_src[1] - delta_v);
  ------------------
  |  |   40|   106M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   106M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 95.5k, False: 106M]
  |  |  |  |  |  Branch (40:53): [True: 15.7k, False: 106M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  647|       |
  648|   106M|        if(filter_flag_p != 0)
  ------------------
  |  Branch (648:12): [True: 106M, False: 110k]
  ------------------
  649|   106M|        {
  650|   106M|            pu1_src[-2] = tmp_p0_u;
  651|   106M|            pu1_src[-1] = tmp_p0_v;
  652|   106M|        }
  653|       |
  654|   106M|        if(filter_flag_q != 0)
  ------------------
  |  Branch (654:12): [True: 106M, False: 131k]
  ------------------
  655|   106M|        {
  656|   106M|            pu1_src[0] = tmp_q0_u;
  657|   106M|            pu1_src[1] = tmp_q0_v;
  658|   106M|        }
  659|       |
  660|   106M|        pu1_src += src_strd;
  661|   106M|    }
  662|       |
  663|  26.7M|}
ihevc_deblk_chroma_horz:
  722|  26.1M|{
  723|  26.1M|    WORD32 qp_indx_u, qp_chroma_u;
  724|  26.1M|    WORD32 qp_indx_v, qp_chroma_v;
  725|  26.1M|    WORD32 tc_indx_u, tc_u;
  726|  26.1M|    WORD32 tc_indx_v, tc_v;
  727|  26.1M|    WORD32 tc;
  728|       |
  729|  26.1M|    WORD32 delta, tmp_p0, tmp_q0;
  730|  26.1M|    WORD32 col;
  731|       |
  732|  26.1M|    ASSERT(filter_flag_p || filter_flag_q);
  ------------------
  |  |   55|  26.1M|#define ASSERT(x) assert((x))
  ------------------
  733|       |
  734|       |    /* chroma processing is done only if BS is 2             */
  735|       |    /* this function is assumed to be called only if BS is 2 */
  736|  26.1M|    qp_indx_u = qp_offset_u + ((quant_param_p + quant_param_q + 1) >> 1);
  737|  26.1M|    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 (737:19): [True: 21.6k, False: 26.1M]
  |  Branch (737:48): [True: 0, False: 26.1M]
  ------------------
  738|       |
  739|  26.1M|    qp_indx_v = qp_offset_v + ((quant_param_p + quant_param_q + 1) >> 1);
  740|  26.1M|    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 (740:19): [True: 11.4k, False: 26.1M]
  |  Branch (740:48): [True: 9.36k, False: 26.1M]
  ------------------
  741|       |
  742|  26.1M|    tc_indx_u = CLIP3(qp_chroma_u + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  26.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 26.1M]
  |  |  |  Branch (40:53): [True: 240, False: 26.1M]
  |  |  ------------------
  ------------------
  743|  26.1M|    tc_u = gai4_ihevc_tc_table[tc_indx_u];
  744|       |
  745|  26.1M|    tc_indx_v = CLIP3(qp_chroma_v + 2 + (tc_offset_div2 << 1), 0, 53);
  ------------------
  |  |   40|  26.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 9.36k, False: 26.1M]
  |  |  |  Branch (40:53): [True: 0, False: 26.1M]
  |  |  ------------------
  ------------------
  746|  26.1M|    tc_v = gai4_ihevc_tc_table[tc_indx_v];
  747|       |
  748|  26.1M|    if(0 == tc_u && 0 == tc_v)
  ------------------
  |  Branch (748:8): [True: 345k, False: 25.7M]
  |  Branch (748:21): [True: 344k, False: 1.16k]
  ------------------
  749|   344k|    {
  750|   344k|        return;
  751|   344k|    }
  752|       |
  753|   231M|    for(col = 0; col < 8; col++)
  ------------------
  |  Branch (753:18): [True: 205M, False: 25.7M]
  ------------------
  754|   205M|    {
  755|   205M|        tc = (col & 1) ? tc_v : tc_u;
  ------------------
  |  Branch (755:14): [True: 102M, False: 102M]
  ------------------
  756|   205M|        delta = CLIP3((((pu1_src[0 * src_strd] -
  ------------------
  |  |   40|   205M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 6.94M, False: 198M]
  |  |  |  Branch (40:53): [True: 6.15M, False: 192M]
  |  |  ------------------
  ------------------
  757|   205M|                      pu1_src[-1 * src_strd]) << 2) +
  758|   205M|                      pu1_src[-2 * src_strd] -
  759|   205M|                      pu1_src[1 * src_strd] + 4) >> 3,
  760|   205M|                      -tc, tc);
  761|       |
  762|   205M|        tmp_p0 = CLIP_U8(pu1_src[-1 * src_strd] + delta);
  ------------------
  |  |   40|   205M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   205M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 103k, False: 205M]
  |  |  |  |  |  Branch (40:53): [True: 32.4k, False: 205M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  763|   205M|        tmp_q0 = CLIP_U8(pu1_src[0 * src_strd] - delta);
  ------------------
  |  |   40|   205M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   205M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 187k, False: 205M]
  |  |  |  |  |  Branch (40:53): [True: 49.7k, False: 205M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  764|       |
  765|   205M|        if(filter_flag_p != 0)
  ------------------
  |  Branch (765:12): [True: 205M, False: 239k]
  ------------------
  766|   205M|        {
  767|   205M|            pu1_src[-1 * src_strd] = tmp_p0;
  768|   205M|        }
  769|       |
  770|   205M|        if(filter_flag_q != 0)
  ------------------
  |  Branch (770:12): [True: 205M, False: 335k]
  ------------------
  771|   205M|        {
  772|   205M|            pu1_src[0 * src_strd] = tmp_q0;
  773|   205M|        }
  774|       |
  775|   205M|        pu1_src += 1;
  776|   205M|    }
  777|       |
  778|  25.7M|}

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

ihevc_dpb_mgr_init:
   76|  1.62k|{
   77|  1.62k|    UWORD32 i;
   78|  1.62k|    dpb_info_t *ps_dpb_info = ps_dpb_mgr->as_dpb_info;
   79|   105k|    for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|   105k|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  281|   105k|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (79:16): [True: 103k, False: 1.62k]
  ------------------
   80|   103k|    {
   81|   103k|        ps_dpb_info[i].ps_prev_dpb = NULL;
   82|   103k|        ps_dpb_info[i].ps_pic_buf = NULL;
   83|       |
   84|   103k|    }
   85|       |
   86|  1.62k|    ps_dpb_mgr->u1_num_ref_bufs = 0;
   87|  1.62k|    ps_dpb_mgr->ps_dpb_head = NULL;
   88|       |
   89|  1.62k|}
ihevc_dpb_mgr_insert_ref:
  122|  9.14k|{
  123|  9.14k|    int i;
  124|  9.14k|    dpb_info_t *ps_dpb_info;
  125|       |
  126|  9.14k|    ps_dpb_info = ps_dpb_mgr->as_dpb_info;
  127|       |
  128|       |    /* Return error if buffer is already present in the DPB */
  129|   594k|    for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|   594k|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  281|   594k|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (129:16): [True: 585k, False: 9.14k]
  ------------------
  130|   585k|    {
  131|   585k|        if((ps_dpb_info[i].ps_pic_buf == ps_pic_buf)
  ------------------
  |  Branch (131:12): [True: 0, False: 585k]
  ------------------
  132|   585k|                        && (ps_dpb_info[i].ps_pic_buf->u1_used_as_ref))
  ------------------
  |  Branch (132:28): [True: 0, False: 0]
  ------------------
  133|      0|        {
  134|      0|            return (-1);
  135|      0|        }
  136|       |
  137|       |
  138|   585k|    }
  139|       |
  140|       |    /* Find an unused DPB location */
  141|  11.4k|    for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  11.4k|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  281|  11.4k|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (141:16): [True: 11.4k, False: 0]
  ------------------
  142|  11.4k|    {
  143|  11.4k|        if(NULL == ps_dpb_info[i].ps_pic_buf)
  ------------------
  |  Branch (143:12): [True: 9.14k, False: 2.27k]
  ------------------
  144|  9.14k|        {
  145|  9.14k|            break;
  146|  9.14k|        }
  147|  11.4k|    }
  148|  9.14k|    if(i == MAX_DPB_BUFS)
  ------------------
  |  |   41|  9.14k|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  281|  9.14k|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (148:8): [True: 0, False: 9.14k]
  ------------------
  149|      0|    {
  150|      0|        return (-1);
  151|      0|    }
  152|       |
  153|       |    /* Create DPB info */
  154|  9.14k|    ps_dpb_info[i].ps_pic_buf = ps_pic_buf;
  155|  9.14k|    ps_dpb_info[i].ps_prev_dpb = ps_dpb_mgr->ps_dpb_head;
  156|  9.14k|    ps_dpb_info[i].ps_pic_buf->u1_buf_id = buf_id;
  157|  9.14k|    ps_dpb_info[i].ps_pic_buf->u1_used_as_ref = SHORT_TERM_REF;
  158|       |
  159|       |    /* update the head node of linked list to point to the current picture */
  160|  9.14k|    ps_dpb_mgr->ps_dpb_head = ps_dpb_info + i;
  161|       |
  162|       |    /* Increment Short term buffer count */
  163|  9.14k|    ps_dpb_mgr->u1_num_ref_bufs++;
  164|       |
  165|  9.14k|    return 0;
  166|  9.14k|}
ihevc_dpb_mgr_del_ref:
  199|  7.47k|{
  200|  7.47k|    int i;
  201|  7.47k|    dpb_info_t *ps_next_dpb;
  202|       |
  203|  7.47k|    dpb_info_t *ps_unmark_node;
  204|  7.47k|    UWORD8 u1_del_node;
  205|  7.47k|    UNUSED(u1_del_node);
  ------------------
  |  |   38|  7.47k|#define UNUSED(x) ((void)(x))
  ------------------
  206|  7.47k|    u1_del_node = 0;
  207|       |
  208|       |    /* Find the node with matching absolute POC */
  209|  7.47k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_head;
  210|  7.47k|    if(ps_next_dpb->ps_pic_buf->i4_abs_poc == i4_abs_poc)
  ------------------
  |  Branch (210:8): [True: 7.08k, False: 394]
  ------------------
  211|  7.08k|    {
  212|  7.08k|        ps_unmark_node = ps_next_dpb;
  213|  7.08k|    }
  214|    394|    else
  215|    394|    {
  216|    447|        for(i = 1; i < ps_dpb_mgr->u1_num_ref_bufs; i++)
  ------------------
  |  Branch (216:20): [True: 447, False: 0]
  ------------------
  217|    447|        {
  218|    447|            if(ps_next_dpb->ps_prev_dpb->ps_pic_buf->i4_abs_poc == i4_abs_poc)
  ------------------
  |  Branch (218:16): [True: 394, False: 53]
  ------------------
  219|    394|                break;
  220|     53|            ps_next_dpb = ps_next_dpb->ps_prev_dpb;
  221|     53|        }
  222|       |
  223|    394|        if(i == ps_dpb_mgr->u1_num_ref_bufs)
  ------------------
  |  Branch (223:12): [True: 0, False: 394]
  ------------------
  224|      0|        {
  225|      0|            return;
  226|      0|        }
  227|    394|        else
  228|    394|            ps_unmark_node = ps_next_dpb->ps_prev_dpb;
  229|    394|    }
  230|       |
  231|  7.47k|    if(ps_unmark_node == ps_dpb_mgr->ps_dpb_head)
  ------------------
  |  Branch (231:8): [True: 7.08k, False: 394]
  ------------------
  232|  7.08k|    {
  233|  7.08k|        ps_dpb_mgr->ps_dpb_head = ps_unmark_node->ps_prev_dpb;
  234|  7.08k|    }
  235|    394|    else
  236|    394|    {
  237|    394|        ps_next_dpb->ps_prev_dpb = ps_unmark_node->ps_prev_dpb; //update link
  238|    394|        ps_unmark_node->ps_prev_dpb = NULL;
  239|    394|    }
  240|  7.47k|    ps_dpb_mgr->u1_num_ref_bufs--; //decrement buffer count
  241|       |
  242|       |    /* Release the physical buffer */
  243|  7.47k|    ihevc_buf_mgr_release((buf_mgr_t *)ps_buf_mgr, ps_unmark_node->ps_pic_buf->u1_buf_id,
  244|  7.47k|                          BUF_MGR_REF);
  ------------------
  |  |   40|  7.47k|#define BUF_MGR_REF         (1 << 1)
  ------------------
  245|  7.47k|    ps_unmark_node->ps_prev_dpb = NULL;
  246|  7.47k|    ps_unmark_node->ps_pic_buf = NULL;
  247|  7.47k|}
ihevc_dpb_mgr_get_ref_by_nearest_poc:
  276|  20.9k|{
  277|  20.9k|    WORD32 i;
  278|  20.9k|    WORD32 min_diff = 0x7FFFFFFF;
  279|  20.9k|    pic_buf_t *ps_pic_buf = NULL;
  280|       |
  281|  1.36M|    for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|  1.36M|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  281|  1.36M|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (281:16): [True: 1.34M, False: 20.9k]
  ------------------
  282|  1.34M|    {
  283|  1.34M|        if((ps_dpb_mgr->as_dpb_info[i].ps_pic_buf) &&
  ------------------
  |  Branch (283:12): [True: 21.4k, False: 1.32M]
  ------------------
  284|  1.34M|                        (ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->u1_used_as_ref != UNUSED_FOR_REF))
  ------------------
  |  Branch (284:25): [True: 13.9k, False: 7.48k]
  ------------------
  285|  13.9k|        {
  286|  13.9k|            WORD32 poc_diff = cur_abs_poc - ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->i4_abs_poc;
  287|  13.9k|            if((poc_diff > 0) && (poc_diff < min_diff))
  ------------------
  |  Branch (287:16): [True: 7.31k, False: 6.62k]
  |  Branch (287:34): [True: 6.48k, False: 831]
  ------------------
  288|  6.48k|            {
  289|  6.48k|                min_diff = poc_diff;
  290|  6.48k|                ps_pic_buf = ps_dpb_mgr->as_dpb_info[i].ps_pic_buf;
  291|  6.48k|            }
  292|  13.9k|        }
  293|  1.34M|    }
  294|       |
  295|  20.9k|    if(NULL == ps_pic_buf)
  ------------------
  |  Branch (295:8): [True: 15.2k, False: 5.76k]
  ------------------
  296|  15.2k|    {
  297|  15.2k|        min_diff = 0x7FFFFFFF;
  298|   988k|        for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|   988k|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  281|   988k|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (298:20): [True: 973k, False: 15.2k]
  ------------------
  299|   973k|        {
  300|   973k|            if((ps_dpb_mgr->as_dpb_info[i].ps_pic_buf) &&
  ------------------
  |  Branch (300:16): [True: 10.3k, False: 962k]
  ------------------
  301|   973k|                            (ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->u1_used_as_ref != UNUSED_FOR_REF))
  ------------------
  |  Branch (301:29): [True: 5.17k, False: 5.17k]
  ------------------
  302|  5.17k|            {
  303|  5.17k|                WORD32 poc_diff = cur_abs_poc - ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->i4_abs_poc;
  304|  5.17k|                if(ABS(poc_diff) < min_diff)
  ------------------
  |  |   45|  5.17k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 0, False: 5.17k]
  |  |  ------------------
  ------------------
  |  Branch (304:20): [True: 4.26k, False: 909]
  ------------------
  305|  4.26k|                {
  306|  4.26k|                    min_diff = ABS(poc_diff);
  ------------------
  |  |   45|  4.26k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 0, False: 4.26k]
  |  |  ------------------
  ------------------
  307|  4.26k|                    ps_pic_buf = ps_dpb_mgr->as_dpb_info[i].ps_pic_buf;
  308|  4.26k|                }
  309|  5.17k|            }
  310|   973k|        }
  311|  15.2k|    }
  312|       |
  313|  20.9k|    return ps_pic_buf;
  314|  20.9k|}
ihevc_dpb_mgr_get_ref_by_poc:
  343|  13.1k|{
  344|  13.1k|    UWORD32 i;
  345|  13.1k|    dpb_info_t *ps_next_ref;
  346|  13.1k|    pic_buf_t *ps_pic_buf = NULL;
  347|       |
  348|       |
  349|  13.1k|    ps_next_ref = ps_dpb_mgr->ps_dpb_head;
  350|  36.2k|    for(i = 0; i < ps_dpb_mgr->u1_num_ref_bufs; i++)
  ------------------
  |  Branch (350:16): [True: 25.5k, False: 10.6k]
  ------------------
  351|  25.5k|    {
  352|  25.5k|        if(ps_next_ref->ps_pic_buf->i4_abs_poc == abs_poc)
  ------------------
  |  Branch (352:12): [True: 2.47k, False: 23.0k]
  ------------------
  353|  2.47k|        {
  354|  2.47k|            ps_pic_buf = ps_next_ref->ps_pic_buf;
  355|  2.47k|            break;
  356|  2.47k|        }
  357|       |
  358|  23.0k|        ps_next_ref = ps_next_ref->ps_prev_dpb;
  359|  23.0k|    }
  360|       |
  361|  13.1k|    if(i == ps_dpb_mgr->u1_num_ref_bufs)
  ------------------
  |  Branch (361:8): [True: 10.6k, False: 2.47k]
  ------------------
  362|  10.6k|    {
  363|  10.6k|        ps_pic_buf = NULL;
  364|  10.6k|    }
  365|       |
  366|  13.1k|    return ps_pic_buf;
  367|  13.1k|}
ihevc_dpb_mgr_get_ref_by_poc_lsb:
  396|  3.97k|{
  397|  3.97k|    pic_buf_t *ps_pic_buf = NULL;
  398|  3.97k|    UWORD32 i;
  399|  3.97k|    dpb_info_t *ps_next_ref;
  400|       |
  401|  3.97k|    ps_next_ref = ps_dpb_mgr->ps_dpb_head;
  402|  8.72k|    for(i = 0; i < ps_dpb_mgr->u1_num_ref_bufs; i++)
  ------------------
  |  Branch (402:16): [True: 6.29k, False: 2.43k]
  ------------------
  403|  6.29k|    {
  404|  6.29k|        if(ps_next_ref->ps_pic_buf->i4_poc_lsb == poc_lsb)
  ------------------
  |  Branch (404:12): [True: 1.54k, False: 4.75k]
  ------------------
  405|  1.54k|        {
  406|  1.54k|            ps_pic_buf = ps_next_ref->ps_pic_buf;
  407|  1.54k|            break;
  408|  1.54k|        }
  409|       |
  410|  4.75k|        ps_next_ref = ps_next_ref->ps_prev_dpb;
  411|  4.75k|    }
  412|       |
  413|  3.97k|    if(i == ps_dpb_mgr->u1_num_ref_bufs)
  ------------------
  |  Branch (413:8): [True: 2.43k, False: 1.54k]
  ------------------
  414|  2.43k|    {
  415|  2.43k|        ps_pic_buf = NULL;
  416|  2.43k|    }
  417|       |
  418|  3.97k|    return ps_pic_buf;
  419|  3.97k|}

ihevc_inter_pred_luma_copy:
  115|   141k|{
  116|   141k|    WORD32 row, col;
  117|   141k|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|   141k|#define UNUSED(x) ((void)(x))
  ------------------
  118|  1.40M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (118:18): [True: 1.26M, False: 141k]
  ------------------
  119|  1.26M|    {
  120|  19.0M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (120:22): [True: 17.8M, False: 1.26M]
  ------------------
  121|  17.8M|        {
  122|  17.8M|            pu1_dst[col] = pu1_src[col];
  123|  17.8M|        }
  124|       |
  125|  1.26M|        pu1_src += src_strd;
  126|  1.26M|        pu1_dst += dst_strd;
  127|  1.26M|    }
  128|   141k|}
ihevc_inter_pred_luma_horz:
  177|  52.9k|{
  178|  52.9k|    WORD32 row, col, i;
  179|  52.9k|    WORD16 i2_tmp;
  180|       |
  181|   508k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (181:18): [True: 455k, False: 52.9k]
  ------------------
  182|   455k|    {
  183|  5.97M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (183:22): [True: 5.52M, False: 455k]
  ------------------
  184|  5.52M|        {
  185|  5.52M|            i2_tmp = 0;
  186|  49.4M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  49.4M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (186:24): [True: 43.9M, False: 5.52M]
  ------------------
  187|  43.9M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 3)];
  188|       |
  189|  5.52M|            i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  5.52M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  5.52M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  269|  5.52M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  5.52M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|  5.52M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  190|  5.52M|            i2_tmp = CLIP_U8(i2_tmp);
  ------------------
  |  |   40|  5.52M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.52M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 84.6k, False: 5.43M]
  |  |  |  |  |  Branch (40:53): [True: 89.0k, False: 5.34M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|       |
  192|  5.52M|            pu1_dst[col] = (UWORD8)i2_tmp;
  193|  5.52M|        }
  194|       |
  195|   455k|        pu1_src += src_strd;
  196|   455k|        pu1_dst += dst_strd;
  197|   455k|    }
  198|       |
  199|  52.9k|}
ihevc_inter_pred_luma_vert:
  250|  50.5k|{
  251|  50.5k|    WORD32 row, col, i;
  252|  50.5k|    WORD16 i2_tmp;
  253|       |
  254|   481k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (254:18): [True: 430k, False: 50.5k]
  ------------------
  255|   430k|    {
  256|  5.39M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (256:22): [True: 4.96M, False: 430k]
  ------------------
  257|  4.96M|        {
  258|  4.96M|            i2_tmp = 0;
  259|  44.6M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  44.6M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (259:24): [True: 39.6M, False: 4.96M]
  ------------------
  260|  39.6M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 3) * src_strd];
  261|       |
  262|  4.96M|            i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  4.96M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  4.96M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  269|  4.96M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  4.96M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|  4.96M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  263|  4.96M|            i2_tmp = CLIP_U8(i2_tmp);
  ------------------
  |  |   40|  4.96M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.96M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 78.9k, False: 4.88M]
  |  |  |  |  |  Branch (40:53): [True: 81.6k, False: 4.80M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  264|       |
  265|  4.96M|            pu1_dst[col] = (UWORD8)i2_tmp;
  266|  4.96M|        }
  267|       |
  268|   430k|        pu1_src += src_strd;
  269|   430k|        pu1_dst += dst_strd;
  270|   430k|    }
  271|       |
  272|  50.5k|}
ihevc_inter_pred_luma_copy_w16out:
  323|  1.60M|{
  324|  1.60M|    WORD32 row, col;
  325|  1.60M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  1.60M|#define UNUSED(x) ((void)(x))
  ------------------
  326|  14.6M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (326:18): [True: 13.0M, False: 1.60M]
  ------------------
  327|  13.0M|    {
  328|   143M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (328:22): [True: 130M, False: 13.0M]
  ------------------
  329|   130M|        {
  330|   130M|            pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|   130M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|   130M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  331|   130M|        }
  332|       |
  333|  13.0M|        pu1_src += src_strd;
  334|  13.0M|        pi2_dst += dst_strd;
  335|  13.0M|    }
  336|       |
  337|  1.60M|}
ihevc_inter_pred_luma_horz_w16out:
  389|   156k|{
  390|   156k|    WORD32 row, col, i;
  391|   156k|    WORD16 i2_tmp;
  392|       |
  393|  2.59M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (393:18): [True: 2.43M, False: 156k]
  ------------------
  394|  2.43M|    {
  395|  34.3M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (395:22): [True: 31.8M, False: 2.43M]
  ------------------
  396|  31.8M|        {
  397|  31.8M|            i2_tmp = 0;
  398|   284M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|   284M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (398:24): [True: 252M, False: 31.8M]
  ------------------
  399|   252M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 3)];
  400|       |
  401|  31.8M|            pi2_dst[col] = i2_tmp;
  402|  31.8M|        }
  403|       |
  404|  2.43M|        pu1_src += src_strd;
  405|  2.43M|        pi2_dst += dst_strd;
  406|  2.43M|    }
  407|       |
  408|   156k|}
ihevc_inter_pred_luma_vert_w16out:
  460|  33.3k|{
  461|  33.3k|    WORD32 row, col, i;
  462|  33.3k|    WORD16 i2_tmp;
  463|       |
  464|   405k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (464:18): [True: 372k, False: 33.3k]
  ------------------
  465|   372k|    {
  466|  7.08M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (466:22): [True: 6.71M, False: 372k]
  ------------------
  467|  6.71M|        {
  468|  6.71M|            i2_tmp = 0;
  469|  60.1M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  60.1M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (469:24): [True: 53.4M, False: 6.71M]
  ------------------
  470|  53.4M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 3) * src_strd];
  471|       |
  472|  6.71M|            pi2_dst[col] = i2_tmp;
  473|  6.71M|        }
  474|       |
  475|   372k|        pu1_src += src_strd;
  476|   372k|        pi2_dst += dst_strd;
  477|   372k|    }
  478|       |
  479|  33.3k|}
ihevc_inter_pred_luma_vert_w16inp:
  530|  80.2k|{
  531|  80.2k|    WORD32 row, col, i;
  532|  80.2k|    WORD32 i4_tmp;
  533|       |
  534|   749k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (534:18): [True: 669k, False: 80.2k]
  ------------------
  535|   669k|    {
  536|  8.35M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (536:22): [True: 7.68M, False: 669k]
  ------------------
  537|  7.68M|        {
  538|  7.68M|            i4_tmp = 0;
  539|  69.0M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  69.0M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (539:24): [True: 61.3M, False: 7.68M]
  ------------------
  540|  61.3M|                i4_tmp += pi1_coeff[i] * pi2_src[col + (i - 3) * src_strd];
  541|       |
  542|  7.68M|            i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  7.68M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|  7.68M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
                          i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  7.68M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  7.68M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  269|  7.68M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  7.68M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|  7.68M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  543|  7.68M|            i4_tmp = CLIP_U8(i4_tmp);
  ------------------
  |  |   40|  7.68M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.68M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 112k, False: 7.56M]
  |  |  |  |  |  Branch (40:53): [True: 116k, False: 7.45M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  544|       |
  545|  7.68M|            pu1_dst[col] = i4_tmp;
  546|  7.68M|        }
  547|       |
  548|   669k|        pi2_src += src_strd;
  549|   669k|        pu1_dst += dst_strd;
  550|   669k|    }
  551|       |
  552|  80.2k|}
ihevc_inter_pred_luma_vert_w16inp_w16out:
  605|  47.4k|{
  606|  47.4k|    WORD32 row, col, i;
  607|  47.4k|    WORD32 i4_tmp;
  608|       |
  609|   605k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (609:18): [True: 558k, False: 47.4k]
  ------------------
  610|   558k|    {
  611|  11.4M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (611:22): [True: 10.9M, False: 558k]
  ------------------
  612|  10.9M|        {
  613|  10.9M|            i4_tmp = 0;
  614|  98.0M|            for(i = 0; i < NTAPS_LUMA; i++)
  ------------------
  |  |   39|  98.0M|#define NTAPS_LUMA 8
  ------------------
  |  Branch (614:24): [True: 87.1M, False: 10.9M]
  ------------------
  615|  87.1M|                i4_tmp += pi1_coeff[i] * pi2_src[col + (i - 3) * src_strd];
  616|       |
  617|  10.9M|            i4_tmp = (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) - OFFSET14;
  ------------------
  |  |   41|  10.9M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|  10.9M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
                          i4_tmp = (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) - OFFSET14;
  ------------------
  |  |   43|  10.9M|#define OFFSET14 (1 << (14 - 1))
  ------------------
  618|       |
  619|  10.9M|            pi2_dst[col] = i4_tmp;
  620|  10.9M|        }
  621|       |
  622|   558k|        pi2_src += src_strd;
  623|   558k|        pi2_dst += dst_strd;
  624|   558k|    }
  625|       |
  626|  47.4k|}
ihevc_inter_pred_chroma_copy:
  677|   138k|{
  678|   138k|    WORD32 row, col;
  679|   138k|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|   138k|#define UNUSED(x) ((void)(x))
  ------------------
  680|   766k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (680:18): [True: 628k, False: 138k]
  ------------------
  681|   628k|    {
  682|  9.60M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (682:22): [True: 8.97M, False: 628k]
  ------------------
  683|  8.97M|        {
  684|  8.97M|            pu1_dst[col] = pu1_src[col];
  685|  8.97M|        }
  686|       |
  687|   628k|        pu1_src += src_strd;
  688|   628k|        pu1_dst += dst_strd;
  689|   628k|    }
  690|   138k|}
ihevc_inter_pred_chroma_horz:
  742|  48.0k|{
  743|  48.0k|    WORD32 row, col, i;
  744|  48.0k|    WORD16 i2_tmp_u, i2_tmp_v;
  745|       |
  746|   258k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (746:18): [True: 210k, False: 48.0k]
  ------------------
  747|   210k|    {
  748|  1.53M|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (748:22): [True: 1.32M, False: 210k]
  ------------------
  749|  1.32M|        {
  750|  1.32M|            i2_tmp_u = 0;
  751|  1.32M|            i2_tmp_v = 0;
  752|  6.64M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  6.64M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (752:24): [True: 5.31M, False: 1.32M]
  ------------------
  753|  5.31M|            {
  754|  5.31M|                i2_tmp_u += pi1_coeff[i] * pu1_src[col + (i - 1) * 2];
  755|  5.31M|                i2_tmp_v += pi1_coeff[i] * pu1_src[col + 1 + (i - 1) * 2];
  756|  5.31M|            }
  757|       |
  758|  1.32M|            i2_tmp_u = (i2_tmp_u + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  1.32M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  1.32M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  269|  1.32M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i2_tmp_u = (i2_tmp_u + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  1.32M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|  1.32M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  759|  1.32M|            i2_tmp_u = CLIP_U8(i2_tmp_u);
  ------------------
  |  |   40|  1.32M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.32M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 5.18k, False: 1.32M]
  |  |  |  |  |  Branch (40:53): [True: 5.27k, False: 1.31M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  760|  1.32M|            i2_tmp_v = (i2_tmp_v + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  1.32M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  1.32M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  269|  1.32M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i2_tmp_v = (i2_tmp_v + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  1.32M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|  1.32M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  761|  1.32M|            i2_tmp_v = CLIP_U8(i2_tmp_v);
  ------------------
  |  |   40|  1.32M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.32M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 4.80k, False: 1.32M]
  |  |  |  |  |  Branch (40:53): [True: 5.59k, False: 1.31M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  762|       |
  763|       |
  764|  1.32M|            pu1_dst[col] = (UWORD8)i2_tmp_u;
  765|  1.32M|            pu1_dst[col + 1] = (UWORD8)i2_tmp_v;
  766|  1.32M|        }
  767|       |
  768|   210k|        pu1_src += src_strd;
  769|   210k|        pu1_dst += dst_strd;
  770|   210k|    }
  771|  48.0k|}
ihevc_inter_pred_chroma_vert:
  824|  42.0k|{
  825|  42.0k|    WORD32 row, col, i;
  826|  42.0k|    WORD16 i2_tmp;
  827|       |
  828|   219k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (828:18): [True: 177k, False: 42.0k]
  ------------------
  829|   177k|    {
  830|  2.21M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (830:22): [True: 2.04M, False: 177k]
  ------------------
  831|  2.04M|        {
  832|  2.04M|            i2_tmp = 0;
  833|  10.2M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  10.2M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (833:24): [True: 8.16M, False: 2.04M]
  ------------------
  834|  8.16M|            {
  835|  8.16M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 1) * src_strd];
  836|  8.16M|            }
  837|       |
  838|  2.04M|            i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  2.04M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  2.04M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  269|  2.04M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i2_tmp = (i2_tmp + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  2.04M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|  2.04M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  839|  2.04M|            i2_tmp = CLIP_U8(i2_tmp);
  ------------------
  |  |   40|  2.04M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.04M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 8.02k, False: 2.03M]
  |  |  |  |  |  Branch (40:53): [True: 8.77k, False: 2.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  840|       |
  841|  2.04M|            pu1_dst[col] = (UWORD8)i2_tmp;
  842|  2.04M|        }
  843|       |
  844|   177k|        pu1_src += src_strd;
  845|   177k|        pu1_dst += dst_strd;
  846|   177k|    }
  847|  42.0k|}
ihevc_inter_pred_chroma_copy_w16out:
  899|  1.60M|{
  900|  1.60M|    WORD32 row, col;
  901|  1.60M|    UNUSED(pi1_coeff);
  ------------------
  |  |   38|  1.60M|#define UNUSED(x) ((void)(x))
  ------------------
  902|  8.31M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (902:18): [True: 6.70M, False: 1.60M]
  ------------------
  903|  6.70M|    {
  904|  73.9M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (904:22): [True: 67.2M, False: 6.70M]
  ------------------
  905|  67.2M|        {
  906|  67.2M|            pi2_dst[col] = (pu1_src[col] << SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  67.2M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|  67.2M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  907|  67.2M|        }
  908|       |
  909|  6.70M|        pu1_src += src_strd;
  910|  6.70M|        pi2_dst += dst_strd;
  911|  6.70M|    }
  912|  1.60M|}
ihevc_inter_pred_chroma_horz_w16out:
  965|   179k|{
  966|   179k|    WORD32 row, col, i;
  967|   179k|    WORD16 i2_tmp_u, i2_tmp_v;
  968|       |
  969|  1.53M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (969:18): [True: 1.35M, False: 179k]
  ------------------
  970|  1.35M|    {
  971|  10.5M|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (971:22): [True: 9.17M, False: 1.35M]
  ------------------
  972|  9.17M|        {
  973|  9.17M|            i2_tmp_u = 0;
  974|  9.17M|            i2_tmp_v = 0;
  975|  45.8M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  45.8M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (975:24): [True: 36.6M, False: 9.17M]
  ------------------
  976|  36.6M|            {
  977|  36.6M|                i2_tmp_u += pi1_coeff[i] * pu1_src[col + (i - 1) * 2];
  978|  36.6M|                i2_tmp_v += pi1_coeff[i] * pu1_src[col + 1 + (i - 1) * 2];
  979|  36.6M|            }
  980|       |
  981|  9.17M|            pi2_dst[col] = i2_tmp_u;
  982|  9.17M|            pi2_dst[col + 1] = i2_tmp_v;
  983|  9.17M|        }
  984|       |
  985|  1.35M|        pu1_src += src_strd;
  986|  1.35M|        pi2_dst += dst_strd;
  987|  1.35M|    }
  988|   179k|}
ihevc_inter_pred_chroma_vert_w16out:
 1041|  27.5k|{
 1042|  27.5k|    WORD32 row, col, i;
 1043|  27.5k|    WORD16 i2_tmp;
 1044|       |
 1045|   189k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1045:18): [True: 161k, False: 27.5k]
  ------------------
 1046|   161k|    {
 1047|  3.35M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1047:22): [True: 3.19M, False: 161k]
  ------------------
 1048|  3.19M|        {
 1049|  3.19M|            i2_tmp = 0;
 1050|  15.9M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  15.9M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (1050:24): [True: 12.7M, False: 3.19M]
  ------------------
 1051|  12.7M|            {
 1052|  12.7M|                i2_tmp += pi1_coeff[i] * pu1_src[col + (i - 1) * src_strd];
 1053|  12.7M|            }
 1054|       |
 1055|  3.19M|            pi2_dst[col] = i2_tmp;
 1056|  3.19M|        }
 1057|       |
 1058|   161k|        pu1_src += src_strd;
 1059|   161k|        pi2_dst += dst_strd;
 1060|   161k|    }
 1061|  27.5k|}
ihevc_inter_pred_chroma_vert_w16inp:
 1112|  96.4k|{
 1113|  96.4k|    WORD32 row, col, i;
 1114|  96.4k|    WORD32 i4_tmp;
 1115|       |
 1116|   500k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1116:18): [True: 404k, False: 96.4k]
  ------------------
 1117|   404k|    {
 1118|  5.16M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1118:22): [True: 4.75M, False: 404k]
  ------------------
 1119|  4.75M|        {
 1120|  4.75M|            i4_tmp = 0;
 1121|  23.7M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  23.7M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (1121:24): [True: 19.0M, False: 4.75M]
  ------------------
 1122|  19.0M|            {
 1123|  19.0M|                i4_tmp += pi1_coeff[i] * pi2_src[col + (i - 1) * src_strd];
 1124|  19.0M|            }
 1125|       |
 1126|  4.75M|            i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  4.75M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|  4.75M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
                          i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   42|  4.75M|#define OFFSET_14_MINUS_BIT_DEPTH (1 << (SHIFT_14_MINUS_BIT_DEPTH - 1))
  |  |  ------------------
  |  |  |  |   41|  4.75M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  269|  4.75M|#define BIT_DEPTH           8
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          i4_tmp = ((i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH) + OFFSET_14_MINUS_BIT_DEPTH) >> SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  4.75M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|  4.75M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1127|  4.75M|            i4_tmp = CLIP_U8(i4_tmp);
  ------------------
  |  |   40|  4.75M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.75M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 21.6k, False: 4.73M]
  |  |  |  |  |  Branch (40:53): [True: 26.0k, False: 4.70M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1128|       |
 1129|  4.75M|            pu1_dst[col] = i4_tmp;
 1130|  4.75M|        }
 1131|       |
 1132|   404k|        pi2_src += src_strd;
 1133|   404k|        pu1_dst += dst_strd;
 1134|   404k|    }
 1135|       |
 1136|  96.4k|}
ihevc_inter_pred_chroma_vert_w16inp_w16out:
 1189|  60.9k|{
 1190|  60.9k|    WORD32 row, col, i;
 1191|  60.9k|    WORD32 i4_tmp;
 1192|       |
 1193|   406k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1193:18): [True: 345k, False: 60.9k]
  ------------------
 1194|   345k|    {
 1195|  6.94M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1195:22): [True: 6.60M, False: 345k]
  ------------------
 1196|  6.60M|        {
 1197|  6.60M|            i4_tmp = 0;
 1198|  33.0M|            for(i = 0; i < NTAPS_CHROMA; i++)
  ------------------
  |  |   40|  33.0M|#define NTAPS_CHROMA 4
  ------------------
  |  Branch (1198:24): [True: 26.4M, False: 6.60M]
  ------------------
 1199|  26.4M|            {
 1200|  26.4M|                i4_tmp += pi1_coeff[i] * pi2_src[col + (i - 1) * src_strd];
 1201|  26.4M|            }
 1202|       |
 1203|  6.60M|            i4_tmp = (i4_tmp >> SHIFT_14_MINUS_BIT_DEPTH);
  ------------------
  |  |   41|  6.60M|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|  6.60M|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1204|       |
 1205|  6.60M|            pi2_dst[col] = i4_tmp;
 1206|  6.60M|        }
 1207|       |
 1208|   345k|        pi2_src += src_strd;
 1209|   345k|        pi2_dst += dst_strd;
 1210|   345k|    }
 1211|       |
 1212|  60.9k|}

ihevc_intra_pred_luma_ref_subst_all_avlble:
  120|  1.07M|{
  121|       |
  122|  1.07M|    WORD32 i;
  123|  1.07M|    WORD32 two_nt = 2 * nt;
  124|  1.07M|    UNUSED(nbr_flags);
  ------------------
  |  |   38|  1.07M|#define UNUSED(x) ((void)(x))
  ------------------
  125|  1.07M|    UNUSED(dst_strd);
  ------------------
  |  |   38|  1.07M|#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|  1.07M|    ASSERT((nbr_flags == 0x11188) || (nbr_flags == 0x133CC) || (nbr_flags == 0x1FFFF));
  ------------------
  |  |   55|  1.07M|#define ASSERT(x) assert((x))
  ------------------
  133|  1.07M|    {
  134|       |
  135|  1.07M|        if(nt == 4)
  ------------------
  |  Branch (135:12): [True: 317k, False: 753k]
  ------------------
  136|   317k|        {
  137|       |            /* 1 bit extraction for all the neighboring blocks */
  138|       |
  139|       |
  140|       |            /* Else fill the corresponding samples */
  141|   317k|            pu1_dst[two_nt] = *pu1_top_left;
  142|       |            //if(left)
  143|   317k|            {
  144|  1.58M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (144:28): [True: 1.27M, False: 317k]
  ------------------
  145|  1.27M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  146|   317k|            }
  147|       |//            if(bot_left)
  148|   317k|            {
  149|  1.58M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (149:29): [True: 1.27M, False: 317k]
  ------------------
  150|  1.27M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  151|   317k|            }
  152|       |//            if(top)
  153|   317k|            {
  154|   317k|                ihevc_memcpy(&pu1_dst[two_nt + 1], pu1_top, nt);
  155|   317k|            }
  156|       |//            if(tp_right)
  157|   317k|            {
  158|   317k|                ihevc_memcpy(&pu1_dst[two_nt + 1 + nt], pu1_top + nt, nt);
  159|   317k|            }
  160|       |
  161|       |
  162|   317k|        }
  163|   753k|        else
  164|       |
  165|   753k|        {
  166|       |
  167|       |            /* Else fill the corresponding samples */
  168|   753k|            ASSERT((nt == 8) || (nt == 16) || (nt == 32));
  ------------------
  |  |   55|   753k|#define ASSERT(x) assert((x))
  ------------------
  169|   753k|            pu1_dst[two_nt] = *pu1_top_left;
  170|       |
  171|  20.0M|            for(i = 0; i < nt; i++)
  ------------------
  |  Branch (171:24): [True: 19.3M, False: 753k]
  ------------------
  172|  19.3M|                pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  173|       |
  174|  20.0M|            for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (174:25): [True: 19.3M, False: 753k]
  ------------------
  175|  19.3M|                pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  176|       |
  177|   753k|            ihevc_memcpy_mul_8(&pu1_dst[two_nt + 1], pu1_top, nt);
  178|       |
  179|   753k|            ihevc_memcpy_mul_8(&pu1_dst[two_nt + 1 + nt], pu1_top + nt, nt);
  180|   753k|        }
  181|       |
  182|  1.07M|    }
  183|  1.07M|}
ihevc_intra_pred_luma_ref_substitution:
  194|  7.86M|{
  195|  7.86M|    UWORD8 pu1_ref;
  196|  7.86M|    WORD32 dc_val, i;
  197|  7.86M|    WORD32 total_samples = (4 * nt) + 1;
  198|  7.86M|    WORD32 two_nt = 2 * nt;
  199|       |
  200|  7.86M|    WORD32 three_nt = 3 * nt;
  201|  7.86M|    WORD32 get_bits;
  202|  7.86M|    WORD32 next;
  203|  7.86M|    WORD32 bot_left, left, top, tp_right, tp_left;
  204|       |
  205|  7.86M|    WORD32 idx, nbr_id_from_bl, frwd_nbr_flag;
  206|  7.86M|    UNUSED(dst_strd);
  ------------------
  |  |   38|  7.86M|#define UNUSED(x) ((void)(x))
  ------------------
  207|       |    /*dc_val = 1 << (BIT_DEPTH - 1);*/
  208|  7.86M|    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|  7.86M|    if(nbr_flags == 0)
  ------------------
  |  Branch (217:8): [True: 8.15k, False: 7.85M]
  ------------------
  218|  8.15k|    {
  219|   805k|        for(i = 0; i < total_samples; i++)
  ------------------
  |  Branch (219:20): [True: 797k, False: 8.15k]
  ------------------
  220|   797k|        {
  221|   797k|            pu1_dst[i] = dc_val;
  222|   797k|        }
  223|  8.15k|    }
  224|  7.85M|    else
  225|  7.85M|    {
  226|  7.85M|        if(nt <= 8)
  ------------------
  |  Branch (226:12): [True: 2.38M, False: 5.47M]
  ------------------
  227|  2.38M|        {
  228|       |            /* 1 bit extraction for all the neighboring blocks */
  229|  2.38M|            tp_left = (nbr_flags & 0x10000) >> 16;
  230|  2.38M|            bot_left = (nbr_flags & 0x8) >> 3;
  231|  2.38M|            left = (nbr_flags & 0x80) >> 7;
  232|  2.38M|            top = (nbr_flags & 0x100) >> 8;
  233|  2.38M|            tp_right = (nbr_flags & 0x1000) >> 12;
  234|       |
  235|       |            /* Else fill the corresponding samples */
  236|  2.38M|            if(tp_left)
  ------------------
  |  Branch (236:16): [True: 2.30M, False: 81.5k]
  ------------------
  237|  2.30M|                pu1_dst[two_nt] = *pu1_top_left;
  238|  81.5k|            else
  239|  81.5k|                pu1_dst[two_nt] = 0;
  240|       |
  241|       |
  242|  2.38M|            if(left)
  ------------------
  |  Branch (242:16): [True: 2.35M, False: 26.3k]
  ------------------
  243|  2.35M|            {
  244|  17.1M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (244:28): [True: 14.7M, False: 2.35M]
  ------------------
  245|  14.7M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  246|  2.35M|            }
  247|  26.3k|            else
  248|  26.3k|            {
  249|  26.3k|                ihevc_memset(&pu1_dst[two_nt - 1 - (nt - 1)], 0, nt);
  250|  26.3k|            }
  251|       |
  252|       |
  253|  2.38M|            if(bot_left)
  ------------------
  |  Branch (253:16): [True: 486k, False: 1.89M]
  ------------------
  254|   486k|            {
  255|  3.93M|                for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (255:29): [True: 3.45M, False: 486k]
  ------------------
  256|  3.45M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  257|   486k|            }
  258|  1.89M|            else
  259|  1.89M|            {
  260|  1.89M|                ihevc_memset(&pu1_dst[two_nt - 1 - (two_nt - 1)], 0, nt);
  261|  1.89M|            }
  262|       |
  263|       |
  264|  2.38M|            if(top)
  ------------------
  |  Branch (264:16): [True: 2.32M, False: 54.7k]
  ------------------
  265|  2.32M|            {
  266|  2.32M|                ihevc_memcpy(&pu1_dst[two_nt + 1], pu1_top, nt);
  267|  2.32M|            }
  268|  54.7k|            else
  269|  54.7k|            {
  270|  54.7k|                ihevc_memset(&pu1_dst[two_nt + 1], 0, nt);
  271|  54.7k|            }
  272|       |
  273|  2.38M|            if(tp_right)
  ------------------
  |  Branch (273:16): [True: 1.40M, False: 978k]
  ------------------
  274|  1.40M|            {
  275|  1.40M|                ihevc_memcpy(&pu1_dst[two_nt + 1 + nt], pu1_top + nt, nt);
  276|  1.40M|            }
  277|   978k|            else
  278|   978k|            {
  279|   978k|                ihevc_memset(&pu1_dst[two_nt + 1 + nt], 0, nt);
  280|   978k|            }
  281|  2.38M|            next = 1;
  282|       |
  283|       |            /* If bottom -left is not available, reverse substitution process*/
  284|  2.38M|            if(bot_left == 0)
  ------------------
  |  Branch (284:16): [True: 1.89M, False: 484k]
  ------------------
  285|  1.89M|            {
  286|  1.89M|                WORD32 a_nbr_flag[5];
  287|  1.89M|                a_nbr_flag[0] = bot_left;
  288|  1.89M|                a_nbr_flag[1] = left;
  289|  1.89M|                a_nbr_flag[2] = tp_left;
  290|  1.89M|                a_nbr_flag[3] = top;
  291|  1.89M|                a_nbr_flag[4] = tp_right;
  292|       |
  293|       |                /* Check for the 1st available sample from bottom-left*/
  294|  1.95M|                while(!a_nbr_flag[next])
  ------------------
  |  Branch (294:23): [True: 53.1k, False: 1.89M]
  ------------------
  295|  53.1k|                    next++;
  296|       |
  297|       |                /* If Left, top-left are available*/
  298|  1.89M|                if(next <= 2)
  ------------------
  |  Branch (298:20): [True: 1.87M, False: 26.5k]
  ------------------
  299|  1.87M|                {
  300|  1.87M|                    idx = nt * next;
  301|  1.87M|                    pu1_ref = pu1_dst[idx];
  302|  13.2M|                    for(i = 0; i < idx; i++)
  ------------------
  |  Branch (302:32): [True: 11.3M, False: 1.87M]
  ------------------
  303|  11.3M|                        pu1_dst[i] = pu1_ref;
  304|  1.87M|                }
  305|  26.5k|                else /* If top, top-right are available */
  306|  26.5k|                {
  307|       |                    /* Idx is changed to copy 1 pixel value for top-left ,if top-left is not available*/
  308|  26.5k|                    idx = (nt * (next - 1)) + 1;
  309|  26.5k|                    pu1_ref = pu1_dst[idx];
  310|   294k|                    for(i = 0; i < idx; i++)
  ------------------
  |  Branch (310:32): [True: 267k, False: 26.5k]
  ------------------
  311|   267k|                        pu1_dst[i] = pu1_ref;
  312|  26.5k|                }
  313|  1.89M|            }
  314|       |
  315|       |            /* Forward Substitution Process */
  316|       |            /* If left is Unavailable, copy the last bottom-left value */
  317|  2.38M|            if(left == 0)
  ------------------
  |  Branch (317:16): [True: 26.6k, False: 2.35M]
  ------------------
  318|  26.6k|            {
  319|  26.6k|                ihevc_memset(&pu1_dst[nt], pu1_dst[nt - 1], nt);
  320|       |
  321|  26.6k|            }
  322|       |            /* If top-left is Unavailable, copy the last left value */
  323|  2.38M|            if(tp_left == 0)
  ------------------
  |  Branch (323:16): [True: 81.8k, False: 2.30M]
  ------------------
  324|  81.8k|                pu1_dst[two_nt] = pu1_dst[two_nt - 1];
  325|       |            /* If top is Unavailable, copy the last top-left value */
  326|  2.38M|            if(top == 0)
  ------------------
  |  Branch (326:16): [True: 55.3k, False: 2.32M]
  ------------------
  327|  55.3k|            {
  328|  55.3k|                ihevc_memset(&pu1_dst[two_nt + 1], pu1_dst[two_nt], nt);
  329|  55.3k|            }
  330|       |            /* If to right is Unavailable, copy the last top value */
  331|  2.38M|            if(tp_right == 0)
  ------------------
  |  Branch (331:16): [True: 980k, False: 1.40M]
  ------------------
  332|   980k|            {
  333|   980k|                ihevc_memset(&pu1_dst[three_nt + 1], pu1_dst[three_nt], nt);
  334|       |
  335|   980k|            }
  336|  2.38M|        }
  337|       |
  338|  7.85M|        if(nt == 16)
  ------------------
  |  Branch (338:12): [True: 3.23M, False: 4.62M]
  ------------------
  339|  3.23M|        {
  340|  3.23M|            WORD32 nbr_flags_temp = 0;
  341|  3.23M|            nbr_flags_temp = ((nbr_flags & 0xC) >> 2) + ((nbr_flags & 0xC0) >> 4)
  342|  3.23M|                            + ((nbr_flags & 0x300) >> 4)
  343|  3.23M|                            + ((nbr_flags & 0x3000) >> 6)
  344|  3.23M|                            + ((nbr_flags & 0x10000) >> 8);
  345|       |
  346|       |            /* Else fill the corresponding samples */
  347|  3.23M|            if(nbr_flags & 0x10000)
  ------------------
  |  Branch (347:16): [True: 3.13M, False: 94.5k]
  ------------------
  348|  3.13M|                pu1_dst[two_nt] = *pu1_top_left;
  349|  94.5k|            else
  350|  94.5k|                pu1_dst[two_nt] = 0;
  351|       |
  352|  3.23M|            if(nbr_flags & 0xC0)
  ------------------
  |  Branch (352:16): [True: 3.22M, False: 8.41k]
  ------------------
  353|  3.22M|            {
  354|  54.8M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (354:28): [True: 51.5M, False: 3.22M]
  ------------------
  355|  51.5M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  356|  3.22M|            }
  357|  8.41k|            else
  358|  8.41k|            {
  359|  8.41k|                ihevc_memset_mul_8(&pu1_dst[two_nt - 1 - (nt - 1)], 0, nt);
  360|  8.41k|            }
  361|       |
  362|       |            /* Bottom - left availability is checked for every 8x8 TU position and set accordingly */
  363|  3.23M|            {
  364|  3.23M|                if(nbr_flags & 0x8)
  ------------------
  |  Branch (364:20): [True: 888k, False: 2.34M]
  ------------------
  365|   888k|                {
  366|  7.99M|                    for(i = nt; i < (nt + 8); i++)
  ------------------
  |  Branch (366:33): [True: 7.10M, False: 888k]
  ------------------
  367|  7.10M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  368|   888k|                }
  369|  2.34M|                else
  370|  2.34M|                {
  371|  2.34M|                    ihevc_memset_mul_8(&pu1_dst[nt - 8], 0, 8);
  372|  2.34M|                }
  373|       |
  374|  3.23M|                if(nbr_flags & 0x4)
  ------------------
  |  Branch (374:20): [True: 887k, False: 2.34M]
  ------------------
  375|   887k|                {
  376|  7.99M|                    for(i = (nt + 8); i < two_nt; i++)
  ------------------
  |  Branch (376:39): [True: 7.10M, False: 887k]
  ------------------
  377|  7.10M|                        pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  378|   887k|                }
  379|  2.34M|                else
  380|  2.34M|                {
  381|  2.34M|                    ihevc_memset_mul_8(&pu1_dst[0], 0, 8);
  382|  2.34M|                }
  383|  3.23M|            }
  384|       |
  385|  3.23M|            if(nbr_flags & 0x300)
  ------------------
  |  Branch (385:16): [True: 3.14M, False: 86.8k]
  ------------------
  386|  3.14M|            {
  387|  3.14M|                ihevc_memcpy_mul_8(&pu1_dst[two_nt + 1], pu1_top, nt);
  388|  3.14M|            }
  389|  86.8k|            else
  390|  86.8k|            {
  391|  86.8k|                ihevc_memset_mul_8(&pu1_dst[two_nt + 1], 0, nt);
  392|  86.8k|            }
  393|       |
  394|  3.23M|            if(nbr_flags & 0x3000)
  ------------------
  |  Branch (394:16): [True: 2.05M, False: 1.17M]
  ------------------
  395|  2.05M|            {
  396|  2.05M|                ihevc_memcpy_mul_8(&pu1_dst[two_nt + 1 + nt], pu1_top + nt, nt);
  397|  2.05M|            }
  398|  1.17M|            else
  399|  1.17M|            {
  400|  1.17M|                ihevc_memset_mul_8(&pu1_dst[two_nt + 1 + nt], 0, nt);
  401|  1.17M|            }
  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|  3.23M|            {
  405|  3.23M|                nbr_id_from_bl = look_up_trailing_zeros(nbr_flags_temp & 0XF) * 8; /* for below left and left */
  ------------------
  |  |   43|  3.23M|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 8.48k, False: 3.22M]
  |  |  ------------------
  ------------------
  406|       |
  407|  3.23M|                if(nbr_id_from_bl == 64)
  ------------------
  |  Branch (407:20): [True: 8.48k, False: 3.22M]
  ------------------
  408|  8.48k|                    nbr_id_from_bl = 32;
  409|       |
  410|  3.23M|                if(nbr_id_from_bl == 32)
  ------------------
  |  Branch (410:20): [True: 8.48k, False: 3.22M]
  ------------------
  411|  8.48k|                {
  412|       |                    /* for top left : 1 pel per nbr bit */
  413|  8.48k|                    if(!((nbr_flags_temp >> 8) & 0x1))
  ------------------
  |  Branch (413:24): [True: 8.48k, False: 2]
  ------------------
  414|  8.48k|                    {
  415|  8.48k|                        nbr_id_from_bl++;
  416|  8.48k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags_temp >> 4) & 0xF) * 8; /* top and top right;  8 pels per nbr bit */
  ------------------
  |  |   43|  8.48k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 8.48k]
  |  |  ------------------
  ------------------
  417|       |                        //nbr_id_from_bl += idx * 8;
  418|  8.48k|                    }
  419|  8.48k|                }
  420|       |                /* Reverse Substitution Process*/
  421|  3.23M|                if(nbr_id_from_bl)
  ------------------
  |  Branch (421:20): [True: 2.34M, False: 887k]
  ------------------
  422|  2.34M|                {
  423|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  424|  2.34M|                    pu1_ref = pu1_dst[nbr_id_from_bl];
  425|  40.0M|                    for(i = (nbr_id_from_bl - 1); i >= 0; i--)
  ------------------
  |  Branch (425:51): [True: 37.6M, False: 2.34M]
  ------------------
  426|  37.6M|                    {
  427|  37.6M|                        pu1_dst[i] = pu1_ref;
  428|  37.6M|                    }
  429|  2.34M|                }
  430|  3.23M|            }
  431|       |
  432|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  433|  27.5M|            while(nbr_id_from_bl < ((T16_4NT)+1))
  ------------------
  |  |   71|  27.5M|#define T16_4NT 64
  ------------------
  |  Branch (433:19): [True: 24.3M, False: 3.23M]
  ------------------
  434|  24.3M|            {
  435|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  436|       |                /* Devide by 8 to obtain the original index */
  437|  24.3M|                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|  24.3M|                if(nbr_id_from_bl == (T16_4NT / 2))
  ------------------
  |  |   71|  24.3M|#define T16_4NT 64
  ------------------
  |  Branch (440:20): [True: 3.22M, False: 21.1M]
  ------------------
  441|  3.22M|                {
  442|  3.22M|                    get_bits = GET_BIT(nbr_flags_temp, 8);
  ------------------
  |  |   45|  3.22M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  443|       |
  444|       |                    /* only pel substitution for TL */
  445|  3.22M|                    if(!get_bits)
  ------------------
  |  Branch (445:24): [True: 86.1k, False: 3.13M]
  ------------------
  446|  86.1k|                        pu1_dst[nbr_id_from_bl] = pu1_dst[nbr_id_from_bl - 1];
  447|  3.22M|                }
  448|  21.1M|                else
  449|  21.1M|                {
  450|  21.1M|                    get_bits = GET_BIT(nbr_flags_temp, frwd_nbr_flag);
  ------------------
  |  |   45|  21.1M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  451|  21.1M|                    if(!get_bits)
  ------------------
  |  Branch (451:24): [True: 2.52M, False: 18.5M]
  ------------------
  452|  2.52M|                    {
  453|       |                        /* 8 pel substitution (other than TL) */
  454|  2.52M|                        pu1_ref = pu1_dst[nbr_id_from_bl - 1];
  455|  2.52M|                        ihevc_memset_mul_8(pu1_dst + nbr_id_from_bl, pu1_ref, 8);
  456|       |
  457|       |
  458|  2.52M|                    }
  459|       |
  460|  21.1M|                }
  461|  24.3M|                nbr_id_from_bl += (nbr_id_from_bl == (T16_4NT / 2)) ? 1 : 8;
  ------------------
  |  |   71|  24.3M|#define T16_4NT 64
  ------------------
  |  Branch (461:35): [True: 3.21M, False: 21.1M]
  ------------------
  462|  24.3M|            }
  463|       |
  464|       |
  465|  3.23M|        }
  466|       |
  467|  7.85M|        if(nt == 32)
  ------------------
  |  Branch (467:12): [True: 2.24M, False: 5.61M]
  ------------------
  468|  2.24M|        {
  469|       |            /* Else fill the corresponding samples */
  470|  2.24M|            if(nbr_flags & 0x10000)
  ------------------
  |  Branch (470:16): [True: 1.86M, False: 380k]
  ------------------
  471|  1.86M|                pu1_dst[two_nt] = *pu1_top_left;
  472|   380k|            else
  473|   380k|                pu1_dst[two_nt] = 0;
  474|       |
  475|  2.24M|            if(nbr_flags & 0xF0)
  ------------------
  |  Branch (475:16): [True: 2.19M, False: 47.6k]
  ------------------
  476|  2.19M|            {
  477|  72.3M|                for(i = 0; i < nt; i++)
  ------------------
  |  Branch (477:28): [True: 70.1M, False: 2.19M]
  ------------------
  478|  70.1M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  479|  2.19M|            }
  480|  47.6k|            else
  481|  47.6k|            {
  482|  47.6k|                ihevc_memset_mul_8(&pu1_dst[two_nt - 1 - (nt - 1)], 0, nt);
  483|  47.6k|            }
  484|       |
  485|       |            /* Bottom - left availability is checked for every 8x8 TU position and set accordingly */
  486|  2.24M|            {
  487|  2.24M|                if(nbr_flags & 0x8)
  ------------------
  |  Branch (487:20): [True: 167k, False: 2.07M]
  ------------------
  488|   167k|                {
  489|  1.50M|                    for(i = nt; i < (nt + 8); i++)
  ------------------
  |  Branch (489:33): [True: 1.33M, False: 167k]
  ------------------
  490|  1.33M|                    pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  491|   167k|                }
  492|  2.07M|                else
  493|  2.07M|                {
  494|  2.07M|                    ihevc_memset_mul_8(&pu1_dst[24], 0, 8);
  495|  2.07M|                }
  496|       |
  497|  2.24M|                if(nbr_flags & 0x4)
  ------------------
  |  Branch (497:20): [True: 167k, False: 2.07M]
  ------------------
  498|   167k|                {
  499|  1.50M|                    for(i = (nt + 8); i < (nt + 16); i++)
  ------------------
  |  Branch (499:39): [True: 1.33M, False: 167k]
  ------------------
  500|  1.33M|                        pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  501|   167k|                }
  502|  2.07M|                else
  503|  2.07M|                {
  504|  2.07M|                    ihevc_memset_mul_8(&pu1_dst[16], 0, 8);
  505|  2.07M|                }
  506|       |
  507|  2.24M|                if(nbr_flags & 0x2)
  ------------------
  |  Branch (507:20): [True: 167k, False: 2.07M]
  ------------------
  508|   167k|                {
  509|  1.50M|                    for(i = (nt + 16); i < (nt + 24); i++)
  ------------------
  |  Branch (509:40): [True: 1.33M, False: 167k]
  ------------------
  510|  1.33M|                        pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  511|   167k|                }
  512|  2.07M|                else
  513|  2.07M|                {
  514|  2.07M|                    ihevc_memset_mul_8(&pu1_dst[8], 0, 8);
  515|  2.07M|                }
  516|       |
  517|  2.24M|                if(nbr_flags & 0x1)
  ------------------
  |  Branch (517:20): [True: 167k, False: 2.07M]
  ------------------
  518|   167k|                {
  519|  1.50M|                    for(i = (nt + 24); i < (two_nt); i++)
  ------------------
  |  Branch (519:40): [True: 1.33M, False: 167k]
  ------------------
  520|  1.33M|                        pu1_dst[two_nt - 1 - i] = pu1_left[i * src_strd];
  521|   167k|                }
  522|  2.07M|                else
  523|  2.07M|                {
  524|  2.07M|                    ihevc_memset_mul_8(&pu1_dst[0], 0, 8);
  525|  2.07M|                }
  526|  2.24M|            }
  527|       |
  528|       |
  529|  2.24M|            if(nbr_flags & 0xF00)
  ------------------
  |  Branch (529:16): [True: 1.90M, False: 333k]
  ------------------
  530|  1.90M|            {
  531|  1.90M|                ihevc_memcpy_mul_8(&pu1_dst[two_nt + 1], pu1_top, nt);
  532|  1.90M|            }
  533|   333k|            else
  534|   333k|            {
  535|   333k|                ihevc_memset_mul_8(&pu1_dst[two_nt + 1], 0, nt);
  536|   333k|            }
  537|       |
  538|  2.24M|            if(nbr_flags & 0xF000)
  ------------------
  |  Branch (538:16): [True: 1.23M, False: 1.00M]
  ------------------
  539|  1.23M|            {
  540|  1.23M|                ihevc_memcpy_mul_8(&pu1_dst[two_nt + 1 + nt], pu1_top + nt, nt);
  541|  1.23M|            }
  542|  1.00M|            else
  543|  1.00M|            {
  544|  1.00M|                ihevc_memset_mul_8(&pu1_dst[two_nt + 1 + nt], 0, nt);
  545|  1.00M|            }
  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|  2.24M|            {
  549|  2.24M|                nbr_id_from_bl = look_up_trailing_zeros((nbr_flags & 0XFF)) * 8; /* for below left and left */
  ------------------
  |  |   43|  2.24M|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 47.7k, False: 2.19M]
  |  |  ------------------
  ------------------
  550|       |
  551|  2.24M|                if(nbr_id_from_bl == 64)
  ------------------
  |  Branch (551:20): [True: 47.7k, False: 2.19M]
  ------------------
  552|  47.7k|                {
  553|       |                    /* for top left : 1 pel per nbr bit */
  554|  47.7k|                    if(!((nbr_flags >> 16) & 0x1))
  ------------------
  |  Branch (554:24): [True: 47.7k, False: 2]
  ------------------
  555|  47.7k|                    {
  556|       |                        /* top left not available */
  557|  47.7k|                        nbr_id_from_bl++;
  558|       |                        /* top and top right;  8 pels per nbr bit */
  559|  47.7k|                        nbr_id_from_bl += look_up_trailing_zeros((nbr_flags >> 8) & 0xFF) * 8;
  ------------------
  |  |   43|  47.7k|#define look_up_trailing_zeros(x) (0 == (x) ? 8 : CTZ(x))
  |  |  ------------------
  |  |  |  Branch (43:36): [True: 0, False: 47.7k]
  |  |  ------------------
  ------------------
  560|  47.7k|                    }
  561|  47.7k|                }
  562|       |                /* Reverse Substitution Process*/
  563|  2.24M|                if(nbr_id_from_bl)
  ------------------
  |  Branch (563:20): [True: 2.07M, False: 167k]
  ------------------
  564|  2.07M|                {
  565|       |                    /* Replicate the bottom-left and subsequent unavailable pixels with the 1st available pixel above */
  566|  2.07M|                    pu1_ref = pu1_dst[nbr_id_from_bl];
  567|  69.9M|                    for(i = (nbr_id_from_bl - 1); i >= 0; i--)
  ------------------
  |  Branch (567:51): [True: 67.8M, False: 2.07M]
  ------------------
  568|  67.8M|                        pu1_dst[i] = pu1_ref;
  569|  2.07M|                }
  570|  2.24M|            }
  571|       |
  572|       |            /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */
  573|  31.7M|            while(nbr_id_from_bl < ((T32_4NT)+1))
  ------------------
  |  |   70|  31.7M|#define T32_4NT 128
  ------------------
  |  Branch (573:19): [True: 29.5M, False: 2.24M]
  ------------------
  574|  29.5M|            {
  575|       |                /* To Obtain the next unavailable idx flag after reverse neighbor substitution  */
  576|       |                /* Devide by 8 to obtain the original index */
  577|  29.5M|                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|  29.5M|                if(nbr_id_from_bl == (T32_4NT / 2))
  ------------------
  |  |   70|  29.5M|#define T32_4NT 128
  ------------------
  |  Branch (580:20): [True: 2.19M, False: 27.3M]
  ------------------
  581|  2.19M|                {
  582|  2.19M|                    get_bits = GET_BIT(nbr_flags, 16);
  ------------------
  |  |   45|  2.19M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  583|       |                    /* only pel substitution for TL */
  584|  2.19M|                    if(!get_bits)
  ------------------
  |  Branch (584:24): [True: 333k, False: 1.86M]
  ------------------
  585|   333k|                        pu1_dst[nbr_id_from_bl] = pu1_dst[nbr_id_from_bl - 1];
  586|  2.19M|                }
  587|  27.3M|                else
  588|  27.3M|                {
  589|  27.3M|                    get_bits = GET_BIT(nbr_flags, frwd_nbr_flag);
  ------------------
  |  |   45|  27.3M|#define GET_BIT(y,x) ((y) & (1 << (x)))
  ------------------
  590|  27.3M|                    if(!get_bits)
  ------------------
  |  Branch (590:24): [True: 5.38M, False: 21.9M]
  ------------------
  591|  5.38M|                    {
  592|       |                        /* 8 pel substitution (other than TL) */
  593|  5.38M|                        pu1_ref = pu1_dst[nbr_id_from_bl - 1];
  594|  5.38M|                        ihevc_memset_mul_8(&pu1_dst[nbr_id_from_bl], pu1_ref, 8);
  595|       |
  596|  5.38M|                    }
  597|       |
  598|  27.3M|                }
  599|  29.5M|                nbr_id_from_bl += (nbr_id_from_bl == (T32_4NT / 2)) ? 1 : 8;
  ------------------
  |  |   70|  29.5M|#define T32_4NT 128
  ------------------
  |  Branch (599:35): [True: 2.19M, False: 27.3M]
  ------------------
  600|  29.5M|            }
  601|  2.24M|        }
  602|       |
  603|  7.85M|    }
  604|  7.86M|}
ihevc_intra_pred_ref_filtering:
  644|  7.09M|{
  645|  7.09M|    WORD32 filter_flag;
  646|  7.09M|    WORD32 i; /* Generic indexing variable */
  647|  7.09M|    WORD32 four_nt = 4 * nt;
  648|  7.09M|    UWORD8 au1_flt[(4 * MAX_CU_SIZE) + 1];
  649|  7.09M|    WORD32 bi_linear_int_flag = 0;
  650|  7.09M|    WORD32 abs_cond_left_flag = 0;
  651|  7.09M|    WORD32 abs_cond_top_flag = 0;
  652|       |    /*WORD32 dc_val = 1 << (BIT_DEPTH - 5);*/
  653|  7.09M|    WORD32 dc_val = 1 << (8 - 5);
  654|       |    //WORD32 strong_intra_smoothing_enable_flag  = 1;
  655|       |
  656|  7.09M|    filter_flag = gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2));
  657|  7.09M|    if(0 == filter_flag)
  ------------------
  |  Branch (657:8): [True: 3.06M, False: 4.02M]
  ------------------
  658|  3.06M|    {
  659|  3.06M|        if(pu1_src == pu1_dst)
  ------------------
  |  Branch (659:12): [True: 3.06M, False: 18.4E]
  ------------------
  660|  3.06M|        {
  661|  3.06M|            return;
  662|  3.06M|        }
  663|  18.4E|        else
  664|  18.4E|        {
  665|  18.4E|            for(i = 0; i < (four_nt + 1); i++)
  ------------------
  |  Branch (665:24): [True: 0, False: 18.4E]
  ------------------
  666|      0|                pu1_dst[i] = pu1_src[i];
  667|  18.4E|        }
  668|  3.06M|    }
  669|       |
  670|  4.02M|    else
  671|  4.02M|    {
  672|       |        /* If strong intra smoothin is enabled and transform size is 32 */
  673|  4.02M|        if((1 == strong_intra_smoothing_enable_flag) && (32 == nt))
  ------------------
  |  Branch (673:12): [True: 559k, False: 3.47M]
  |  Branch (673:57): [True: 316k, False: 242k]
  ------------------
  674|   316k|        {
  675|       |            /* Strong Intra Filtering */
  676|   316k|            abs_cond_top_flag = (ABS(pu1_src[2 * nt] + pu1_src[4 * nt]
  ------------------
  |  |   45|   316k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 107k, False: 209k]
  |  |  ------------------
  ------------------
  677|   316k|                            - (2 * pu1_src[3 * nt]))) < dc_val;
  678|   316k|            abs_cond_left_flag = (ABS(pu1_src[2 * nt] + pu1_src[0]
  ------------------
  |  |   45|   316k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 103k, False: 213k]
  |  |  ------------------
  ------------------
  679|   316k|                            - (2 * pu1_src[nt]))) < dc_val;
  680|       |
  681|   316k|            bi_linear_int_flag = ((1 == abs_cond_left_flag)
  ------------------
  |  Branch (681:35): [True: 191k, False: 125k]
  ------------------
  682|   316k|                            && (1 == abs_cond_top_flag));
  ------------------
  |  Branch (682:32): [True: 119k, False: 71.7k]
  ------------------
  683|   316k|        }
  684|       |        /* Extremities Untouched*/
  685|  4.02M|        au1_flt[0] = pu1_src[0];
  686|  4.02M|        au1_flt[4 * nt] = pu1_src[4 * nt];
  687|       |
  688|       |        /* Strong filtering of reference samples */
  689|  4.02M|        if(1 == bi_linear_int_flag)
  ------------------
  |  Branch (689:12): [True: 119k, False: 3.91M]
  ------------------
  690|   119k|        {
  691|   119k|            au1_flt[2 * nt] = pu1_src[2 * nt];
  692|       |
  693|  7.63M|            for(i = 1; i < (2 * nt); i++)
  ------------------
  |  Branch (693:24): [True: 7.51M, False: 119k]
  ------------------
  694|  7.51M|                au1_flt[i] = (((2 * nt) - i) * pu1_src[0] + i * pu1_src[2 * nt] + 32) >> 6;
  695|       |
  696|  7.62M|            for(i = 1; i < (2 * nt); i++)
  ------------------
  |  Branch (696:24): [True: 7.50M, False: 119k]
  ------------------
  697|  7.50M|                au1_flt[i + (2 * nt)] = (((2 * nt) - i) * pu1_src[2 * nt] + i * pu1_src[4 * nt] + 32) >> 6;
  698|       |
  699|   119k|        }
  700|  3.91M|        else
  701|  3.91M|        {
  702|       |            /* Perform bilinear filtering of Reference Samples */
  703|   323M|            for(i = 0; i < (four_nt - 1); i++)
  ------------------
  |  Branch (703:24): [True: 319M, False: 3.91M]
  ------------------
  704|   319M|            {
  705|   319M|                au1_flt[i + 1] = (pu1_src[i] + 2 * pu1_src[i + 1]
  706|   319M|                                + pu1_src[i + 2] + 2) >> 2;
  707|   319M|            }
  708|  3.91M|        }
  709|       |
  710|       |
  711|   346M|        for(i = 0; i < (four_nt + 1); i++)
  ------------------
  |  Branch (711:20): [True: 342M, False: 4.02M]
  ------------------
  712|   342M|            pu1_dst[i] = au1_flt[i];
  713|  4.02M|    }
  714|       |
  715|  7.09M|}
ihevc_intra_pred_luma_planar:
  762|  2.79M|{
  763|       |
  764|       |
  765|  2.79M|    WORD32 row, col;
  766|  2.79M|    WORD32 log2nt = 5;
  767|  2.79M|    WORD32 two_nt, three_nt;
  768|  2.79M|    UNUSED(src_strd);
  ------------------
  |  |   38|  2.79M|#define UNUSED(x) ((void)(x))
  ------------------
  769|  2.79M|    UNUSED(mode);
  ------------------
  |  |   38|  2.79M|#define UNUSED(x) ((void)(x))
  ------------------
  770|  2.79M|    switch(nt)
  771|  2.79M|    {
  772|   881k|        case 32:
  ------------------
  |  Branch (772:9): [True: 881k, False: 1.91M]
  ------------------
  773|   881k|            log2nt = 5;
  774|   881k|            break;
  775|  1.42M|        case 16:
  ------------------
  |  Branch (775:9): [True: 1.42M, False: 1.36M]
  ------------------
  776|  1.42M|            log2nt = 4;
  777|  1.42M|            break;
  778|   342k|        case 8:
  ------------------
  |  Branch (778:9): [True: 342k, False: 2.45M]
  ------------------
  779|   342k|            log2nt = 3;
  780|   342k|            break;
  781|   146k|        case 4:
  ------------------
  |  Branch (781:9): [True: 146k, False: 2.64M]
  ------------------
  782|   146k|            log2nt = 2;
  783|   146k|            break;
  784|      0|        default:
  ------------------
  |  Branch (784:9): [True: 0, False: 2.79M]
  ------------------
  785|      0|            break;
  786|  2.79M|    }
  787|  2.79M|    two_nt = 2 * nt;
  788|  2.79M|    three_nt = 3 * nt;
  789|       |    /* Planar filtering */
  790|  56.2M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (790:18): [True: 53.4M, False: 2.79M]
  ------------------
  791|  53.4M|    {
  792|  1.27G|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (792:22): [True: 1.21G, False: 53.4M]
  ------------------
  793|  1.21G|        {
  794|  1.21G|            pu1_dst[row * dst_strd + col] = ((nt - 1 - col)
  795|  1.21G|                            * pu1_ref[two_nt - 1 - row]
  796|  1.21G|                            + (col + 1) * pu1_ref[three_nt + 1]
  797|  1.21G|                            + (nt - 1 - row) * pu1_ref[two_nt + 1 + col]
  798|  1.21G|                            + (row + 1) * pu1_ref[nt - 1] + nt) >> (log2nt + 1);
  799|  1.21G|        }
  800|  53.4M|    }
  801|  2.79M|}
ihevc_intra_pred_luma_dc:
  848|   816k|{
  849|       |
  850|   816k|    WORD32 acc_dc;
  851|   816k|    WORD32 dc_val, two_dc_val, three_dc_val;
  852|   816k|    WORD32 i;
  853|   816k|    WORD32 row, col;
  854|   816k|    WORD32 log2nt = 5;
  855|   816k|    WORD32 two_nt, three_nt;
  856|   816k|    UNUSED(mode);
  ------------------
  |  |   38|   816k|#define UNUSED(x) ((void)(x))
  ------------------
  857|   816k|    UNUSED(src_strd);
  ------------------
  |  |   38|   816k|#define UNUSED(x) ((void)(x))
  ------------------
  858|   816k|    switch(nt)
  859|   816k|    {
  860|   289k|        case 32:
  ------------------
  |  Branch (860:9): [True: 289k, False: 526k]
  ------------------
  861|   289k|            log2nt = 5;
  862|   289k|            break;
  863|   306k|        case 16:
  ------------------
  |  Branch (863:9): [True: 306k, False: 509k]
  ------------------
  864|   306k|            log2nt = 4;
  865|   306k|            break;
  866|   146k|        case 8:
  ------------------
  |  Branch (866:9): [True: 146k, False: 670k]
  ------------------
  867|   146k|            log2nt = 3;
  868|   146k|            break;
  869|  73.9k|        case 4:
  ------------------
  |  Branch (869:9): [True: 73.9k, False: 742k]
  ------------------
  870|  73.9k|            log2nt = 2;
  871|  73.9k|            break;
  872|      0|        default:
  ------------------
  |  Branch (872:9): [True: 0, False: 816k]
  ------------------
  873|      0|            break;
  874|   816k|    }
  875|   816k|    two_nt = 2 * nt;
  876|   816k|    three_nt = 3 * nt;
  877|       |
  878|   816k|    acc_dc = 0;
  879|       |    /* Calculate DC value for the transform block */
  880|  16.4M|    for(i = nt; i < two_nt; i++)
  ------------------
  |  Branch (880:17): [True: 15.6M, False: 816k]
  ------------------
  881|  15.6M|        acc_dc += pu1_ref[i];
  882|       |
  883|  16.4M|    for(i = (two_nt + 1); i <= three_nt; i++)
  ------------------
  |  Branch (883:27): [True: 15.6M, False: 816k]
  ------------------
  884|  15.6M|        acc_dc += pu1_ref[i];
  885|       |
  886|   816k|    dc_val = (acc_dc + nt) >> (log2nt + 1);
  887|       |
  888|   816k|    two_dc_val = 2 * dc_val;
  889|   816k|    three_dc_val = 3 * dc_val;
  890|       |
  891|       |
  892|   816k|    if(nt == 32)
  ------------------
  |  Branch (892:8): [True: 289k, False: 526k]
  ------------------
  893|   289k|    {
  894|  9.54M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (894:22): [True: 9.25M, False: 289k]
  ------------------
  895|   304M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (895:26): [True: 295M, False: 9.25M]
  ------------------
  896|   295M|                pu1_dst[(row * dst_strd) + col] = dc_val;
  897|   289k|    }
  898|   526k|    else
  899|   526k|    {
  900|       |        /* DC filtering for the first top row and first left column */
  901|   526k|        pu1_dst[0] = ((pu1_ref[two_nt - 1] + two_dc_val + pu1_ref[two_nt + 1] + 2)
  902|   526k|                        >> 2);
  903|       |
  904|  6.36M|        for(col = 1; col < nt; col++)
  ------------------
  |  Branch (904:22): [True: 5.84M, False: 526k]
  ------------------
  905|  5.84M|            pu1_dst[col] = (pu1_ref[two_nt + 1 + col] + three_dc_val + 2) >> 2;
  906|       |
  907|  6.36M|        for(row = 1; row < nt; row++)
  ------------------
  |  Branch (907:22): [True: 5.84M, False: 526k]
  ------------------
  908|  5.84M|            pu1_dst[row * dst_strd] = (pu1_ref[two_nt - 1 - row] + three_dc_val + 2)
  909|  5.84M|                            >> 2;
  910|       |
  911|       |        /* Fill the remaining rows with DC value*/
  912|  6.35M|        for(row = 1; row < nt; row++)
  ------------------
  |  Branch (912:22): [True: 5.83M, False: 526k]
  ------------------
  913|  82.4M|            for(col = 1; col < nt; col++)
  ------------------
  |  Branch (913:26): [True: 76.6M, False: 5.83M]
  ------------------
  914|  76.6M|                pu1_dst[(row * dst_strd) + col] = dc_val;
  915|   526k|    }
  916|   816k|}
ihevc_intra_pred_luma_horz:
  964|  71.3k|{
  965|       |
  966|  71.3k|    WORD32 row, col;
  967|  71.3k|    WORD32 two_nt;
  968|  71.3k|    WORD16 s2_predpixel;
  969|  71.3k|    UNUSED(mode);
  ------------------
  |  |   38|  71.3k|#define UNUSED(x) ((void)(x))
  ------------------
  970|  71.3k|    UNUSED(src_strd);
  ------------------
  |  |   38|  71.3k|#define UNUSED(x) ((void)(x))
  ------------------
  971|  71.3k|    two_nt = 2 * nt;
  972|       |
  973|  71.3k|    if(nt == 32)
  ------------------
  |  Branch (973:8): [True: 17.2k, False: 54.1k]
  ------------------
  974|  17.2k|    {
  975|   567k|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (975:22): [True: 550k, False: 17.2k]
  ------------------
  976|  18.1M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (976:26): [True: 17.6M, False: 550k]
  ------------------
  977|  17.6M|                pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt - 1 - row];
  978|  17.2k|    }
  979|  54.1k|    else
  980|  54.1k|    {
  981|       |        /*Filtering done for the 1st row */
  982|   635k|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (982:22): [True: 581k, False: 54.1k]
  ------------------
  983|   581k|        {
  984|   581k|            s2_predpixel = pu1_ref[two_nt - 1]
  985|   581k|                            + ((pu1_ref[two_nt + 1 + col] - pu1_ref[two_nt]) >> 1);
  986|   581k|            pu1_dst[col] = CLIP_U8(s2_predpixel);
  ------------------
  |  |   40|   581k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   581k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 15.1k, False: 566k]
  |  |  |  |  |  Branch (40:53): [True: 16.8k, False: 549k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  987|   581k|        }
  988|       |
  989|       |        /* Replication to next rows*/
  990|   581k|        for(row = 1; row < nt; row++)
  ------------------
  |  Branch (990:22): [True: 527k, False: 54.1k]
  ------------------
  991|  7.56M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (991:26): [True: 7.03M, False: 527k]
  ------------------
  992|  7.03M|                pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt - 1 - row];
  993|  54.1k|    }
  994|  71.3k|}
ihevc_intra_pred_luma_ver:
 1044|   907k|{
 1045|   907k|    WORD32 row, col;
 1046|   907k|    WORD16 s2_predpixel;
 1047|   907k|    WORD32 two_nt = 2 * nt;
 1048|   907k|    UNUSED(mode);
  ------------------
  |  |   38|   907k|#define UNUSED(x) ((void)(x))
  ------------------
 1049|   907k|    UNUSED(src_strd);
  ------------------
  |  |   38|   907k|#define UNUSED(x) ((void)(x))
  ------------------
 1050|       |
 1051|   907k|    if(nt == 32)
  ------------------
  |  Branch (1051:8): [True: 352k, False: 555k]
  ------------------
 1052|   352k|    {
 1053|       |        /* Replication to next columns*/
 1054|  11.5M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1054:22): [True: 11.2M, False: 352k]
  ------------------
 1055|   368M|            for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1055:26): [True: 357M, False: 11.2M]
  ------------------
 1056|   357M|                pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt + 1 + col];
 1057|   352k|    }
 1058|   555k|    else
 1059|   555k|    {
 1060|       |        /*Filtering done for the 1st column */
 1061|  7.49M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1061:22): [True: 6.93M, False: 555k]
  ------------------
 1062|  6.93M|        {
 1063|  6.93M|            s2_predpixel = pu1_ref[two_nt + 1]
 1064|  6.93M|                            + ((pu1_ref[two_nt - 1 - row] - pu1_ref[two_nt]) >> 1);
 1065|  6.93M|            pu1_dst[row * dst_strd] = CLIP_U8(s2_predpixel);
  ------------------
  |  |   40|  6.93M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  6.93M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 259k, False: 6.67M]
  |  |  |  |  |  Branch (40:53): [True: 139k, False: 6.53M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1066|  6.93M|        }
 1067|       |
 1068|       |        /* Replication to next columns*/
 1069|  7.48M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1069:22): [True: 6.92M, False: 555k]
  ------------------
 1070|  97.9M|            for(col = 1; col < nt; col++)
  ------------------
  |  Branch (1070:26): [True: 91.0M, False: 6.92M]
  ------------------
 1071|  91.0M|                pu1_dst[(row * dst_strd) + col] = pu1_ref[two_nt + 1 + col];
 1072|   555k|    }
 1073|   907k|}
ihevc_intra_pred_luma_mode2:
 1122|   254k|{
 1123|   254k|    WORD32 row, col;
 1124|   254k|    WORD32 two_nt = 2 * nt;
 1125|   254k|    WORD32 intra_pred_ang = 32;
 1126|   254k|    WORD32 idx = 0;
 1127|   254k|    UNUSED(mode);
  ------------------
  |  |   38|   254k|#define UNUSED(x) ((void)(x))
  ------------------
 1128|   254k|    UNUSED(src_strd);
  ------------------
  |  |   38|   254k|#define UNUSED(x) ((void)(x))
  ------------------
 1129|       |    /* For the angle 45, replication is done from the corresponding angle */
 1130|       |    /* intra_pred_ang = tan(angle) in q5 format */
 1131|  4.66M|    for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1131:18): [True: 4.41M, False: 254k]
  ------------------
 1132|  4.41M|    {
 1133|  4.41M|        idx = ((col + 1) * intra_pred_ang) >> 5; /* Use idx++ */
 1134|       |
 1135|   100M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1135:22): [True: 96.0M, False: 4.41M]
  ------------------
 1136|  96.0M|            pu1_dst[col + (row * dst_strd)] = pu1_ref[two_nt - row - idx - 1];
 1137|  4.41M|    }
 1138|       |
 1139|   254k|}
ihevc_intra_pred_luma_mode_18_34:
 1186|   112k|{
 1187|   112k|    WORD32 row, col;
 1188|   112k|    WORD32 intra_pred_ang;
 1189|   112k|    WORD32 idx = 0;
 1190|   112k|    WORD32 two_nt = 2 * nt;
 1191|   112k|    UNUSED(src_strd);
  ------------------
  |  |   38|   112k|#define UNUSED(x) ((void)(x))
  ------------------
 1192|   112k|    intra_pred_ang = 32;    /*Default value*/
 1193|       |
 1194|       |    /* For mode 18, angle is -45degree */
 1195|   112k|    if(mode == 18)
  ------------------
  |  Branch (1195:8): [True: 59.1k, False: 53.5k]
  ------------------
 1196|  59.1k|        intra_pred_ang = -32;
 1197|       |    /* For mode 34, angle is 45degree */
 1198|  53.5k|    else if(mode == 34)
  ------------------
  |  Branch (1198:13): [True: 53.5k, False: 18.4E]
  ------------------
 1199|  53.5k|        intra_pred_ang = 32;
 1200|       |    /* For the angle 45 and -45, replication is done from the corresponding angle */
 1201|       |    /* No interpolation is done for 45 degree*/
 1202|  1.92M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1202:18): [True: 1.81M, False: 112k]
  ------------------
 1203|  1.81M|    {
 1204|  1.81M|        idx = ((row + 1) * intra_pred_ang) >> 5;
 1205|       |#if OPT
 1206|       |        if(mode == 18)
 1207|       |            idx--;
 1208|       |        if(mode == 34)
 1209|       |            idx++;
 1210|       |#endif
 1211|  42.2M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1211:22): [True: 40.4M, False: 1.81M]
  ------------------
 1212|  40.4M|            pu1_dst[col + (row * dst_strd)] = pu1_ref[two_nt + col + idx + 1];
 1213|       |
 1214|  1.81M|    }
 1215|       |
 1216|   112k|}
ihevc_intra_pred_luma_mode_3_to_9:
 1263|   502k|{
 1264|   502k|    WORD32 row, col;
 1265|   502k|    WORD32 two_nt = 2 * nt;
 1266|   502k|    WORD32 intra_pred_ang;
 1267|   502k|    WORD32 idx, ref_main_idx;
 1268|   502k|    WORD32 pos, fract;
 1269|   502k|    UNUSED(src_strd);
  ------------------
  |  |   38|   502k|#define UNUSED(x) ((void)(x))
  ------------------
 1270|       |    /* Intra Pred Angle according to the mode */
 1271|   502k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1272|       |
 1273|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1274|       |    /* samples dependent on distance to obtain destination sample */
 1275|       |
 1276|  8.76M|    for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1276:18): [True: 8.26M, False: 502k]
  ------------------
 1277|  8.26M|    {
 1278|  8.26M|        pos = ((col + 1) * intra_pred_ang);
 1279|  8.26M|        idx = pos >> 5;
 1280|  8.26M|        fract = pos & (31);
 1281|       |
 1282|       |        // Do linear filtering
 1283|   195M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1283:22): [True: 186M, False: 8.26M]
  ------------------
 1284|   186M|        {
 1285|   186M|            ref_main_idx = two_nt - row - idx - 1;
 1286|   186M|            pu1_dst[col + (row * dst_strd)] = (((32 - fract)
 1287|   186M|                            * pu1_ref[ref_main_idx]
 1288|   186M|                            + fract * pu1_ref[ref_main_idx - 1] + 16) >> 5);
 1289|   186M|        }
 1290|       |
 1291|  8.26M|    }
 1292|       |
 1293|   502k|}
ihevc_intra_pred_luma_mode_11_to_17:
 1340|   480k|{
 1341|       |    /* This function and ihevc_intra_pred_luma_mode_19_to_25 are same except*/
 1342|       |    /* for ref main & side samples assignment,can be combined for */
 1343|       |    /* optimzation*/
 1344|       |
 1345|   480k|    WORD32 row, col, k;
 1346|   480k|    WORD32 two_nt;
 1347|   480k|    WORD32 intra_pred_ang, inv_ang, inv_ang_sum;
 1348|   480k|    WORD32 idx, ref_main_idx, ref_idx;
 1349|   480k|    WORD32 pos, fract;
 1350|       |
 1351|   480k|    UWORD8 ref_temp[2 * MAX_CU_SIZE + 1];
 1352|   480k|    UWORD8 *ref_main;
 1353|   480k|    UNUSED(src_strd);
  ------------------
  |  |   38|   480k|#define UNUSED(x) ((void)(x))
  ------------------
 1354|   480k|    inv_ang_sum = 128;
 1355|   480k|    two_nt    = 2 * nt;
 1356|       |
 1357|   480k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1358|       |
 1359|   480k|    inv_ang = gai4_ihevc_inv_ang_table[mode - 11];
 1360|       |    /* Intermediate reference samples for negative angle modes */
 1361|       |    /* This have to be removed during optimization*/
 1362|       |    /* For horizontal modes, (ref main = ref left) (ref side = ref above) */
 1363|       |
 1364|   480k|    ref_main = ref_temp + nt - 1;
 1365|  9.36M|    for(k = 0; k < nt + 1; k++)
  ------------------
  |  Branch (1365:16): [True: 8.87M, False: 480k]
  ------------------
 1366|  8.87M|        ref_temp[k + nt - 1] = pu1_ref[two_nt - k];
 1367|       |
 1368|   480k|    ref_main = ref_temp + nt - 1;
 1369|   480k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1370|       |
 1371|       |    /* SIMD Optimization can be done using look-up table for the loop */
 1372|       |    /* For negative angled derive the main reference samples from side */
 1373|       |    /*  reference samples refer to section 8.4.4.2.6 */
 1374|  3.50M|    for(k = -1; k > ref_idx; k--)
  ------------------
  |  Branch (1374:17): [True: 3.02M, False: 480k]
  ------------------
 1375|  3.02M|    {
 1376|  3.02M|        inv_ang_sum += inv_ang;
 1377|  3.02M|        ref_main[k] = pu1_ref[two_nt + (inv_ang_sum >> 8)];
 1378|  3.02M|    }
 1379|       |
 1380|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1381|       |    /* samples dependent on distance to obtain destination sample */
 1382|  8.86M|    for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1382:18): [True: 8.37M, False: 480k]
  ------------------
 1383|  8.37M|    {
 1384|  8.37M|        pos = ((col + 1) * intra_pred_ang);
 1385|  8.37M|        idx = pos >> 5;
 1386|  8.37M|        fract = pos & (31);
 1387|       |
 1388|       |        // Do linear filtering
 1389|   211M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1389:22): [True: 203M, False: 8.37M]
  ------------------
 1390|   203M|        {
 1391|   203M|            ref_main_idx = row + idx + 1;
 1392|   203M|            pu1_dst[col + (dst_strd * row)] = (UWORD8)(((32 - fract)
 1393|   203M|                            * ref_main[ref_main_idx]
 1394|   203M|                            + fract * ref_main[ref_main_idx + 1] + 16) >> 5);
 1395|       |
 1396|   203M|        }
 1397|       |
 1398|  8.37M|    }
 1399|       |
 1400|   480k|}
ihevc_intra_pred_luma_mode_19_to_25:
 1448|   512k|{
 1449|       |
 1450|   512k|    WORD32 row, col, k;
 1451|   512k|    WORD32 two_nt, intra_pred_ang, idx;
 1452|   512k|    WORD32 inv_ang, inv_ang_sum, pos, fract;
 1453|   512k|    WORD32 ref_main_idx, ref_idx;
 1454|   512k|    UWORD8 ref_temp[(2 * MAX_CU_SIZE) + 1];
 1455|   512k|    UWORD8 *ref_main;
 1456|   512k|    UNUSED(src_strd);
  ------------------
  |  |   38|   512k|#define UNUSED(x) ((void)(x))
  ------------------
 1457|   512k|    two_nt = 2 * nt;
 1458|   512k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1459|   512k|    inv_ang = gai4_ihevc_inv_ang_table[mode - 12];
 1460|       |
 1461|       |    /* Intermediate reference samples for negative angle modes */
 1462|       |    /* This have to be removed during optimization*/
 1463|       |    /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 1464|   512k|    ref_main = ref_temp + nt - 1;
 1465|  8.99M|    for(k = 0; k < (nt + 1); k++)
  ------------------
  |  Branch (1465:16): [True: 8.47M, False: 512k]
  ------------------
 1466|  8.47M|        ref_temp[k + nt - 1] = pu1_ref[two_nt + k];
 1467|       |
 1468|   512k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1469|   512k|    inv_ang_sum = 128;
 1470|       |
 1471|       |    /* SIMD Optimization can be done using look-up table for the loop */
 1472|       |    /* For negative angled derive the main reference samples from side */
 1473|       |    /*  reference samples refer to section 8.4.4.2.6 */
 1474|  3.21M|    for(k = -1; k > ref_idx; k--)
  ------------------
  |  Branch (1474:17): [True: 2.70M, False: 512k]
  ------------------
 1475|  2.70M|    {
 1476|  2.70M|        inv_ang_sum += inv_ang;
 1477|  2.70M|        ref_main[k] = pu1_ref[two_nt - (inv_ang_sum >> 8)];
 1478|  2.70M|    }
 1479|       |
 1480|  8.43M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1480:18): [True: 7.92M, False: 512k]
  ------------------
 1481|  7.92M|    {
 1482|  7.92M|        pos = ((row + 1) * intra_pred_ang);
 1483|  7.92M|        idx = pos >> 5;
 1484|  7.92M|        fract = pos & (31);
 1485|       |
 1486|       |        // Do linear filtering
 1487|   179M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1487:22): [True: 171M, False: 7.92M]
  ------------------
 1488|   171M|        {
 1489|   171M|            ref_main_idx = col + idx + 1;
 1490|   171M|            pu1_dst[(row * dst_strd) + col] = (UWORD8)(((32 - fract)
 1491|   171M|                            * ref_main[ref_main_idx]
 1492|   171M|                            + fract * ref_main[ref_main_idx + 1] + 16) >> 5);
 1493|       |
 1494|   171M|        }
 1495|       |
 1496|  7.92M|    }
 1497|       |
 1498|   512k|}
ihevc_intra_pred_luma_mode_27_to_33:
 1546|   645k|{
 1547|   645k|    WORD32 row, col;
 1548|   645k|    WORD32 two_nt, pos, fract;
 1549|   645k|    WORD32 intra_pred_ang;
 1550|   645k|    WORD32 idx, ref_main_idx;
 1551|   645k|    UNUSED(src_strd);
  ------------------
  |  |   38|   645k|#define UNUSED(x) ((void)(x))
  ------------------
 1552|   645k|    two_nt = 2 * nt;
 1553|   645k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1554|       |
 1555|  9.23M|    for(row = 0; row < nt; row++)
  ------------------
  |  Branch (1555:18): [True: 8.58M, False: 645k]
  ------------------
 1556|  8.58M|    {
 1557|  8.58M|        pos = ((row + 1) * intra_pred_ang);
 1558|  8.58M|        idx = pos >> 5;
 1559|  8.58M|        fract = pos & (31);
 1560|       |
 1561|       |        // Do linear filtering
 1562|   186M|        for(col = 0; col < nt; col++)
  ------------------
  |  Branch (1562:22): [True: 177M, False: 8.58M]
  ------------------
 1563|   177M|        {
 1564|   177M|            ref_main_idx = two_nt + col + idx + 1;
 1565|   177M|            pu1_dst[col + (row * dst_strd)] = (((32 - fract)
 1566|   177M|                            * pu1_ref[ref_main_idx]
 1567|   177M|                            + fract * pu1_ref[ref_main_idx + 1] + 16) >> 5);
 1568|   177M|        }
 1569|       |
 1570|  8.58M|    }
 1571|       |
 1572|   645k|}

ihevc_itrans_recon_4x4_ttype1:
  108|   220k|{
  109|   220k|    WORD32 i, c[4];
  110|   220k|    WORD32 add;
  111|   220k|    WORD32 shift;
  112|   220k|    WORD16 *pi2_tmp_orig;
  113|   220k|    WORD32 trans_size;
  114|   220k|    UNUSED(zero_rows);
  ------------------
  |  |   38|   220k|#define UNUSED(x) ((void)(x))
  ------------------
  115|   220k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  419|   220k|#define TRANS_SIZE_4   4
  ------------------
  116|       |
  117|   220k|    pi2_tmp_orig = pi2_tmp;
  118|       |
  119|       |    /* Inverse Transform 1st stage */
  120|   220k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|   220k|#define IT_SHIFT_STAGE_1 7
  ------------------
  121|   220k|    add = 1 << (shift - 1);
  122|       |
  123|  1.10M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (123:16): [True: 881k, False: 220k]
  ------------------
  124|   881k|    {
  125|       |        /* Checking for Zero Cols */
  126|   881k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (126:12): [True: 258k, False: 622k]
  ------------------
  127|   258k|        {
  128|   258k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  129|   258k|        }
  130|   622k|        else
  131|   622k|        {
  132|       |            // Intermediate Variables
  133|   622k|            c[0] = pi2_src[0] + pi2_src[2 * src_strd];
  134|   622k|            c[1] = pi2_src[2 * src_strd] + pi2_src[3 * src_strd];
  135|   622k|            c[2] = pi2_src[0] - pi2_src[3 * src_strd];
  136|   622k|            c[3] = 74 * pi2_src[src_strd];
  137|       |
  138|   622k|            pi2_tmp[0] =
  139|   622k|                            CLIP_S16((29 * c[0] + 55 * c[1] + c[3] + add) >> shift);
  ------------------
  |  |   53|   622k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   622k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.04k, False: 621k]
  |  |  |  |  |  Branch (40:53): [True: 670, False: 620k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  140|   622k|            pi2_tmp[1] =
  141|   622k|                            CLIP_S16((55 * c[2] - 29 * c[1] + c[3] + add) >> shift);
  ------------------
  |  |   53|   622k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   622k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 920, False: 621k]
  |  |  |  |  |  Branch (40:53): [True: 782, False: 620k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  142|   622k|            pi2_tmp[2] =
  143|   622k|                            CLIP_S16((74 * (pi2_src[0] - pi2_src[2 * src_strd] + pi2_src[3 * src_strd]) + add) >> shift);
  ------------------
  |  |   53|   622k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   622k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 677, False: 621k]
  |  |  |  |  |  Branch (40:53): [True: 559, False: 621k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  144|   622k|            pi2_tmp[3] =
  145|   622k|                            CLIP_S16((55 * c[0] + 29 * c[2] - c[3] + add) >> shift);
  ------------------
  |  |   53|   622k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   622k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.19k, False: 621k]
  |  |  |  |  |  Branch (40:53): [True: 1.30k, False: 620k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  146|   622k|        }
  147|   881k|        pi2_src++;
  148|   881k|        pi2_tmp += trans_size;
  149|   881k|        zero_cols = zero_cols >> 1;
  150|   881k|    }
  151|       |
  152|   220k|    pi2_tmp = pi2_tmp_orig;
  153|       |
  154|       |    /* Inverse Transform 2nd stage */
  155|   220k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|   220k|#define IT_SHIFT_STAGE_2 12
  ------------------
  156|   220k|    add = 1 << (shift - 1);
  157|       |
  158|  1.10M|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (158:16): [True: 882k, False: 220k]
  ------------------
  159|   882k|    {
  160|   882k|        WORD32 itrans_out;
  161|       |        // Intermediate Variables
  162|   882k|        c[0] = pi2_tmp[0] + pi2_tmp[2 * trans_size];
  163|   882k|        c[1] = pi2_tmp[2 * trans_size] + pi2_tmp[3 * trans_size];
  164|   882k|        c[2] = pi2_tmp[0] - pi2_tmp[3 * trans_size];
  165|   882k|        c[3] = 74 * pi2_tmp[trans_size];
  166|       |
  167|   882k|        itrans_out =
  168|   882k|                        CLIP_S16((29 * c[0] + 55 * c[1] + c[3] + add) >> shift);
  ------------------
  |  |   53|   882k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   882k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 882k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 882k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|   882k|        pu1_dst[0] = CLIP_U8((itrans_out + pu1_pred[0]));
  ------------------
  |  |   40|   882k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   882k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 253k, False: 628k]
  |  |  |  |  |  Branch (40:53): [True: 68.5k, False: 560k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  170|   882k|        itrans_out =
  171|   882k|                        CLIP_S16((55 * c[2] - 29 * c[1] + c[3] + add) >> shift);
  ------------------
  |  |   53|   882k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   882k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 882k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 882k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  172|   882k|        pu1_dst[1] = CLIP_U8((itrans_out + pu1_pred[1]));
  ------------------
  |  |   40|   882k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   882k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 208k, False: 673k]
  |  |  |  |  |  Branch (40:53): [True: 71.6k, False: 602k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|   882k|        itrans_out =
  174|   882k|                        CLIP_S16((74 * (pi2_tmp[0] - pi2_tmp[2 * trans_size] + pi2_tmp[3 * trans_size]) + add) >> shift);
  ------------------
  |  |   53|   882k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   882k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 882k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 882k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  175|   882k|        pu1_dst[2] = CLIP_U8((itrans_out + pu1_pred[2]));
  ------------------
  |  |   40|   882k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   882k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 168k, False: 713k]
  |  |  |  |  |  Branch (40:53): [True: 70.6k, False: 642k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  176|   882k|        itrans_out =
  177|   882k|                        CLIP_S16((55 * c[0] + 29 * c[2] - c[3] + add) >> shift);
  ------------------
  |  |   53|   882k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   882k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 882k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 882k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  178|   882k|        pu1_dst[3] = CLIP_U8((itrans_out + pu1_pred[3]));
  ------------------
  |  |   40|   882k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   882k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 260k, False: 621k]
  |  |  |  |  |  Branch (40:53): [True: 83.8k, False: 538k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  179|   882k|        pi2_tmp++;
  180|   882k|        pu1_pred += pred_strd;
  181|   882k|        pu1_dst += dst_strd;
  182|   882k|    }
  183|   220k|}
ihevc_itrans_recon_4x4:
  244|  11.4k|{
  245|  11.4k|    WORD32 j;
  246|  11.4k|    WORD32 e[2], o[2];
  247|  11.4k|    WORD32 add;
  248|  11.4k|    WORD32 shift;
  249|  11.4k|    WORD16 *pi2_tmp_orig;
  250|  11.4k|    WORD32 trans_size;
  251|  11.4k|    UNUSED(zero_rows);
  ------------------
  |  |   38|  11.4k|#define UNUSED(x) ((void)(x))
  ------------------
  252|  11.4k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  419|  11.4k|#define TRANS_SIZE_4   4
  ------------------
  253|       |
  254|  11.4k|    pi2_tmp_orig = pi2_tmp;
  255|       |
  256|       |    /* Inverse Transform 1st stage */
  257|  11.4k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|  11.4k|#define IT_SHIFT_STAGE_1 7
  ------------------
  258|  11.4k|    add = 1 << (shift - 1);
  259|       |
  260|  57.0k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (260:16): [True: 45.6k, False: 11.4k]
  ------------------
  261|  45.6k|    {
  262|       |        /* Checking for Zero Cols */
  263|  45.6k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (263:12): [True: 12.1k, False: 33.4k]
  ------------------
  264|  12.1k|        {
  265|  12.1k|            memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  266|  12.1k|        }
  267|  33.4k|        else
  268|  33.4k|        {
  269|       |
  270|       |            /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  271|  33.4k|            o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_src[src_strd]
  272|  33.4k|                            + g_ai2_ihevc_trans_4[3][0] * pi2_src[3 * src_strd];
  273|  33.4k|            o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_src[src_strd]
  274|  33.4k|                            + g_ai2_ihevc_trans_4[3][1] * pi2_src[3 * src_strd];
  275|  33.4k|            e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_src[0]
  276|  33.4k|                            + g_ai2_ihevc_trans_4[2][0] * pi2_src[2 * src_strd];
  277|  33.4k|            e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_src[0]
  278|  33.4k|                            + g_ai2_ihevc_trans_4[2][1] * pi2_src[2 * src_strd];
  279|       |
  280|  33.4k|            pi2_tmp[0] =
  281|  33.4k|                            CLIP_S16(((e[0] + o[0] + add) >> shift));
  ------------------
  |  |   53|  33.4k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  33.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 165, False: 33.3k]
  |  |  |  |  |  Branch (40:53): [True: 185, False: 33.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  282|  33.4k|            pi2_tmp[1] =
  283|  33.4k|                            CLIP_S16(((e[1] + o[1] + add) >> shift));
  ------------------
  |  |   53|  33.4k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  33.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 147, False: 33.3k]
  |  |  |  |  |  Branch (40:53): [True: 149, False: 33.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  284|  33.4k|            pi2_tmp[2] =
  285|  33.4k|                            CLIP_S16(((e[1] - o[1] + add) >> shift));
  ------------------
  |  |   53|  33.4k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  33.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 150, False: 33.3k]
  |  |  |  |  |  Branch (40:53): [True: 156, False: 33.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  286|  33.4k|            pi2_tmp[3] =
  287|  33.4k|                            CLIP_S16(((e[0] - o[0] + add) >> shift));
  ------------------
  |  |   53|  33.4k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  33.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 151, False: 33.3k]
  |  |  |  |  |  Branch (40:53): [True: 192, False: 33.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  288|       |
  289|  33.4k|        }
  290|  45.6k|        pi2_src++;
  291|  45.6k|        pi2_tmp += trans_size;
  292|  45.6k|        zero_cols = zero_cols >> 1;
  293|  45.6k|    }
  294|       |
  295|  11.4k|    pi2_tmp = pi2_tmp_orig;
  296|       |
  297|       |    /* Inverse Transform 2nd stage */
  298|  11.4k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|  11.4k|#define IT_SHIFT_STAGE_2 12
  ------------------
  299|  11.4k|    add = 1 << (shift - 1);
  300|       |
  301|  57.0k|    for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (301:16): [True: 45.6k, False: 11.4k]
  ------------------
  302|  45.6k|    {
  303|  45.6k|        WORD32 itrans_out;
  304|       |        /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  305|  45.6k|        o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_tmp[trans_size]
  306|  45.6k|                        + g_ai2_ihevc_trans_4[3][0] * pi2_tmp[3 * trans_size];
  307|  45.6k|        o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_tmp[trans_size]
  308|  45.6k|                        + g_ai2_ihevc_trans_4[3][1] * pi2_tmp[3 * trans_size];
  309|  45.6k|        e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_tmp[0]
  310|  45.6k|                        + g_ai2_ihevc_trans_4[2][0] * pi2_tmp[2 * trans_size];
  311|  45.6k|        e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_tmp[0]
  312|  45.6k|                        + g_ai2_ihevc_trans_4[2][1] * pi2_tmp[2 * trans_size];
  313|       |
  314|  45.6k|        itrans_out =
  315|  45.6k|                        CLIP_S16(((e[0] + o[0] + add) >> shift));
  ------------------
  |  |   53|  45.6k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  45.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 45.6k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 45.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  316|  45.6k|        pu1_dst[0] = CLIP_U8((itrans_out + pu1_pred[0]));
  ------------------
  |  |   40|  45.6k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  45.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 8.44k, False: 37.1k]
  |  |  |  |  |  Branch (40:53): [True: 7.87k, False: 29.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  317|  45.6k|        itrans_out =
  318|  45.6k|                        CLIP_S16(((e[1] + o[1] + add) >> shift));
  ------------------
  |  |   53|  45.6k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  45.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 45.6k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 45.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  319|  45.6k|        pu1_dst[1] = CLIP_U8((itrans_out + pu1_pred[1]));
  ------------------
  |  |   40|  45.6k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  45.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 6.99k, False: 38.6k]
  |  |  |  |  |  Branch (40:53): [True: 7.21k, False: 31.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  320|  45.6k|        itrans_out =
  321|  45.6k|                        CLIP_S16(((e[1] - o[1] + add) >> shift));
  ------------------
  |  |   53|  45.6k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  45.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 45.6k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 45.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  322|  45.6k|        pu1_dst[2] = CLIP_U8((itrans_out + pu1_pred[2]));
  ------------------
  |  |   40|  45.6k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  45.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 7.37k, False: 38.2k]
  |  |  |  |  |  Branch (40:53): [True: 7.32k, False: 30.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  323|  45.6k|        itrans_out =
  324|  45.6k|                        CLIP_S16(((e[0] - o[0] + add) >> shift));
  ------------------
  |  |   53|  45.6k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  45.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 45.6k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 45.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  325|  45.6k|        pu1_dst[3] = CLIP_U8((itrans_out + pu1_pred[3]));
  ------------------
  |  |   40|  45.6k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  45.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 7.46k, False: 38.1k]
  |  |  |  |  |  Branch (40:53): [True: 7.73k, False: 30.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  326|       |
  327|  45.6k|        pi2_tmp++;
  328|  45.6k|        pu1_pred += pred_strd;
  329|  45.6k|        pu1_dst += dst_strd;
  330|       |
  331|  45.6k|    }
  332|  11.4k|}

ihevc_itrans_recon_16x16:
  107|  1.55M|{
  108|  1.55M|    WORD32 j, k;
  109|  1.55M|    WORD32 e[8], o[8];
  110|  1.55M|    WORD32 ee[4], eo[4];
  111|  1.55M|    WORD32 eee[2], eeo[2];
  112|  1.55M|    WORD32 add;
  113|  1.55M|    WORD32 shift;
  114|  1.55M|    WORD16 *pi2_tmp_orig;
  115|  1.55M|    WORD32 trans_size;
  116|  1.55M|    WORD32 zero_rows_2nd_stage = zero_cols;
  117|  1.55M|    WORD32 row_limit_2nd_stage;
  118|       |
  119|  1.55M|    if((zero_cols & 0xFFF0) == 0xFFF0)
  ------------------
  |  Branch (119:8): [True: 846k, False: 705k]
  ------------------
  120|   846k|        row_limit_2nd_stage = 4;
  121|   705k|    else if((zero_cols & 0xFF00) == 0xFF00)
  ------------------
  |  Branch (121:13): [True: 506k, False: 198k]
  ------------------
  122|   506k|        row_limit_2nd_stage = 8;
  123|   198k|    else
  124|   198k|        row_limit_2nd_stage = TRANS_SIZE_16;
  ------------------
  |  |  421|   198k|#define TRANS_SIZE_16 16
  ------------------
  125|       |
  126|  1.55M|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  421|  1.55M|#define TRANS_SIZE_16 16
  ------------------
  127|  1.55M|    pi2_tmp_orig = pi2_tmp;
  128|  1.55M|    if((zero_rows & 0xFFF0) == 0xFFF0)  /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (128:8): [True: 691k, False: 861k]
  ------------------
  129|   691k|    {
  130|       |        /* Inverse Transform 1st stage */
  131|       |        /************************************************************************************************/
  132|       |        /**********************************START - IT_RECON_16x16****************************************/
  133|       |        /************************************************************************************************/
  134|       |
  135|   691k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|   691k|#define IT_SHIFT_STAGE_1 7
  ------------------
  136|   691k|        add = 1 << (shift - 1);
  137|       |
  138|  5.45M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (138:20): [True: 4.76M, False: 691k]
  ------------------
  139|  4.76M|        {
  140|       |            /* Checking for Zero Cols */
  141|  4.76M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (141:16): [True: 3.15M, False: 1.61M]
  ------------------
  142|  3.15M|            {
  143|  3.15M|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  144|  3.15M|            }
  145|  1.61M|            else
  146|  1.61M|            {
  147|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  148|  14.5M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (148:28): [True: 12.9M, False: 1.61M]
  ------------------
  149|  12.9M|                {
  150|  12.9M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  151|  12.9M|                                    + g_ai2_ihevc_trans_16[3][k]
  152|  12.9M|                                                    * pi2_src[3 * src_strd];
  153|  12.9M|                }
  154|  8.08M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (154:28): [True: 6.47M, False: 1.61M]
  ------------------
  155|  6.47M|                {
  156|  6.47M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd];
  157|  6.47M|                }
  158|  1.61M|                eeo[0] = 0;
  159|  1.61M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  160|  1.61M|                eeo[1] = 0;
  161|  1.61M|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0];
  162|       |
  163|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  164|  4.84M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (164:28): [True: 3.23M, False: 1.61M]
  ------------------
  165|  3.23M|                {
  166|  3.23M|                    ee[k] = eee[k] + eeo[k];
  167|  3.23M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  168|  3.23M|                }
  169|  8.08M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (169:28): [True: 6.46M, False: 1.61M]
  ------------------
  170|  6.46M|                {
  171|  6.46M|                    e[k] = ee[k] + eo[k];
  172|  6.46M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  173|  6.46M|                }
  174|  14.5M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (174:28): [True: 12.9M, False: 1.61M]
  ------------------
  175|  12.9M|                {
  176|  12.9M|                    pi2_tmp[k] =
  177|  12.9M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  12.9M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  12.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.36k, False: 12.9M]
  |  |  |  |  |  Branch (40:53): [True: 1.75k, False: 12.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  178|  12.9M|                    pi2_tmp[k + 8] =
  179|  12.9M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  12.9M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  12.9M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.63k, False: 12.9M]
  |  |  |  |  |  Branch (40:53): [True: 712, False: 12.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  180|  12.9M|                }
  181|  1.61M|            }
  182|  4.76M|            pi2_src++;
  183|  4.76M|            pi2_tmp += trans_size;
  184|  4.76M|            zero_cols = zero_cols >> 1;
  185|  4.76M|        }
  186|       |
  187|   691k|        pi2_tmp = pi2_tmp_orig;
  188|       |
  189|       |        /* Inverse Transform 2nd stage */
  190|   691k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|   691k|#define IT_SHIFT_STAGE_2 12
  ------------------
  191|   691k|        add = 1 << (shift - 1);
  192|       |
  193|   691k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (193:12): [True: 391k, False: 299k]
  ------------------
  194|   391k|        {
  195|  6.64M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (195:24): [True: 6.25M, False: 391k]
  ------------------
  196|  6.25M|            {
  197|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  198|  56.2M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (198:28): [True: 49.9M, False: 6.25M]
  ------------------
  199|  49.9M|                {
  200|  49.9M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  201|  49.9M|                                    + g_ai2_ihevc_trans_16[3][k]
  202|  49.9M|                                                    * pi2_tmp[3 * trans_size];
  203|  49.9M|                }
  204|  31.2M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (204:28): [True: 24.9M, False: 6.25M]
  ------------------
  205|  24.9M|                {
  206|  24.9M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  207|  24.9M|                }
  208|  6.25M|                eeo[0] = 0;
  209|  6.25M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  210|  6.25M|                eeo[1] = 0;
  211|  6.25M|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  212|       |
  213|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  214|  18.7M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (214:28): [True: 12.4M, False: 6.25M]
  ------------------
  215|  12.4M|                {
  216|  12.4M|                    ee[k] = eee[k] + eeo[k];
  217|  12.4M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  218|  12.4M|                }
  219|  31.2M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (219:28): [True: 24.9M, False: 6.25M]
  ------------------
  220|  24.9M|                {
  221|  24.9M|                    e[k] = ee[k] + eo[k];
  222|  24.9M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  223|  24.9M|                }
  224|  56.0M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (224:28): [True: 49.8M, False: 6.25M]
  ------------------
  225|  49.8M|                {
  226|  49.8M|                    WORD32 itrans_out;
  227|  49.8M|                    itrans_out =
  228|  49.8M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  49.8M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  49.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 49.8M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 49.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  229|  49.8M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  49.8M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  49.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 5.73M, False: 44.0M]
  |  |  |  |  |  Branch (40:53): [True: 2.45M, False: 41.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  230|  49.8M|                    itrans_out =
  231|  49.8M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  49.8M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  49.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 49.8M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 49.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  232|  49.8M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  49.8M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  49.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 6.01M, False: 43.8M]
  |  |  |  |  |  Branch (40:53): [True: 2.57M, False: 41.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  233|  49.8M|                }
  234|  6.25M|                pi2_tmp++;
  235|  6.25M|                pu1_pred += pred_strd;
  236|  6.25M|                pu1_dst += dst_strd;
  237|  6.25M|            }
  238|   391k|        }
  239|   299k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (239:17): [True: 198k, False: 101k]
  ------------------
  240|   198k|        {
  241|  3.35M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (241:24): [True: 3.15M, False: 198k]
  ------------------
  242|  3.15M|            {
  243|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  244|  28.3M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (244:28): [True: 25.1M, False: 3.15M]
  ------------------
  245|  25.1M|                {
  246|  25.1M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  247|  25.1M|                                    + g_ai2_ihevc_trans_16[3][k]
  248|  25.1M|                                                    * pi2_tmp[3 * trans_size]
  249|  25.1M|                                    + g_ai2_ihevc_trans_16[5][k]
  250|  25.1M|                                                    * pi2_tmp[5 * trans_size]
  251|  25.1M|                                    + g_ai2_ihevc_trans_16[7][k]
  252|  25.1M|                                                    * pi2_tmp[7 * trans_size];
  253|  25.1M|                }
  254|  15.7M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (254:28): [True: 12.6M, False: 3.15M]
  ------------------
  255|  12.6M|                {
  256|  12.6M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  257|  12.6M|                                    + g_ai2_ihevc_trans_16[6][k]
  258|  12.6M|                                                    * pi2_tmp[6 * trans_size];
  259|  12.6M|                }
  260|  3.15M|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  261|  3.15M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  262|  3.15M|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  263|  3.15M|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  264|       |
  265|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  266|  9.46M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (266:28): [True: 6.30M, False: 3.15M]
  ------------------
  267|  6.30M|                {
  268|  6.30M|                    ee[k] = eee[k] + eeo[k];
  269|  6.30M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  270|  6.30M|                }
  271|  15.7M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (271:28): [True: 12.5M, False: 3.15M]
  ------------------
  272|  12.5M|                {
  273|  12.5M|                    e[k] = ee[k] + eo[k];
  274|  12.5M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  275|  12.5M|                }
  276|  28.3M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (276:28): [True: 25.1M, False: 3.15M]
  ------------------
  277|  25.1M|                {
  278|  25.1M|                    WORD32 itrans_out;
  279|  25.1M|                    itrans_out =
  280|  25.1M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  25.1M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  25.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 25.1M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 25.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  281|  25.1M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  25.1M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  25.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 11.4M, False: 13.7M]
  |  |  |  |  |  Branch (40:53): [True: 681k, False: 13.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  282|  25.1M|                    itrans_out =
  283|  25.1M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  25.1M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  25.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 25.1M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 25.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  284|  25.1M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  25.1M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  25.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 11.2M, False: 13.8M]
  |  |  |  |  |  Branch (40:53): [True: 672k, False: 13.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  285|  25.1M|                }
  286|  3.15M|                pi2_tmp++;
  287|  3.15M|                pu1_pred += pred_strd;
  288|  3.15M|                pu1_dst += dst_strd;
  289|  3.15M|            }
  290|   198k|        }
  291|   101k|        else /* All rows of output of 1st stage are non-zero */
  292|   101k|        {
  293|  1.71M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (293:24): [True: 1.61M, False: 101k]
  ------------------
  294|  1.61M|            {
  295|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  296|  14.3M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (296:28): [True: 12.7M, False: 1.61M]
  ------------------
  297|  12.7M|                {
  298|  12.7M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  299|  12.7M|                                    + g_ai2_ihevc_trans_16[3][k]
  300|  12.7M|                                                    * pi2_tmp[3 * trans_size]
  301|  12.7M|                                    + g_ai2_ihevc_trans_16[5][k]
  302|  12.7M|                                                    * pi2_tmp[5 * trans_size]
  303|  12.7M|                                    + g_ai2_ihevc_trans_16[7][k]
  304|  12.7M|                                                    * pi2_tmp[7 * trans_size]
  305|  12.7M|                                    + g_ai2_ihevc_trans_16[9][k]
  306|  12.7M|                                                    * pi2_tmp[9 * trans_size]
  307|  12.7M|                                    + g_ai2_ihevc_trans_16[11][k]
  308|  12.7M|                                                    * pi2_tmp[11 * trans_size]
  309|  12.7M|                                    + g_ai2_ihevc_trans_16[13][k]
  310|  12.7M|                                                    * pi2_tmp[13 * trans_size]
  311|  12.7M|                                    + g_ai2_ihevc_trans_16[15][k]
  312|  12.7M|                                                    * pi2_tmp[15 * trans_size];
  313|  12.7M|                }
  314|  8.03M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (314:28): [True: 6.42M, False: 1.61M]
  ------------------
  315|  6.42M|                {
  316|  6.42M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  317|  6.42M|                                    + g_ai2_ihevc_trans_16[6][k]
  318|  6.42M|                                                    * pi2_tmp[6 * trans_size]
  319|  6.42M|                                    + g_ai2_ihevc_trans_16[10][k]
  320|  6.42M|                                                    * pi2_tmp[10 * trans_size]
  321|  6.42M|                                    + g_ai2_ihevc_trans_16[14][k]
  322|  6.42M|                                                    * pi2_tmp[14 * trans_size];
  323|  6.42M|                }
  324|  1.61M|                eeo[0] =
  325|  1.61M|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  326|  1.61M|                                                + g_ai2_ihevc_trans_16[12][0]
  327|  1.61M|                                                                * pi2_tmp[12
  328|  1.61M|                                                                                * trans_size];
  329|  1.61M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  330|  1.61M|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  331|  1.61M|                eeo[1] =
  332|  1.61M|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  333|  1.61M|                                                + g_ai2_ihevc_trans_16[12][1]
  334|  1.61M|                                                                * pi2_tmp[12
  335|  1.61M|                                                                                * trans_size];
  336|  1.61M|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  337|  1.61M|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  338|       |
  339|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  340|  4.82M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (340:28): [True: 3.21M, False: 1.61M]
  ------------------
  341|  3.21M|                {
  342|  3.21M|                    ee[k] = eee[k] + eeo[k];
  343|  3.21M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  344|  3.21M|                }
  345|  8.05M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (345:28): [True: 6.43M, False: 1.61M]
  ------------------
  346|  6.43M|                {
  347|  6.43M|                    e[k] = ee[k] + eo[k];
  348|  6.43M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  349|  6.43M|                }
  350|  14.3M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (350:28): [True: 12.7M, False: 1.61M]
  ------------------
  351|  12.7M|                {
  352|  12.7M|                    WORD32 itrans_out;
  353|  12.7M|                    itrans_out =
  354|  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  355|  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: 3.22M, False: 9.55M]
  |  |  |  |  |  Branch (40:53): [True: 470k, False: 9.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  356|  12.7M|                    itrans_out =
  357|  12.7M|                                    CLIP_S16(((e[7 - k] - o[7 - 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  358|  12.7M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   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: 2.58M, False: 10.2M]
  |  |  |  |  |  Branch (40:53): [True: 448k, False: 9.75M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  359|  12.7M|                }
  360|  1.61M|                pi2_tmp++;
  361|  1.61M|                pu1_pred += pred_strd;
  362|  1.61M|                pu1_dst += dst_strd;
  363|  1.61M|            }
  364|   101k|        }
  365|       |        /************************************************************************************************/
  366|       |        /************************************END - IT_RECON_16x16****************************************/
  367|       |        /************************************************************************************************/
  368|   691k|    }
  369|   861k|    else if((zero_rows & 0xFF00) == 0xFF00)  /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (369:13): [True: 365k, False: 495k]
  ------------------
  370|   365k|    {
  371|       |        /* Inverse Transform 1st stage */
  372|       |        /************************************************************************************************/
  373|       |        /**********************************START - IT_RECON_16x16****************************************/
  374|       |        /************************************************************************************************/
  375|       |
  376|   365k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|   365k|#define IT_SHIFT_STAGE_1 7
  ------------------
  377|   365k|        add = 1 << (shift - 1);
  378|       |
  379|  2.46M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (379:20): [True: 2.10M, False: 365k]
  ------------------
  380|  2.10M|        {
  381|       |            /* Checking for Zero Cols */
  382|  2.10M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (382:16): [True: 1.24M, False: 853k]
  ------------------
  383|  1.24M|            {
  384|  1.24M|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  385|  1.24M|            }
  386|   853k|            else
  387|   853k|            {
  388|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  389|  7.68M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (389:28): [True: 6.83M, False: 853k]
  ------------------
  390|  6.83M|                {
  391|  6.83M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  392|  6.83M|                                    + g_ai2_ihevc_trans_16[3][k]
  393|  6.83M|                                                    * pi2_src[3 * src_strd]
  394|  6.83M|                                    + g_ai2_ihevc_trans_16[5][k]
  395|  6.83M|                                                    * pi2_src[5 * src_strd]
  396|  6.83M|                                    + g_ai2_ihevc_trans_16[7][k]
  397|  6.83M|                                                    * pi2_src[7 * src_strd];
  398|  6.83M|                }
  399|  4.27M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (399:28): [True: 3.41M, False: 853k]
  ------------------
  400|  3.41M|                {
  401|  3.41M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  402|  3.41M|                                    + g_ai2_ihevc_trans_16[6][k]
  403|  3.41M|                                                    * pi2_src[6 * src_strd];
  404|  3.41M|                }
  405|   853k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd];
  406|   853k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0];
  407|   853k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd];
  408|   853k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0];
  409|       |
  410|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  411|  2.56M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (411:28): [True: 1.70M, False: 853k]
  ------------------
  412|  1.70M|                {
  413|  1.70M|                    ee[k] = eee[k] + eeo[k];
  414|  1.70M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  415|  1.70M|                }
  416|  4.27M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (416:28): [True: 3.41M, False: 853k]
  ------------------
  417|  3.41M|                {
  418|  3.41M|                    e[k] = ee[k] + eo[k];
  419|  3.41M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  420|  3.41M|                }
  421|  7.68M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (421:28): [True: 6.83M, False: 853k]
  ------------------
  422|  6.83M|                {
  423|  6.83M|                    pi2_tmp[k] =
  424|  6.83M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  6.83M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.83M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.14k, False: 6.83M]
  |  |  |  |  |  Branch (40:53): [True: 2.04k, False: 6.82M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  425|  6.83M|                    pi2_tmp[k + 8] =
  426|  6.83M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  6.83M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  6.83M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.13k, False: 6.83M]
  |  |  |  |  |  Branch (40:53): [True: 1.97k, False: 6.82M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  427|  6.83M|                }
  428|   853k|            }
  429|  2.10M|            pi2_src++;
  430|  2.10M|            pi2_tmp += trans_size;
  431|  2.10M|            zero_cols = zero_cols >> 1;
  432|  2.10M|        }
  433|       |
  434|   365k|        pi2_tmp = pi2_tmp_orig;
  435|       |
  436|       |        /* Inverse Transform 2nd stage */
  437|   365k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|   365k|#define IT_SHIFT_STAGE_2 12
  ------------------
  438|   365k|        add = 1 << (shift - 1);
  439|       |
  440|   365k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (440:12): [True: 272k, False: 93.0k]
  ------------------
  441|   272k|        {
  442|  4.62M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (442:24): [True: 4.34M, False: 272k]
  ------------------
  443|  4.34M|            {
  444|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  445|  39.1M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (445:28): [True: 34.7M, False: 4.34M]
  ------------------
  446|  34.7M|                {
  447|  34.7M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  448|  34.7M|                                    + g_ai2_ihevc_trans_16[3][k]
  449|  34.7M|                                                    * pi2_tmp[3 * trans_size];
  450|  34.7M|                }
  451|  21.7M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (451:28): [True: 17.3M, False: 4.34M]
  ------------------
  452|  17.3M|                {
  453|  17.3M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  454|  17.3M|                }
  455|  4.34M|                eeo[0] = 0;
  456|  4.34M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  457|  4.34M|                eeo[1] = 0;
  458|  4.34M|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  459|       |
  460|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  461|  13.0M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (461:28): [True: 8.68M, False: 4.34M]
  ------------------
  462|  8.68M|                {
  463|  8.68M|                    ee[k] = eee[k] + eeo[k];
  464|  8.68M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  465|  8.68M|                }
  466|  21.7M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (466:28): [True: 17.3M, False: 4.34M]
  ------------------
  467|  17.3M|                {
  468|  17.3M|                    e[k] = ee[k] + eo[k];
  469|  17.3M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  470|  17.3M|                }
  471|  38.9M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (471:28): [True: 34.6M, False: 4.34M]
  ------------------
  472|  34.6M|                {
  473|  34.6M|                    WORD32 itrans_out;
  474|  34.6M|                    itrans_out =
  475|  34.6M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  34.6M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  34.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 34.6M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 34.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  476|  34.6M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  34.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  34.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 9.48M, False: 25.1M]
  |  |  |  |  |  Branch (40:53): [True: 1.46M, False: 23.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  477|  34.6M|                    itrans_out =
  478|  34.6M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  34.6M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  34.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 34.6M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 34.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  479|  34.6M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  34.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  34.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 9.04M, False: 25.5M]
  |  |  |  |  |  Branch (40:53): [True: 1.50M, False: 24.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  480|  34.6M|                }
  481|  4.34M|                pi2_tmp++;
  482|  4.34M|                pu1_pred += pred_strd;
  483|  4.34M|                pu1_dst += dst_strd;
  484|  4.34M|            }
  485|   272k|        }
  486|  93.0k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (486:17): [True: 59.5k, False: 33.5k]
  ------------------
  487|  59.5k|        {
  488|  1.00M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (488:24): [True: 950k, False: 59.5k]
  ------------------
  489|   950k|            {
  490|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  491|  8.53M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (491:28): [True: 7.58M, False: 950k]
  ------------------
  492|  7.58M|                {
  493|  7.58M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  494|  7.58M|                                    + g_ai2_ihevc_trans_16[3][k]
  495|  7.58M|                                                    * pi2_tmp[3 * trans_size]
  496|  7.58M|                                    + g_ai2_ihevc_trans_16[5][k]
  497|  7.58M|                                                    * pi2_tmp[5 * trans_size]
  498|  7.58M|                                    + g_ai2_ihevc_trans_16[7][k]
  499|  7.58M|                                                    * pi2_tmp[7 * trans_size];
  500|  7.58M|                }
  501|  4.74M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (501:28): [True: 3.79M, False: 950k]
  ------------------
  502|  3.79M|                {
  503|  3.79M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  504|  3.79M|                                    + g_ai2_ihevc_trans_16[6][k]
  505|  3.79M|                                                    * pi2_tmp[6 * trans_size];
  506|  3.79M|                }
  507|   950k|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  508|   950k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  509|   950k|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  510|   950k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  511|       |
  512|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  513|  2.84M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (513:28): [True: 1.89M, False: 950k]
  ------------------
  514|  1.89M|                {
  515|  1.89M|                    ee[k] = eee[k] + eeo[k];
  516|  1.89M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  517|  1.89M|                }
  518|  4.74M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (518:28): [True: 3.79M, False: 950k]
  ------------------
  519|  3.79M|                {
  520|  3.79M|                    e[k] = ee[k] + eo[k];
  521|  3.79M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  522|  3.79M|                }
  523|  8.54M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (523:28): [True: 7.59M, False: 950k]
  ------------------
  524|  7.59M|                {
  525|  7.59M|                    WORD32 itrans_out;
  526|  7.59M|                    itrans_out =
  527|  7.59M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  7.59M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.59M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 7.59M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 7.59M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  528|  7.59M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  7.59M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.59M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.80M, False: 3.78M]
  |  |  |  |  |  Branch (40:53): [True: 427k, False: 3.35M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  529|  7.59M|                    itrans_out =
  530|  7.59M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  7.59M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  7.59M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 7.59M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 7.59M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  531|  7.59M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  7.59M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  7.59M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.78M, False: 3.80M]
  |  |  |  |  |  Branch (40:53): [True: 450k, False: 3.35M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  532|  7.59M|                }
  533|   950k|                pi2_tmp++;
  534|   950k|                pu1_pred += pred_strd;
  535|   950k|                pu1_dst += dst_strd;
  536|   950k|            }
  537|  59.5k|        }
  538|  33.5k|        else /* All rows of output of 1st stage are non-zero */
  539|  33.5k|        {
  540|   568k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (540:24): [True: 534k, False: 33.5k]
  ------------------
  541|   534k|            {
  542|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  543|  4.76M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (543:28): [True: 4.22M, False: 534k]
  ------------------
  544|  4.22M|                {
  545|  4.22M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  546|  4.22M|                                    + g_ai2_ihevc_trans_16[3][k]
  547|  4.22M|                                                    * pi2_tmp[3 * trans_size]
  548|  4.22M|                                    + g_ai2_ihevc_trans_16[5][k]
  549|  4.22M|                                                    * pi2_tmp[5 * trans_size]
  550|  4.22M|                                    + g_ai2_ihevc_trans_16[7][k]
  551|  4.22M|                                                    * pi2_tmp[7 * trans_size]
  552|  4.22M|                                    + g_ai2_ihevc_trans_16[9][k]
  553|  4.22M|                                                    * pi2_tmp[9 * trans_size]
  554|  4.22M|                                    + g_ai2_ihevc_trans_16[11][k]
  555|  4.22M|                                                    * pi2_tmp[11 * trans_size]
  556|  4.22M|                                    + g_ai2_ihevc_trans_16[13][k]
  557|  4.22M|                                                    * pi2_tmp[13 * trans_size]
  558|  4.22M|                                    + g_ai2_ihevc_trans_16[15][k]
  559|  4.22M|                                                    * pi2_tmp[15 * trans_size];
  560|  4.22M|                }
  561|  2.66M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (561:28): [True: 2.12M, False: 534k]
  ------------------
  562|  2.12M|                {
  563|  2.12M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  564|  2.12M|                                    + g_ai2_ihevc_trans_16[6][k]
  565|  2.12M|                                                    * pi2_tmp[6 * trans_size]
  566|  2.12M|                                    + g_ai2_ihevc_trans_16[10][k]
  567|  2.12M|                                                    * pi2_tmp[10 * trans_size]
  568|  2.12M|                                    + g_ai2_ihevc_trans_16[14][k]
  569|  2.12M|                                                    * pi2_tmp[14 * trans_size];
  570|  2.12M|                }
  571|   534k|                eeo[0] =
  572|   534k|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  573|   534k|                                                + g_ai2_ihevc_trans_16[12][0]
  574|   534k|                                                                * pi2_tmp[12
  575|   534k|                                                                                * trans_size];
  576|   534k|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  577|   534k|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  578|   534k|                eeo[1] =
  579|   534k|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  580|   534k|                                                + g_ai2_ihevc_trans_16[12][1]
  581|   534k|                                                                * pi2_tmp[12
  582|   534k|                                                                                * trans_size];
  583|   534k|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  584|   534k|                                + 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|  1.59M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (587:28): [True: 1.06M, False: 534k]
  ------------------
  588|  1.06M|                {
  589|  1.06M|                    ee[k] = eee[k] + eeo[k];
  590|  1.06M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  591|  1.06M|                }
  592|  2.66M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (592:28): [True: 2.13M, False: 534k]
  ------------------
  593|  2.13M|                {
  594|  2.13M|                    e[k] = ee[k] + eo[k];
  595|  2.13M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  596|  2.13M|                }
  597|  4.77M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (597:28): [True: 4.24M, False: 534k]
  ------------------
  598|  4.24M|                {
  599|  4.24M|                    WORD32 itrans_out;
  600|  4.24M|                    itrans_out =
  601|  4.24M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  4.24M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.24M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.24M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.24M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  602|  4.24M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  4.24M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.24M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.03M, False: 3.20M]
  |  |  |  |  |  Branch (40:53): [True: 117k, False: 3.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  603|  4.24M|                    itrans_out =
  604|  4.24M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  4.24M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  4.24M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 4.24M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 4.24M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  605|  4.24M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  4.24M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  4.24M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 989k, False: 3.25M]
  |  |  |  |  |  Branch (40:53): [True: 120k, False: 3.13M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  606|  4.24M|                }
  607|   534k|                pi2_tmp++;
  608|   534k|                pu1_pred += pred_strd;
  609|   534k|                pu1_dst += dst_strd;
  610|   534k|            }
  611|  33.5k|        }
  612|       |        /************************************************************************************************/
  613|       |        /************************************END - IT_RECON_16x16****************************************/
  614|       |        /************************************************************************************************/
  615|   365k|    }
  616|   495k|    else  /* All rows of input are non-zero */
  617|   495k|    {
  618|       |        /* Inverse Transform 1st stage */
  619|       |        /************************************************************************************************/
  620|       |        /**********************************START - IT_RECON_16x16****************************************/
  621|       |        /************************************************************************************************/
  622|       |
  623|   495k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|   495k|#define IT_SHIFT_STAGE_1 7
  ------------------
  624|   495k|        add = 1 << (shift - 1);
  625|       |
  626|  4.23M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (626:20): [True: 3.74M, False: 495k]
  ------------------
  627|  3.74M|        {
  628|       |            /* Checking for Zero Cols */
  629|  3.74M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (629:16): [True: 2.31M, False: 1.42M]
  ------------------
  630|  2.31M|            {
  631|  2.31M|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  632|  2.31M|            }
  633|  1.42M|            else
  634|  1.42M|            {
  635|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  636|  12.8M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (636:28): [True: 11.4M, False: 1.42M]
  ------------------
  637|  11.4M|                {
  638|  11.4M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd]
  639|  11.4M|                                    + g_ai2_ihevc_trans_16[3][k]
  640|  11.4M|                                                    * pi2_src[3 * src_strd]
  641|  11.4M|                                    + g_ai2_ihevc_trans_16[5][k]
  642|  11.4M|                                                    * pi2_src[5 * src_strd]
  643|  11.4M|                                    + g_ai2_ihevc_trans_16[7][k]
  644|  11.4M|                                                    * pi2_src[7 * src_strd]
  645|  11.4M|                                    + g_ai2_ihevc_trans_16[9][k]
  646|  11.4M|                                                    * pi2_src[9 * src_strd]
  647|  11.4M|                                    + g_ai2_ihevc_trans_16[11][k]
  648|  11.4M|                                                    * pi2_src[11 * src_strd]
  649|  11.4M|                                    + g_ai2_ihevc_trans_16[13][k]
  650|  11.4M|                                                    * pi2_src[13 * src_strd]
  651|  11.4M|                                    + g_ai2_ihevc_trans_16[15][k]
  652|  11.4M|                                                    * pi2_src[15 * src_strd];
  653|  11.4M|                }
  654|  7.15M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (654:28): [True: 5.72M, False: 1.42M]
  ------------------
  655|  5.72M|                {
  656|  5.72M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]
  657|  5.72M|                                    + g_ai2_ihevc_trans_16[6][k]
  658|  5.72M|                                                    * pi2_src[6 * src_strd]
  659|  5.72M|                                    + g_ai2_ihevc_trans_16[10][k]
  660|  5.72M|                                                    * pi2_src[10 * src_strd]
  661|  5.72M|                                    + g_ai2_ihevc_trans_16[14][k]
  662|  5.72M|                                                    * pi2_src[14 * src_strd];
  663|  5.72M|                }
  664|  1.42M|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd]
  665|  1.42M|                                + g_ai2_ihevc_trans_16[12][0]
  666|  1.42M|                                                * pi2_src[12 * src_strd];
  667|  1.42M|                eee[0] =
  668|  1.42M|                                g_ai2_ihevc_trans_16[0][0] * pi2_src[0]
  669|  1.42M|                                                + g_ai2_ihevc_trans_16[8][0]
  670|  1.42M|                                                                * pi2_src[8
  671|  1.42M|                                                                                * src_strd];
  672|  1.42M|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd]
  673|  1.42M|                                + g_ai2_ihevc_trans_16[12][1]
  674|  1.42M|                                                * pi2_src[12 * src_strd];
  675|  1.42M|                eee[1] =
  676|  1.42M|                                g_ai2_ihevc_trans_16[0][1] * pi2_src[0]
  677|  1.42M|                                                + g_ai2_ihevc_trans_16[8][1]
  678|  1.42M|                                                                * pi2_src[8
  679|  1.42M|                                                                                * src_strd];
  680|       |
  681|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  682|  4.28M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (682:28): [True: 2.85M, False: 1.42M]
  ------------------
  683|  2.85M|                {
  684|  2.85M|                    ee[k] = eee[k] + eeo[k];
  685|  2.85M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  686|  2.85M|                }
  687|  7.15M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (687:28): [True: 5.72M, False: 1.42M]
  ------------------
  688|  5.72M|                {
  689|  5.72M|                    e[k] = ee[k] + eo[k];
  690|  5.72M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  691|  5.72M|                }
  692|  12.8M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (692:28): [True: 11.4M, False: 1.42M]
  ------------------
  693|  11.4M|                {
  694|  11.4M|                    pi2_tmp[k] =
  695|  11.4M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  11.4M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  11.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.55k, False: 11.4M]
  |  |  |  |  |  Branch (40:53): [True: 4.44k, False: 11.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  696|  11.4M|                    pi2_tmp[k + 8] =
  697|  11.4M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  11.4M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  11.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.07k, False: 11.4M]
  |  |  |  |  |  Branch (40:53): [True: 2.86k, False: 11.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  698|  11.4M|                }
  699|  1.42M|            }
  700|  3.74M|            pi2_src++;
  701|  3.74M|            pi2_tmp += trans_size;
  702|  3.74M|            zero_cols = zero_cols >> 1;
  703|  3.74M|        }
  704|       |
  705|   495k|        pi2_tmp = pi2_tmp_orig;
  706|       |
  707|       |        /* Inverse Transform 2nd stage */
  708|   495k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|   495k|#define IT_SHIFT_STAGE_2 12
  ------------------
  709|   495k|        add = 1 << (shift - 1);
  710|       |
  711|   495k|        if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (711:12): [True: 182k, False: 312k]
  ------------------
  712|   182k|        {
  713|  3.09M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (713:24): [True: 2.90M, False: 182k]
  ------------------
  714|  2.90M|            {
  715|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  716|  26.1M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (716:28): [True: 23.2M, False: 2.90M]
  ------------------
  717|  23.2M|                {
  718|  23.2M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  719|  23.2M|                                    + g_ai2_ihevc_trans_16[3][k]
  720|  23.2M|                                                    * pi2_tmp[3 * trans_size];
  721|  23.2M|                }
  722|  14.5M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (722:28): [True: 11.6M, False: 2.90M]
  ------------------
  723|  11.6M|                {
  724|  11.6M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size];
  725|  11.6M|                }
  726|  2.90M|                eeo[0] = 0;
  727|  2.90M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  728|  2.90M|                eeo[1] = 0;
  729|  2.90M|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  730|       |
  731|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  732|  8.71M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (732:28): [True: 5.80M, False: 2.90M]
  ------------------
  733|  5.80M|                {
  734|  5.80M|                    ee[k] = eee[k] + eeo[k];
  735|  5.80M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  736|  5.80M|                }
  737|  14.5M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (737:28): [True: 11.5M, False: 2.90M]
  ------------------
  738|  11.5M|                {
  739|  11.5M|                    e[k] = ee[k] + eo[k];
  740|  11.5M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  741|  11.5M|                }
  742|  26.0M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (742:28): [True: 23.1M, False: 2.90M]
  ------------------
  743|  23.1M|                {
  744|  23.1M|                    WORD32 itrans_out;
  745|  23.1M|                    itrans_out =
  746|  23.1M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  23.1M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  23.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 23.1M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 23.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  747|  23.1M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  23.1M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  23.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 8.22M, False: 14.8M]
  |  |  |  |  |  Branch (40:53): [True: 1.45M, False: 13.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  748|  23.1M|                    itrans_out =
  749|  23.1M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  23.1M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  23.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 23.1M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 23.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  750|  23.1M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  23.1M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  23.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 7.50M, False: 15.5M]
  |  |  |  |  |  Branch (40:53): [True: 1.37M, False: 14.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  751|  23.1M|                }
  752|  2.90M|                pi2_tmp++;
  753|  2.90M|                pu1_pred += pred_strd;
  754|  2.90M|                pu1_dst += dst_strd;
  755|  2.90M|            }
  756|   182k|        }
  757|   312k|        else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (757:17): [True: 249k, False: 63.6k]
  ------------------
  758|   249k|        {
  759|  4.21M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (759:24): [True: 3.96M, False: 249k]
  ------------------
  760|  3.96M|            {
  761|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  762|  35.4M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (762:28): [True: 31.4M, False: 3.96M]
  ------------------
  763|  31.4M|                {
  764|  31.4M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  765|  31.4M|                                    + g_ai2_ihevc_trans_16[3][k]
  766|  31.4M|                                                    * pi2_tmp[3 * trans_size]
  767|  31.4M|                                    + g_ai2_ihevc_trans_16[5][k]
  768|  31.4M|                                                    * pi2_tmp[5 * trans_size]
  769|  31.4M|                                    + g_ai2_ihevc_trans_16[7][k]
  770|  31.4M|                                                    * pi2_tmp[7 * trans_size];
  771|  31.4M|                }
  772|  19.7M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (772:28): [True: 15.7M, False: 3.96M]
  ------------------
  773|  15.7M|                {
  774|  15.7M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  775|  15.7M|                                    + g_ai2_ihevc_trans_16[6][k]
  776|  15.7M|                                                    * pi2_tmp[6 * trans_size];
  777|  15.7M|                }
  778|  3.96M|                eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size];
  779|  3.96M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0];
  780|  3.96M|                eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size];
  781|  3.96M|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0];
  782|       |
  783|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  784|  11.8M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (784:28): [True: 7.86M, False: 3.96M]
  ------------------
  785|  7.86M|                {
  786|  7.86M|                    ee[k] = eee[k] + eeo[k];
  787|  7.86M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  788|  7.86M|                }
  789|  19.7M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (789:28): [True: 15.7M, False: 3.96M]
  ------------------
  790|  15.7M|                {
  791|  15.7M|                    e[k] = ee[k] + eo[k];
  792|  15.7M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  793|  15.7M|                }
  794|  35.3M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (794:28): [True: 31.3M, False: 3.96M]
  ------------------
  795|  31.3M|                {
  796|  31.3M|                    WORD32 itrans_out;
  797|  31.3M|                    itrans_out =
  798|  31.3M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  31.3M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  31.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 31.3M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 31.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  799|  31.3M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  31.3M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  31.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 7.87M, False: 23.5M]
  |  |  |  |  |  Branch (40:53): [True: 705k, False: 22.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  800|  31.3M|                    itrans_out =
  801|  31.3M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  31.3M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  31.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 31.3M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 31.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  802|  31.3M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  31.3M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  31.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 8.85M, False: 22.5M]
  |  |  |  |  |  Branch (40:53): [True: 701k, False: 21.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  803|  31.3M|                }
  804|  3.96M|                pi2_tmp++;
  805|  3.96M|                pu1_pred += pred_strd;
  806|  3.96M|                pu1_dst += dst_strd;
  807|  3.96M|            }
  808|   249k|        }
  809|  63.6k|        else /* All rows of output of 1st stage are non-zero */
  810|  63.6k|        {
  811|  1.08M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (811:24): [True: 1.01M, False: 63.6k]
  ------------------
  812|  1.01M|            {
  813|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  814|  9.08M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (814:28): [True: 8.06M, False: 1.01M]
  ------------------
  815|  8.06M|                {
  816|  8.06M|                    o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size]
  817|  8.06M|                                    + g_ai2_ihevc_trans_16[3][k]
  818|  8.06M|                                                    * pi2_tmp[3 * trans_size]
  819|  8.06M|                                    + g_ai2_ihevc_trans_16[5][k]
  820|  8.06M|                                                    * pi2_tmp[5 * trans_size]
  821|  8.06M|                                    + g_ai2_ihevc_trans_16[7][k]
  822|  8.06M|                                                    * pi2_tmp[7 * trans_size]
  823|  8.06M|                                    + g_ai2_ihevc_trans_16[9][k]
  824|  8.06M|                                                    * pi2_tmp[9 * trans_size]
  825|  8.06M|                                    + g_ai2_ihevc_trans_16[11][k]
  826|  8.06M|                                                    * pi2_tmp[11 * trans_size]
  827|  8.06M|                                    + g_ai2_ihevc_trans_16[13][k]
  828|  8.06M|                                                    * pi2_tmp[13 * trans_size]
  829|  8.06M|                                    + g_ai2_ihevc_trans_16[15][k]
  830|  8.06M|                                                    * pi2_tmp[15 * trans_size];
  831|  8.06M|                }
  832|  5.07M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (832:28): [True: 4.05M, False: 1.01M]
  ------------------
  833|  4.05M|                {
  834|  4.05M|                    eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]
  835|  4.05M|                                    + g_ai2_ihevc_trans_16[6][k]
  836|  4.05M|                                                    * pi2_tmp[6 * trans_size]
  837|  4.05M|                                    + g_ai2_ihevc_trans_16[10][k]
  838|  4.05M|                                                    * pi2_tmp[10 * trans_size]
  839|  4.05M|                                    + g_ai2_ihevc_trans_16[14][k]
  840|  4.05M|                                                    * pi2_tmp[14 * trans_size];
  841|  4.05M|                }
  842|  1.01M|                eeo[0] =
  843|  1.01M|                                g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]
  844|  1.01M|                                                + g_ai2_ihevc_trans_16[12][0]
  845|  1.01M|                                                                * pi2_tmp[12
  846|  1.01M|                                                                                * trans_size];
  847|  1.01M|                eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]
  848|  1.01M|                                + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size];
  849|  1.01M|                eeo[1] =
  850|  1.01M|                                g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]
  851|  1.01M|                                                + g_ai2_ihevc_trans_16[12][1]
  852|  1.01M|                                                                * pi2_tmp[12
  853|  1.01M|                                                                                * trans_size];
  854|  1.01M|                eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]
  855|  1.01M|                                + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size];
  856|       |
  857|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  858|  3.04M|                for(k = 0; k < 2; k++)
  ------------------
  |  Branch (858:28): [True: 2.02M, False: 1.01M]
  ------------------
  859|  2.02M|                {
  860|  2.02M|                    ee[k] = eee[k] + eeo[k];
  861|  2.02M|                    ee[k + 2] = eee[1 - k] - eeo[1 - k];
  862|  2.02M|                }
  863|  5.07M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (863:28): [True: 4.05M, False: 1.01M]
  ------------------
  864|  4.05M|                {
  865|  4.05M|                    e[k] = ee[k] + eo[k];
  866|  4.05M|                    e[k + 4] = ee[3 - k] - eo[3 - k];
  867|  4.05M|                }
  868|  9.10M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (868:28): [True: 8.09M, False: 1.01M]
  ------------------
  869|  8.09M|                {
  870|  8.09M|                    WORD32 itrans_out;
  871|  8.09M|                    itrans_out =
  872|  8.09M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  8.09M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.09M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.09M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  873|  8.09M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  8.09M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.09M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.00M, False: 6.08M]
  |  |  |  |  |  Branch (40:53): [True: 383k, False: 5.70M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  874|  8.09M|                    itrans_out =
  875|  8.09M|                                    CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift));
  ------------------
  |  |   53|  8.09M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.09M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.09M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  876|  8.09M|                    pu1_dst[k + 8] = CLIP_U8((itrans_out + pu1_pred[k + 8]));
  ------------------
  |  |   40|  8.09M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.09M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.94M, False: 6.14M]
  |  |  |  |  |  Branch (40:53): [True: 356k, False: 5.79M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  877|  8.09M|                }
  878|  1.01M|                pi2_tmp++;
  879|  1.01M|                pu1_pred += pred_strd;
  880|  1.01M|                pu1_dst += dst_strd;
  881|  1.01M|            }
  882|  63.6k|        }
  883|       |        /************************************************************************************************/
  884|       |        /************************************END - IT_RECON_16x16****************************************/
  885|       |        /************************************************************************************************/
  886|   495k|    }
  887|       |
  888|  1.55M|}

ihevc_itrans_recon_32x32:
  108|  1.23M|{
  109|  1.23M|    WORD32 j, k;
  110|  1.23M|    WORD32 e[16], o[16];
  111|  1.23M|    WORD32 ee[8], eo[8];
  112|  1.23M|    WORD32 eee[4], eeo[4];
  113|  1.23M|    WORD32 eeee[2], eeeo[2];
  114|  1.23M|    WORD32 add;
  115|  1.23M|    WORD32 shift;
  116|  1.23M|    WORD16 *pi2_tmp_orig;
  117|  1.23M|    WORD32 trans_size;
  118|  1.23M|    WORD32 zero_rows_2nd_stage = zero_cols;
  119|  1.23M|    WORD32 row_limit_2nd_stage;
  120|       |
  121|  1.23M|    trans_size = TRANS_SIZE_32;
  ------------------
  |  |  422|  1.23M|#define TRANS_SIZE_32 32
  ------------------
  122|  1.23M|    pi2_tmp_orig = pi2_tmp;
  123|       |
  124|  1.23M|    if((zero_cols & 0xFFFFFFF0) == 0xFFFFFFF0)
  ------------------
  |  Branch (124:8): [True: 496k, False: 736k]
  ------------------
  125|   496k|        row_limit_2nd_stage = 4;
  126|   736k|    else if((zero_cols & 0xFFFFFF00) == 0xFFFFFF00)
  ------------------
  |  Branch (126:13): [True: 221k, False: 515k]
  ------------------
  127|   221k|        row_limit_2nd_stage = 8;
  128|   515k|    else
  129|   515k|        row_limit_2nd_stage = TRANS_SIZE_32;
  ------------------
  |  |  422|   515k|#define TRANS_SIZE_32 32
  ------------------
  130|       |
  131|  1.23M|    if((zero_rows & 0xFFFFFFF0) == 0xFFFFFFF0)  /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (131:8): [True: 537k, False: 696k]
  ------------------
  132|   537k|    {
  133|       |        /************************************************************************************************/
  134|       |        /**********************************START - IT_RECON_32x32****************************************/
  135|       |        /************************************************************************************************/
  136|       |        /* Inverse Transform 1st stage */
  137|   537k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|   537k|#define IT_SHIFT_STAGE_1 7
  ------------------
  138|   537k|        add = 1 << (shift - 1);
  139|       |
  140|  8.00M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (140:20): [True: 7.46M, False: 537k]
  ------------------
  141|  7.46M|        {
  142|       |            /* Checking for Zero Cols */
  143|  7.46M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (143:16): [True: 5.44M, False: 2.02M]
  ------------------
  144|  5.44M|            {
  145|  5.44M|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  146|  5.44M|            }
  147|  2.02M|            else
  148|  2.02M|            {
  149|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  150|  34.3M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (150:28): [True: 32.3M, False: 2.02M]
  ------------------
  151|  32.3M|                {
  152|  32.3M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
  153|  32.3M|                                    + g_ai2_ihevc_trans_32[3][k]
  154|  32.3M|                                                    * pi2_src[3 * src_strd];
  155|  32.3M|                }
  156|  18.2M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (156:28): [True: 16.1M, False: 2.02M]
  ------------------
  157|  16.1M|                {
  158|  16.1M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd];
  159|  16.1M|                }
  160|       |//                for(k = 0; k < 4; k++)
  161|  2.02M|                {
  162|  2.02M|                    eeo[0] = 0;
  163|  2.02M|                    eeo[1] = 0;
  164|  2.02M|                    eeo[2] = 0;
  165|  2.02M|                    eeo[3] = 0;
  166|  2.02M|                }
  167|  2.02M|                eeeo[0] = 0;
  168|  2.02M|                eeeo[1] = 0;
  169|  2.02M|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0];
  170|  2.02M|                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|  2.02M|                eee[0] = eeee[0] + eeeo[0];
  174|  2.02M|                eee[3] = eeee[0] - eeeo[0];
  175|  2.02M|                eee[1] = eeee[1] + eeeo[1];
  176|  2.02M|                eee[2] = eeee[1] - eeeo[1];
  177|  10.1M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (177:28): [True: 8.09M, False: 2.02M]
  ------------------
  178|  8.09M|                {
  179|  8.09M|                    ee[k] = eee[k] + eeo[k];
  180|  8.09M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  181|  8.09M|                }
  182|  18.2M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (182:28): [True: 16.1M, False: 2.02M]
  ------------------
  183|  16.1M|                {
  184|  16.1M|                    e[k] = ee[k] + eo[k];
  185|  16.1M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  186|  16.1M|                }
  187|  34.3M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (187:28): [True: 32.3M, False: 2.02M]
  ------------------
  188|  32.3M|                {
  189|  32.3M|                    pi2_tmp[k] =
  190|  32.3M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  32.3M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  32.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 351, False: 32.3M]
  |  |  |  |  |  Branch (40:53): [True: 313, False: 32.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|  32.3M|                    pi2_tmp[k + 16] =
  192|  32.3M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  32.3M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  32.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 257, False: 32.3M]
  |  |  |  |  |  Branch (40:53): [True: 182, False: 32.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|  32.3M|                }
  194|  2.02M|            }
  195|  7.46M|            pi2_src++;
  196|  7.46M|            pi2_tmp += trans_size;
  197|  7.46M|            zero_cols = zero_cols >> 1;
  198|  7.46M|        }
  199|       |
  200|   537k|        pi2_tmp = pi2_tmp_orig;
  201|       |
  202|       |        /* Inverse Transform 2nd stage */
  203|   537k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|   537k|#define IT_SHIFT_STAGE_2 12
  ------------------
  204|   537k|        add = 1 << (shift - 1);
  205|   537k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (205:12): [True: 233k, False: 303k]
  ------------------
  206|   233k|        {
  207|  7.67M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (207:24): [True: 7.44M, False: 233k]
  ------------------
  208|  7.44M|            {
  209|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  210|   125M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (210:28): [True: 118M, False: 7.44M]
  ------------------
  211|   118M|                {
  212|   118M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  213|   118M|                                    + g_ai2_ihevc_trans_32[3][k]
  214|   118M|                                                    * pi2_tmp[3 * trans_size];
  215|   118M|                }
  216|  66.8M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (216:28): [True: 59.3M, False: 7.44M]
  ------------------
  217|  59.3M|                {
  218|  59.3M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
  219|  59.3M|                }
  220|       |//                for(k = 0; k < 4; k++)
  221|  7.44M|                {
  222|  7.44M|                    eeo[0] = 0;
  223|  7.44M|                    eeo[1] = 0;
  224|  7.44M|                    eeo[2] = 0;
  225|  7.44M|                    eeo[3] = 0;
  226|  7.44M|                }
  227|  7.44M|                eeeo[0] = 0;
  228|  7.44M|                eeeo[1] = 0;
  229|  7.44M|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  230|  7.44M|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  231|       |
  232|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  233|  7.44M|                eee[0] = eeee[0] + eeeo[0];
  234|  7.44M|                eee[3] = eeee[0] - eeeo[0];
  235|  7.44M|                eee[1] = eeee[1] + eeeo[1];
  236|  7.44M|                eee[2] = eeee[1] - eeeo[1];
  237|  36.9M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (237:28): [True: 29.5M, False: 7.44M]
  ------------------
  238|  29.5M|                {
  239|  29.5M|                    ee[k] = eee[k] + eeo[k];
  240|  29.5M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  241|  29.5M|                }
  242|  66.4M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (242:28): [True: 59.0M, False: 7.44M]
  ------------------
  243|  59.0M|                {
  244|  59.0M|                    e[k] = ee[k] + eo[k];
  245|  59.0M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  246|  59.0M|                }
  247|   124M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (247:28): [True: 117M, False: 7.44M]
  ------------------
  248|   117M|                {
  249|   117M|                    WORD32 itrans_out;
  250|   117M|                    itrans_out =
  251|   117M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   117M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   117M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 117M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 117M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|   117M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|   117M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   117M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 4.51M, False: 112M]
  |  |  |  |  |  Branch (40:53): [True: 2.73M, False: 110M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|   117M|                    itrans_out =
  254|   117M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|   117M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   117M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 117M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 117M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  255|   117M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|   117M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   117M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 4.73M, False: 112M]
  |  |  |  |  |  Branch (40:53): [True: 2.53M, False: 110M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|   117M|                }
  257|  7.44M|                pi2_tmp++;
  258|  7.44M|                pu1_pred += pred_strd;
  259|  7.44M|                pu1_dst += dst_strd;
  260|  7.44M|            }
  261|   233k|        }
  262|   303k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (262:17): [True: 132k, False: 171k]
  ------------------
  263|   132k|        {
  264|  4.34M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (264:24): [True: 4.21M, False: 132k]
  ------------------
  265|  4.21M|            {
  266|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  267|  70.6M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (267:28): [True: 66.4M, False: 4.21M]
  ------------------
  268|  66.4M|                {
  269|  66.4M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  270|  66.4M|                                    + g_ai2_ihevc_trans_32[3][k]
  271|  66.4M|                                                    * pi2_tmp[3 * trans_size]
  272|  66.4M|                                    + g_ai2_ihevc_trans_32[5][k]
  273|  66.4M|                                                    * pi2_tmp[5 * trans_size]
  274|  66.4M|                                    + g_ai2_ihevc_trans_32[7][k]
  275|  66.4M|                                                    * pi2_tmp[7 * trans_size];
  276|  66.4M|                }
  277|  37.7M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (277:28): [True: 33.5M, False: 4.21M]
  ------------------
  278|  33.5M|                {
  279|  33.5M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  280|  33.5M|                                    + g_ai2_ihevc_trans_32[6][k]
  281|  33.5M|                                                    * pi2_tmp[6 * trans_size];
  282|  33.5M|                }
  283|  21.0M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (283:28): [True: 16.8M, False: 4.21M]
  ------------------
  284|  16.8M|                {
  285|  16.8M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
  286|  16.8M|                }
  287|  4.21M|                eeeo[0] = 0;
  288|  4.21M|                eeeo[1] = 0;
  289|  4.21M|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  290|  4.21M|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  291|       |
  292|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  293|  4.21M|                eee[0] = eeee[0] + eeeo[0];
  294|  4.21M|                eee[3] = eeee[0] - eeeo[0];
  295|  4.21M|                eee[1] = eeee[1] + eeeo[1];
  296|  4.21M|                eee[2] = eeee[1] - eeeo[1];
  297|  20.9M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (297:28): [True: 16.7M, False: 4.21M]
  ------------------
  298|  16.7M|                {
  299|  16.7M|                    ee[k] = eee[k] + eeo[k];
  300|  16.7M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  301|  16.7M|                }
  302|  37.6M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (302:28): [True: 33.4M, False: 4.21M]
  ------------------
  303|  33.4M|                {
  304|  33.4M|                    e[k] = ee[k] + eo[k];
  305|  33.4M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  306|  33.4M|                }
  307|  70.3M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (307:28): [True: 66.1M, False: 4.21M]
  ------------------
  308|  66.1M|                {
  309|  66.1M|                    WORD32 itrans_out;
  310|  66.1M|                    itrans_out =
  311|  66.1M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  66.1M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  66.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 66.1M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 66.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  312|  66.1M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  66.1M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  66.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 10.7M, False: 55.4M]
  |  |  |  |  |  Branch (40:53): [True: 1.58M, False: 53.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  313|  66.1M|                    itrans_out =
  314|  66.1M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  66.1M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  66.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 66.1M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 66.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  315|  66.1M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  66.1M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  66.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 10.5M, False: 55.5M]
  |  |  |  |  |  Branch (40:53): [True: 1.55M, False: 54.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  316|  66.1M|                }
  317|  4.21M|                pi2_tmp++;
  318|  4.21M|                pu1_pred += pred_strd;
  319|  4.21M|                pu1_dst += dst_strd;
  320|  4.21M|            }
  321|   132k|        }
  322|   171k|        else /* All rows of output of 1st stage are non-zero */
  323|   171k|        {
  324|  5.62M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (324:24): [True: 5.45M, False: 171k]
  ------------------
  325|  5.45M|            {
  326|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  327|  89.8M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (327:28): [True: 84.4M, False: 5.45M]
  ------------------
  328|  84.4M|                {
  329|  84.4M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  330|  84.4M|                                    + g_ai2_ihevc_trans_32[3][k]
  331|  84.4M|                                                    * pi2_tmp[3 * trans_size]
  332|  84.4M|                                    + g_ai2_ihevc_trans_32[5][k]
  333|  84.4M|                                                    * pi2_tmp[5 * trans_size]
  334|  84.4M|                                    + g_ai2_ihevc_trans_32[7][k]
  335|  84.4M|                                                    * pi2_tmp[7 * trans_size]
  336|  84.4M|                                    + g_ai2_ihevc_trans_32[9][k]
  337|  84.4M|                                                    * pi2_tmp[9 * trans_size]
  338|  84.4M|                                    + g_ai2_ihevc_trans_32[11][k]
  339|  84.4M|                                                    * pi2_tmp[11 * trans_size]
  340|  84.4M|                                    + g_ai2_ihevc_trans_32[13][k]
  341|  84.4M|                                                    * pi2_tmp[13 * trans_size]
  342|  84.4M|                                    + g_ai2_ihevc_trans_32[15][k]
  343|  84.4M|                                                    * pi2_tmp[15 * trans_size]
  344|  84.4M|                                    + g_ai2_ihevc_trans_32[17][k]
  345|  84.4M|                                                    * pi2_tmp[17 * trans_size]
  346|  84.4M|                                    + g_ai2_ihevc_trans_32[19][k]
  347|  84.4M|                                                    * pi2_tmp[19 * trans_size]
  348|  84.4M|                                    + g_ai2_ihevc_trans_32[21][k]
  349|  84.4M|                                                    * pi2_tmp[21 * trans_size]
  350|  84.4M|                                    + g_ai2_ihevc_trans_32[23][k]
  351|  84.4M|                                                    * pi2_tmp[23 * trans_size]
  352|  84.4M|                                    + g_ai2_ihevc_trans_32[25][k]
  353|  84.4M|                                                    * pi2_tmp[25 * trans_size]
  354|  84.4M|                                    + g_ai2_ihevc_trans_32[27][k]
  355|  84.4M|                                                    * pi2_tmp[27 * trans_size]
  356|  84.4M|                                    + g_ai2_ihevc_trans_32[29][k]
  357|  84.4M|                                                    * pi2_tmp[29 * trans_size]
  358|  84.4M|                                    + g_ai2_ihevc_trans_32[31][k]
  359|  84.4M|                                                    * pi2_tmp[31 * trans_size];
  360|  84.4M|                }
  361|  48.5M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (361:28): [True: 43.0M, False: 5.45M]
  ------------------
  362|  43.0M|                {
  363|  43.0M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  364|  43.0M|                                    + g_ai2_ihevc_trans_32[6][k]
  365|  43.0M|                                                    * pi2_tmp[6 * trans_size]
  366|  43.0M|                                    + g_ai2_ihevc_trans_32[10][k]
  367|  43.0M|                                                    * pi2_tmp[10 * trans_size]
  368|  43.0M|                                    + g_ai2_ihevc_trans_32[14][k]
  369|  43.0M|                                                    * pi2_tmp[14 * trans_size]
  370|  43.0M|                                    + g_ai2_ihevc_trans_32[18][k]
  371|  43.0M|                                                    * pi2_tmp[18 * trans_size]
  372|  43.0M|                                    + g_ai2_ihevc_trans_32[22][k]
  373|  43.0M|                                                    * pi2_tmp[22 * trans_size]
  374|  43.0M|                                    + g_ai2_ihevc_trans_32[26][k]
  375|  43.0M|                                                    * pi2_tmp[26 * trans_size]
  376|  43.0M|                                    + g_ai2_ihevc_trans_32[30][k]
  377|  43.0M|                                                    * pi2_tmp[30 * trans_size];
  378|  43.0M|                }
  379|  27.1M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (379:28): [True: 21.7M, False: 5.45M]
  ------------------
  380|  21.7M|                {
  381|  21.7M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
  382|  21.7M|                                    + g_ai2_ihevc_trans_32[12][k]
  383|  21.7M|                                                    * pi2_tmp[12 * trans_size]
  384|  21.7M|                                    + g_ai2_ihevc_trans_32[20][k]
  385|  21.7M|                                                    * pi2_tmp[20 * trans_size]
  386|  21.7M|                                    + g_ai2_ihevc_trans_32[28][k]
  387|  21.7M|                                                    * pi2_tmp[28 * trans_size];
  388|  21.7M|                }
  389|  5.45M|                eeeo[0] =
  390|  5.45M|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
  391|  5.45M|                                                + g_ai2_ihevc_trans_32[24][0]
  392|  5.45M|                                                                * pi2_tmp[24
  393|  5.45M|                                                                                * trans_size];
  394|  5.45M|                eeeo[1] =
  395|  5.45M|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
  396|  5.45M|                                                + g_ai2_ihevc_trans_32[24][1]
  397|  5.45M|                                                                * pi2_tmp[24
  398|  5.45M|                                                                                * trans_size];
  399|  5.45M|                eeee[0] =
  400|  5.45M|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
  401|  5.45M|                                                + g_ai2_ihevc_trans_32[16][0]
  402|  5.45M|                                                                * pi2_tmp[16
  403|  5.45M|                                                                                * trans_size];
  404|  5.45M|                eeee[1] =
  405|  5.45M|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
  406|  5.45M|                                                + g_ai2_ihevc_trans_32[16][1]
  407|  5.45M|                                                                * pi2_tmp[16
  408|  5.45M|                                                                                * trans_size];
  409|       |
  410|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  411|  5.45M|                eee[0] = eeee[0] + eeeo[0];
  412|  5.45M|                eee[3] = eeee[0] - eeeo[0];
  413|  5.45M|                eee[1] = eeee[1] + eeeo[1];
  414|  5.45M|                eee[2] = eeee[1] - eeeo[1];
  415|  27.1M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (415:28): [True: 21.6M, False: 5.45M]
  ------------------
  416|  21.6M|                {
  417|  21.6M|                    ee[k] = eee[k] + eeo[k];
  418|  21.6M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  419|  21.6M|                }
  420|  48.8M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (420:28): [True: 43.4M, False: 5.45M]
  ------------------
  421|  43.4M|                {
  422|  43.4M|                    e[k] = ee[k] + eo[k];
  423|  43.4M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  424|  43.4M|                }
  425|  91.2M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (425:28): [True: 85.8M, False: 5.45M]
  ------------------
  426|  85.8M|                {
  427|  85.8M|                    WORD32 itrans_out;
  428|  85.8M|                    itrans_out =
  429|  85.8M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  85.8M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  85.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 85.8M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 85.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  430|  85.8M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  85.8M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  85.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 9.58M, False: 76.2M]
  |  |  |  |  |  Branch (40:53): [True: 3.42M, False: 72.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  431|  85.8M|                    itrans_out =
  432|  85.8M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  85.8M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  85.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 85.8M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 85.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  433|  85.8M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  85.8M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  85.8M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 7.94M, False: 77.8M]
  |  |  |  |  |  Branch (40:53): [True: 3.21M, False: 74.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  434|  85.8M|                }
  435|  5.45M|                pi2_tmp++;
  436|  5.45M|                pu1_pred += pred_strd;
  437|  5.45M|                pu1_dst += dst_strd;
  438|  5.45M|            }
  439|   171k|        }
  440|       |        /************************************************************************************************/
  441|       |        /************************************END - IT_RECON_32x32****************************************/
  442|       |        /************************************************************************************************/
  443|   537k|    }
  444|   696k|    else if((zero_rows & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of input are non-zero */
  ------------------
  |  Branch (444:13): [True: 255k, False: 441k]
  ------------------
  445|   255k|    {
  446|       |        /************************************************************************************************/
  447|       |        /**********************************START - IT_RECON_32x32****************************************/
  448|       |        /************************************************************************************************/
  449|       |        /* Inverse Transform 1st stage */
  450|   255k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|   255k|#define IT_SHIFT_STAGE_1 7
  ------------------
  451|   255k|        add = 1 << (shift - 1);
  452|       |
  453|  3.61M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (453:20): [True: 3.36M, False: 255k]
  ------------------
  454|  3.36M|        {
  455|       |            /* Checking for Zero Cols */
  456|  3.36M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (456:16): [True: 2.41M, False: 943k]
  ------------------
  457|  2.41M|            {
  458|  2.41M|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  459|  2.41M|            }
  460|   943k|            else
  461|   943k|            {
  462|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  463|  16.0M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (463:28): [True: 15.0M, False: 943k]
  ------------------
  464|  15.0M|                {
  465|  15.0M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
  466|  15.0M|                                    + g_ai2_ihevc_trans_32[3][k]
  467|  15.0M|                                                    * pi2_src[3 * src_strd]
  468|  15.0M|                                    + g_ai2_ihevc_trans_32[5][k]
  469|  15.0M|                                                    * pi2_src[5 * src_strd]
  470|  15.0M|                                    + g_ai2_ihevc_trans_32[7][k]
  471|  15.0M|                                                    * pi2_src[7 * src_strd];
  472|  15.0M|                }
  473|  8.49M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (473:28): [True: 7.55M, False: 943k]
  ------------------
  474|  7.55M|                {
  475|  7.55M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd]
  476|  7.55M|                                    + g_ai2_ihevc_trans_32[6][k]
  477|  7.55M|                                                    * pi2_src[6 * src_strd];
  478|  7.55M|                }
  479|  4.72M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (479:28): [True: 3.77M, False: 943k]
  ------------------
  480|  3.77M|                {
  481|  3.77M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd];
  482|  3.77M|                }
  483|   943k|                eeeo[0] = 0;
  484|   943k|                eeeo[1] = 0;
  485|   943k|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0];
  486|   943k|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0];
  487|       |
  488|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  489|   943k|                eee[0] = eeee[0] + eeeo[0];
  490|   943k|                eee[3] = eeee[0] - eeeo[0];
  491|   943k|                eee[1] = eeee[1] + eeeo[1];
  492|   943k|                eee[2] = eeee[1] - eeeo[1];
  493|  4.71M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (493:28): [True: 3.77M, False: 943k]
  ------------------
  494|  3.77M|                {
  495|  3.77M|                    ee[k] = eee[k] + eeo[k];
  496|  3.77M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  497|  3.77M|                }
  498|  8.49M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (498:28): [True: 7.55M, False: 943k]
  ------------------
  499|  7.55M|                {
  500|  7.55M|                    e[k] = ee[k] + eo[k];
  501|  7.55M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  502|  7.55M|                }
  503|  16.0M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (503:28): [True: 15.0M, False: 943k]
  ------------------
  504|  15.0M|                {
  505|  15.0M|                    pi2_tmp[k] =
  506|  15.0M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  15.0M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  15.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 884, False: 15.0M]
  |  |  |  |  |  Branch (40:53): [True: 593, False: 15.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  507|  15.0M|                    pi2_tmp[k + 16] =
  508|  15.0M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  15.0M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  15.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 731, False: 15.0M]
  |  |  |  |  |  Branch (40:53): [True: 608, False: 15.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  509|  15.0M|                }
  510|   943k|            }
  511|  3.36M|            pi2_src++;
  512|  3.36M|            pi2_tmp += trans_size;
  513|  3.36M|            zero_cols = zero_cols >> 1;
  514|  3.36M|        }
  515|       |
  516|   255k|        pi2_tmp = pi2_tmp_orig;
  517|       |
  518|       |        /* Inverse Transform 2nd stage */
  519|   255k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|   255k|#define IT_SHIFT_STAGE_2 12
  ------------------
  520|   255k|        add = 1 << (shift - 1);
  521|   255k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (521:12): [True: 135k, False: 119k]
  ------------------
  522|   135k|        {
  523|  4.44M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (523:24): [True: 4.31M, False: 135k]
  ------------------
  524|  4.31M|            {
  525|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  526|  73.0M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (526:28): [True: 68.7M, False: 4.31M]
  ------------------
  527|  68.7M|                {
  528|  68.7M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  529|  68.7M|                                    + g_ai2_ihevc_trans_32[3][k]
  530|  68.7M|                                                    * pi2_tmp[3 * trans_size];
  531|  68.7M|                }
  532|  38.7M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (532:28): [True: 34.4M, False: 4.31M]
  ------------------
  533|  34.4M|                {
  534|  34.4M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
  535|  34.4M|                }
  536|       |//                for(k = 0; k < 4; k++)
  537|  4.31M|                {
  538|  4.31M|                    eeo[0] = 0;
  539|  4.31M|                    eeo[1] = 0;
  540|  4.31M|                    eeo[2] = 0;
  541|  4.31M|                    eeo[3] = 0;
  542|  4.31M|                }
  543|  4.31M|                eeeo[0] = 0;
  544|  4.31M|                eeeo[1] = 0;
  545|  4.31M|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  546|  4.31M|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  547|       |
  548|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  549|  4.31M|                eee[0] = eeee[0] + eeeo[0];
  550|  4.31M|                eee[3] = eeee[0] - eeeo[0];
  551|  4.31M|                eee[1] = eeee[1] + eeeo[1];
  552|  4.31M|                eee[2] = eeee[1] - eeeo[1];
  553|  21.4M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (553:28): [True: 17.1M, False: 4.31M]
  ------------------
  554|  17.1M|                {
  555|  17.1M|                    ee[k] = eee[k] + eeo[k];
  556|  17.1M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  557|  17.1M|                }
  558|  38.6M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (558:28): [True: 34.3M, False: 4.31M]
  ------------------
  559|  34.3M|                {
  560|  34.3M|                    e[k] = ee[k] + eo[k];
  561|  34.3M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  562|  34.3M|                }
  563|  72.3M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (563:28): [True: 68.0M, False: 4.31M]
  ------------------
  564|  68.0M|                {
  565|  68.0M|                    WORD32 itrans_out;
  566|  68.0M|                    itrans_out =
  567|  68.0M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  68.0M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  68.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 68.0M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 68.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  568|  68.0M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  68.0M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  68.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.86M, False: 64.1M]
  |  |  |  |  |  Branch (40:53): [True: 7.34M, False: 56.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  569|  68.0M|                    itrans_out =
  570|  68.0M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  68.0M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  68.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 68.0M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 68.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  571|  68.0M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  68.0M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  68.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.82M, False: 64.2M]
  |  |  |  |  |  Branch (40:53): [True: 5.65M, False: 58.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  572|  68.0M|                }
  573|  4.31M|                pi2_tmp++;
  574|  4.31M|                pu1_pred += pred_strd;
  575|  4.31M|                pu1_dst += dst_strd;
  576|  4.31M|            }
  577|   135k|        }
  578|   119k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (578:17): [True: 42.2k, False: 77.6k]
  ------------------
  579|  42.2k|        {
  580|  1.39M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (580:24): [True: 1.34M, False: 42.2k]
  ------------------
  581|  1.34M|            {
  582|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  583|  22.8M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (583:28): [True: 21.5M, False: 1.34M]
  ------------------
  584|  21.5M|                {
  585|  21.5M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  586|  21.5M|                                    + g_ai2_ihevc_trans_32[3][k]
  587|  21.5M|                                                    * pi2_tmp[3 * trans_size]
  588|  21.5M|                                    + g_ai2_ihevc_trans_32[5][k]
  589|  21.5M|                                                    * pi2_tmp[5 * trans_size]
  590|  21.5M|                                    + g_ai2_ihevc_trans_32[7][k]
  591|  21.5M|                                                    * pi2_tmp[7 * trans_size];
  592|  21.5M|                }
  593|  12.1M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (593:28): [True: 10.7M, False: 1.34M]
  ------------------
  594|  10.7M|                {
  595|  10.7M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  596|  10.7M|                                    + g_ai2_ihevc_trans_32[6][k]
  597|  10.7M|                                                    * pi2_tmp[6 * trans_size];
  598|  10.7M|                }
  599|  6.73M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (599:28): [True: 5.39M, False: 1.34M]
  ------------------
  600|  5.39M|                {
  601|  5.39M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
  602|  5.39M|                }
  603|  1.34M|                eeeo[0] = 0;
  604|  1.34M|                eeeo[1] = 0;
  605|  1.34M|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  606|  1.34M|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  607|       |
  608|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  609|  1.34M|                eee[0] = eeee[0] + eeeo[0];
  610|  1.34M|                eee[3] = eeee[0] - eeeo[0];
  611|  1.34M|                eee[1] = eeee[1] + eeeo[1];
  612|  1.34M|                eee[2] = eeee[1] - eeeo[1];
  613|  6.73M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (613:28): [True: 5.38M, False: 1.34M]
  ------------------
  614|  5.38M|                {
  615|  5.38M|                    ee[k] = eee[k] + eeo[k];
  616|  5.38M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  617|  5.38M|                }
  618|  12.1M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (618:28): [True: 10.7M, False: 1.34M]
  ------------------
  619|  10.7M|                {
  620|  10.7M|                    e[k] = ee[k] + eo[k];
  621|  10.7M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  622|  10.7M|                }
  623|  22.8M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (623:28): [True: 21.4M, False: 1.34M]
  ------------------
  624|  21.4M|                {
  625|  21.4M|                    WORD32 itrans_out;
  626|  21.4M|                    itrans_out =
  627|  21.4M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  21.4M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  21.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 21.4M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 21.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  628|  21.4M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  21.4M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  21.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.69M, False: 17.7M]
  |  |  |  |  |  Branch (40:53): [True: 543k, False: 17.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  629|  21.4M|                    itrans_out =
  630|  21.4M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  21.4M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  21.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 21.4M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 21.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  631|  21.4M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  21.4M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  21.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.58M, False: 17.8M]
  |  |  |  |  |  Branch (40:53): [True: 597k, False: 17.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  632|  21.4M|                }
  633|  1.34M|                pi2_tmp++;
  634|  1.34M|                pu1_pred += pred_strd;
  635|  1.34M|                pu1_dst += dst_strd;
  636|  1.34M|            }
  637|  42.2k|        }
  638|  77.6k|        else /* All rows of output of 1st stage are non-zero */
  639|  77.6k|        {
  640|  2.55M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (640:24): [True: 2.48M, False: 77.6k]
  ------------------
  641|  2.48M|            {
  642|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  643|  41.2M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (643:28): [True: 38.7M, False: 2.48M]
  ------------------
  644|  38.7M|                {
  645|  38.7M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  646|  38.7M|                                    + g_ai2_ihevc_trans_32[3][k]
  647|  38.7M|                                                    * pi2_tmp[3 * trans_size]
  648|  38.7M|                                    + g_ai2_ihevc_trans_32[5][k]
  649|  38.7M|                                                    * pi2_tmp[5 * trans_size]
  650|  38.7M|                                    + g_ai2_ihevc_trans_32[7][k]
  651|  38.7M|                                                    * pi2_tmp[7 * trans_size]
  652|  38.7M|                                    + g_ai2_ihevc_trans_32[9][k]
  653|  38.7M|                                                    * pi2_tmp[9 * trans_size]
  654|  38.7M|                                    + g_ai2_ihevc_trans_32[11][k]
  655|  38.7M|                                                    * pi2_tmp[11 * trans_size]
  656|  38.7M|                                    + g_ai2_ihevc_trans_32[13][k]
  657|  38.7M|                                                    * pi2_tmp[13 * trans_size]
  658|  38.7M|                                    + g_ai2_ihevc_trans_32[15][k]
  659|  38.7M|                                                    * pi2_tmp[15 * trans_size]
  660|  38.7M|                                    + g_ai2_ihevc_trans_32[17][k]
  661|  38.7M|                                                    * pi2_tmp[17 * trans_size]
  662|  38.7M|                                    + g_ai2_ihevc_trans_32[19][k]
  663|  38.7M|                                                    * pi2_tmp[19 * trans_size]
  664|  38.7M|                                    + g_ai2_ihevc_trans_32[21][k]
  665|  38.7M|                                                    * pi2_tmp[21 * trans_size]
  666|  38.7M|                                    + g_ai2_ihevc_trans_32[23][k]
  667|  38.7M|                                                    * pi2_tmp[23 * trans_size]
  668|  38.7M|                                    + g_ai2_ihevc_trans_32[25][k]
  669|  38.7M|                                                    * pi2_tmp[25 * trans_size]
  670|  38.7M|                                    + g_ai2_ihevc_trans_32[27][k]
  671|  38.7M|                                                    * pi2_tmp[27 * trans_size]
  672|  38.7M|                                    + g_ai2_ihevc_trans_32[29][k]
  673|  38.7M|                                                    * pi2_tmp[29 * trans_size]
  674|  38.7M|                                    + g_ai2_ihevc_trans_32[31][k]
  675|  38.7M|                                                    * pi2_tmp[31 * trans_size];
  676|  38.7M|                }
  677|  22.1M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (677:28): [True: 19.6M, False: 2.48M]
  ------------------
  678|  19.6M|                {
  679|  19.6M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  680|  19.6M|                                    + g_ai2_ihevc_trans_32[6][k]
  681|  19.6M|                                                    * pi2_tmp[6 * trans_size]
  682|  19.6M|                                    + g_ai2_ihevc_trans_32[10][k]
  683|  19.6M|                                                    * pi2_tmp[10 * trans_size]
  684|  19.6M|                                    + g_ai2_ihevc_trans_32[14][k]
  685|  19.6M|                                                    * pi2_tmp[14 * trans_size]
  686|  19.6M|                                    + g_ai2_ihevc_trans_32[18][k]
  687|  19.6M|                                                    * pi2_tmp[18 * trans_size]
  688|  19.6M|                                    + g_ai2_ihevc_trans_32[22][k]
  689|  19.6M|                                                    * pi2_tmp[22 * trans_size]
  690|  19.6M|                                    + g_ai2_ihevc_trans_32[26][k]
  691|  19.6M|                                                    * pi2_tmp[26 * trans_size]
  692|  19.6M|                                    + g_ai2_ihevc_trans_32[30][k]
  693|  19.6M|                                                    * pi2_tmp[30 * trans_size];
  694|  19.6M|                }
  695|  12.3M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (695:28): [True: 9.89M, False: 2.48M]
  ------------------
  696|  9.89M|                {
  697|  9.89M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
  698|  9.89M|                                    + g_ai2_ihevc_trans_32[12][k]
  699|  9.89M|                                                    * pi2_tmp[12 * trans_size]
  700|  9.89M|                                    + g_ai2_ihevc_trans_32[20][k]
  701|  9.89M|                                                    * pi2_tmp[20 * trans_size]
  702|  9.89M|                                    + g_ai2_ihevc_trans_32[28][k]
  703|  9.89M|                                                    * pi2_tmp[28 * trans_size];
  704|  9.89M|                }
  705|  2.48M|                eeeo[0] =
  706|  2.48M|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
  707|  2.48M|                                                + g_ai2_ihevc_trans_32[24][0]
  708|  2.48M|                                                                * pi2_tmp[24
  709|  2.48M|                                                                                * trans_size];
  710|  2.48M|                eeeo[1] =
  711|  2.48M|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
  712|  2.48M|                                                + g_ai2_ihevc_trans_32[24][1]
  713|  2.48M|                                                                * pi2_tmp[24
  714|  2.48M|                                                                                * trans_size];
  715|  2.48M|                eeee[0] =
  716|  2.48M|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
  717|  2.48M|                                                + g_ai2_ihevc_trans_32[16][0]
  718|  2.48M|                                                                * pi2_tmp[16
  719|  2.48M|                                                                                * trans_size];
  720|  2.48M|                eeee[1] =
  721|  2.48M|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
  722|  2.48M|                                                + g_ai2_ihevc_trans_32[16][1]
  723|  2.48M|                                                                * pi2_tmp[16
  724|  2.48M|                                                                                * trans_size];
  725|       |
  726|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  727|  2.48M|                eee[0] = eeee[0] + eeeo[0];
  728|  2.48M|                eee[3] = eeee[0] - eeeo[0];
  729|  2.48M|                eee[1] = eeee[1] + eeeo[1];
  730|  2.48M|                eee[2] = eeee[1] - eeeo[1];
  731|  12.3M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (731:28): [True: 9.86M, False: 2.48M]
  ------------------
  732|  9.86M|                {
  733|  9.86M|                    ee[k] = eee[k] + eeo[k];
  734|  9.86M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  735|  9.86M|                }
  736|  22.2M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (736:28): [True: 19.7M, False: 2.48M]
  ------------------
  737|  19.7M|                {
  738|  19.7M|                    e[k] = ee[k] + eo[k];
  739|  19.7M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  740|  19.7M|                }
  741|  41.7M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (741:28): [True: 39.2M, False: 2.48M]
  ------------------
  742|  39.2M|                {
  743|  39.2M|                    WORD32 itrans_out;
  744|  39.2M|                    itrans_out =
  745|  39.2M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  39.2M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  39.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 39.2M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 39.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  746|  39.2M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  39.2M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  39.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 7.18M, False: 32.1M]
  |  |  |  |  |  Branch (40:53): [True: 1.86M, False: 30.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  747|  39.2M|                    itrans_out =
  748|  39.2M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  39.2M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  39.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 39.2M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 39.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  749|  39.2M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  39.2M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  39.2M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 6.72M, False: 32.5M]
  |  |  |  |  |  Branch (40:53): [True: 1.54M, False: 31.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  750|  39.2M|                }
  751|  2.48M|                pi2_tmp++;
  752|  2.48M|                pu1_pred += pred_strd;
  753|  2.48M|                pu1_dst += dst_strd;
  754|  2.48M|            }
  755|  77.6k|        }
  756|       |        /************************************************************************************************/
  757|       |        /************************************END - IT_RECON_32x32****************************************/
  758|       |        /************************************************************************************************/
  759|   255k|    }
  760|   441k|    else  /* All rows of input are non-zero */
  761|   441k|    {
  762|       |        /************************************************************************************************/
  763|       |        /**********************************START - IT_RECON_32x32****************************************/
  764|       |        /************************************************************************************************/
  765|       |        /* Inverse Transform 1st stage */
  766|   441k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|   441k|#define IT_SHIFT_STAGE_1 7
  ------------------
  767|   441k|        add = 1 << (shift - 1);
  768|       |
  769|  9.85M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (769:20): [True: 9.41M, False: 441k]
  ------------------
  770|  9.41M|        {
  771|       |            /* Checking for Zero Cols */
  772|  9.41M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (772:16): [True: 7.70M, False: 1.71M]
  ------------------
  773|  7.70M|            {
  774|  7.70M|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  775|  7.70M|            }
  776|  1.71M|            else
  777|  1.71M|            {
  778|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  779|  29.1M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (779:28): [True: 27.4M, False: 1.71M]
  ------------------
  780|  27.4M|                {
  781|  27.4M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd]
  782|  27.4M|                                    + g_ai2_ihevc_trans_32[3][k]
  783|  27.4M|                                                    * pi2_src[3 * src_strd]
  784|  27.4M|                                    + g_ai2_ihevc_trans_32[5][k]
  785|  27.4M|                                                    * pi2_src[5 * src_strd]
  786|  27.4M|                                    + g_ai2_ihevc_trans_32[7][k]
  787|  27.4M|                                                    * pi2_src[7 * src_strd]
  788|  27.4M|                                    + g_ai2_ihevc_trans_32[9][k]
  789|  27.4M|                                                    * pi2_src[9 * src_strd]
  790|  27.4M|                                    + g_ai2_ihevc_trans_32[11][k]
  791|  27.4M|                                                    * pi2_src[11 * src_strd]
  792|  27.4M|                                    + g_ai2_ihevc_trans_32[13][k]
  793|  27.4M|                                                    * pi2_src[13 * src_strd]
  794|  27.4M|                                    + g_ai2_ihevc_trans_32[15][k]
  795|  27.4M|                                                    * pi2_src[15 * src_strd]
  796|  27.4M|                                    + g_ai2_ihevc_trans_32[17][k]
  797|  27.4M|                                                    * pi2_src[17 * src_strd]
  798|  27.4M|                                    + g_ai2_ihevc_trans_32[19][k]
  799|  27.4M|                                                    * pi2_src[19 * src_strd]
  800|  27.4M|                                    + g_ai2_ihevc_trans_32[21][k]
  801|  27.4M|                                                    * pi2_src[21 * src_strd]
  802|  27.4M|                                    + g_ai2_ihevc_trans_32[23][k]
  803|  27.4M|                                                    * pi2_src[23 * src_strd]
  804|  27.4M|                                    + g_ai2_ihevc_trans_32[25][k]
  805|  27.4M|                                                    * pi2_src[25 * src_strd]
  806|  27.4M|                                    + g_ai2_ihevc_trans_32[27][k]
  807|  27.4M|                                                    * pi2_src[27 * src_strd]
  808|  27.4M|                                    + g_ai2_ihevc_trans_32[29][k]
  809|  27.4M|                                                    * pi2_src[29 * src_strd]
  810|  27.4M|                                    + g_ai2_ihevc_trans_32[31][k]
  811|  27.4M|                                                    * pi2_src[31 * src_strd];
  812|  27.4M|                }
  813|  15.4M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (813:28): [True: 13.7M, False: 1.71M]
  ------------------
  814|  13.7M|                {
  815|  13.7M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd]
  816|  13.7M|                                    + g_ai2_ihevc_trans_32[6][k]
  817|  13.7M|                                                    * pi2_src[6 * src_strd]
  818|  13.7M|                                    + g_ai2_ihevc_trans_32[10][k]
  819|  13.7M|                                                    * pi2_src[10 * src_strd]
  820|  13.7M|                                    + g_ai2_ihevc_trans_32[14][k]
  821|  13.7M|                                                    * pi2_src[14 * src_strd]
  822|  13.7M|                                    + g_ai2_ihevc_trans_32[18][k]
  823|  13.7M|                                                    * pi2_src[18 * src_strd]
  824|  13.7M|                                    + g_ai2_ihevc_trans_32[22][k]
  825|  13.7M|                                                    * pi2_src[22 * src_strd]
  826|  13.7M|                                    + g_ai2_ihevc_trans_32[26][k]
  827|  13.7M|                                                    * pi2_src[26 * src_strd]
  828|  13.7M|                                    + g_ai2_ihevc_trans_32[30][k]
  829|  13.7M|                                                    * pi2_src[30 * src_strd];
  830|  13.7M|                }
  831|  8.59M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (831:28): [True: 6.87M, False: 1.71M]
  ------------------
  832|  6.87M|                {
  833|  6.87M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd]
  834|  6.87M|                                    + g_ai2_ihevc_trans_32[12][k]
  835|  6.87M|                                                    * pi2_src[12 * src_strd]
  836|  6.87M|                                    + g_ai2_ihevc_trans_32[20][k]
  837|  6.87M|                                                    * pi2_src[20 * src_strd]
  838|  6.87M|                                    + g_ai2_ihevc_trans_32[28][k]
  839|  6.87M|                                                    * pi2_src[28 * src_strd];
  840|  6.87M|                }
  841|  1.71M|                eeeo[0] = g_ai2_ihevc_trans_32[8][0] * pi2_src[8 * src_strd]
  842|  1.71M|                                + g_ai2_ihevc_trans_32[24][0]
  843|  1.71M|                                                * pi2_src[24 * src_strd];
  844|  1.71M|                eeeo[1] = g_ai2_ihevc_trans_32[8][1] * pi2_src[8 * src_strd]
  845|  1.71M|                                + g_ai2_ihevc_trans_32[24][1]
  846|  1.71M|                                                * pi2_src[24 * src_strd];
  847|  1.71M|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0]
  848|  1.71M|                                + g_ai2_ihevc_trans_32[16][0]
  849|  1.71M|                                                * pi2_src[16 * src_strd];
  850|  1.71M|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0]
  851|  1.71M|                                + g_ai2_ihevc_trans_32[16][1]
  852|  1.71M|                                                * pi2_src[16 * src_strd];
  853|       |
  854|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  855|  1.71M|                eee[0] = eeee[0] + eeeo[0];
  856|  1.71M|                eee[3] = eeee[0] - eeeo[0];
  857|  1.71M|                eee[1] = eeee[1] + eeeo[1];
  858|  1.71M|                eee[2] = eeee[1] - eeeo[1];
  859|  8.58M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (859:28): [True: 6.87M, False: 1.71M]
  ------------------
  860|  6.87M|                {
  861|  6.87M|                    ee[k] = eee[k] + eeo[k];
  862|  6.87M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  863|  6.87M|                }
  864|  15.4M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (864:28): [True: 13.7M, False: 1.71M]
  ------------------
  865|  13.7M|                {
  866|  13.7M|                    e[k] = ee[k] + eo[k];
  867|  13.7M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  868|  13.7M|                }
  869|  29.2M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (869:28): [True: 27.4M, False: 1.71M]
  ------------------
  870|  27.4M|                {
  871|  27.4M|                    pi2_tmp[k] =
  872|  27.4M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  27.4M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  27.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 4.12k, False: 27.4M]
  |  |  |  |  |  Branch (40:53): [True: 4.81k, False: 27.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  873|  27.4M|                    pi2_tmp[k + 16] =
  874|  27.4M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  27.4M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  27.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 4.96k, False: 27.4M]
  |  |  |  |  |  Branch (40:53): [True: 4.31k, False: 27.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  875|  27.4M|                }
  876|  1.71M|            }
  877|  9.41M|            pi2_src++;
  878|  9.41M|            pi2_tmp += trans_size;
  879|  9.41M|            zero_cols = zero_cols >> 1;
  880|  9.41M|        }
  881|       |
  882|   441k|        pi2_tmp = pi2_tmp_orig;
  883|       |
  884|       |        /* Inverse Transform 2nd stage */
  885|   441k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|   441k|#define IT_SHIFT_STAGE_2 12
  ------------------
  886|   441k|        add = 1 << (shift - 1);
  887|   441k|        if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (887:12): [True: 127k, False: 313k]
  ------------------
  888|   127k|        {
  889|  4.19M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (889:24): [True: 4.07M, False: 127k]
  ------------------
  890|  4.07M|            {
  891|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  892|  69.1M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (892:28): [True: 65.1M, False: 4.07M]
  ------------------
  893|  65.1M|                {
  894|  65.1M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  895|  65.1M|                                    + g_ai2_ihevc_trans_32[3][k]
  896|  65.1M|                                                    * pi2_tmp[3 * trans_size];
  897|  65.1M|                }
  898|  36.6M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (898:28): [True: 32.5M, False: 4.07M]
  ------------------
  899|  32.5M|                {
  900|  32.5M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size];
  901|  32.5M|                }
  902|       |//                for(k = 0; k < 4; k++)
  903|  4.07M|                {
  904|  4.07M|                    eeo[0] = 0;
  905|  4.07M|                    eeo[1] = 0;
  906|  4.07M|                    eeo[2] = 0;
  907|  4.07M|                    eeo[3] = 0;
  908|  4.07M|                }
  909|  4.07M|                eeeo[0] = 0;
  910|  4.07M|                eeeo[1] = 0;
  911|  4.07M|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  912|  4.07M|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  913|       |
  914|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  915|  4.07M|                eee[0] = eeee[0] + eeeo[0];
  916|  4.07M|                eee[3] = eeee[0] - eeeo[0];
  917|  4.07M|                eee[1] = eeee[1] + eeeo[1];
  918|  4.07M|                eee[2] = eeee[1] - eeeo[1];
  919|  20.3M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (919:28): [True: 16.2M, False: 4.07M]
  ------------------
  920|  16.2M|                {
  921|  16.2M|                    ee[k] = eee[k] + eeo[k];
  922|  16.2M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  923|  16.2M|                }
  924|  36.4M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (924:28): [True: 32.3M, False: 4.07M]
  ------------------
  925|  32.3M|                {
  926|  32.3M|                    e[k] = ee[k] + eo[k];
  927|  32.3M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  928|  32.3M|                }
  929|  68.1M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (929:28): [True: 64.0M, False: 4.07M]
  ------------------
  930|  64.0M|                {
  931|  64.0M|                    WORD32 itrans_out;
  932|  64.0M|                    itrans_out =
  933|  64.0M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  64.0M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  64.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 64.0M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 64.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  934|  64.0M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  64.0M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  64.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 11.6M, False: 52.3M]
  |  |  |  |  |  Branch (40:53): [True: 1.36M, False: 50.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  935|  64.0M|                    itrans_out =
  936|  64.0M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  64.0M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  64.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 64.0M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 64.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  937|  64.0M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  64.0M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  64.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 9.60M, False: 54.4M]
  |  |  |  |  |  Branch (40:53): [True: 1.57M, False: 52.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  938|  64.0M|                }
  939|  4.07M|                pi2_tmp++;
  940|  4.07M|                pu1_pred += pred_strd;
  941|  4.07M|                pu1_dst += dst_strd;
  942|  4.07M|            }
  943|   127k|        }
  944|   313k|        else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (944:17): [True: 46.9k, False: 266k]
  ------------------
  945|  46.9k|        {
  946|  1.54M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (946:24): [True: 1.49M, False: 46.9k]
  ------------------
  947|  1.49M|            {
  948|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  949|  25.4M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (949:28): [True: 23.9M, False: 1.49M]
  ------------------
  950|  23.9M|                {
  951|  23.9M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
  952|  23.9M|                                    + g_ai2_ihevc_trans_32[3][k]
  953|  23.9M|                                                    * pi2_tmp[3 * trans_size]
  954|  23.9M|                                    + g_ai2_ihevc_trans_32[5][k]
  955|  23.9M|                                                    * pi2_tmp[5 * trans_size]
  956|  23.9M|                                    + g_ai2_ihevc_trans_32[7][k]
  957|  23.9M|                                                    * pi2_tmp[7 * trans_size];
  958|  23.9M|                }
  959|  13.4M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (959:28): [True: 11.9M, False: 1.49M]
  ------------------
  960|  11.9M|                {
  961|  11.9M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
  962|  11.9M|                                    + g_ai2_ihevc_trans_32[6][k]
  963|  11.9M|                                                    * pi2_tmp[6 * trans_size];
  964|  11.9M|                }
  965|  7.48M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (965:28): [True: 5.99M, False: 1.49M]
  ------------------
  966|  5.99M|                {
  967|  5.99M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size];
  968|  5.99M|                }
  969|  1.49M|                eeeo[0] = 0;
  970|  1.49M|                eeeo[1] = 0;
  971|  1.49M|                eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0];
  972|  1.49M|                eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0];
  973|       |
  974|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  975|  1.49M|                eee[0] = eeee[0] + eeeo[0];
  976|  1.49M|                eee[3] = eeee[0] - eeeo[0];
  977|  1.49M|                eee[1] = eeee[1] + eeeo[1];
  978|  1.49M|                eee[2] = eeee[1] - eeeo[1];
  979|  7.47M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (979:28): [True: 5.98M, False: 1.49M]
  ------------------
  980|  5.98M|                {
  981|  5.98M|                    ee[k] = eee[k] + eeo[k];
  982|  5.98M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
  983|  5.98M|                }
  984|  13.4M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (984:28): [True: 11.9M, False: 1.49M]
  ------------------
  985|  11.9M|                {
  986|  11.9M|                    e[k] = ee[k] + eo[k];
  987|  11.9M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
  988|  11.9M|                }
  989|  25.1M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (989:28): [True: 23.6M, False: 1.49M]
  ------------------
  990|  23.6M|                {
  991|  23.6M|                    WORD32 itrans_out;
  992|  23.6M|                    itrans_out =
  993|  23.6M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  23.6M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  23.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 23.6M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 23.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  994|  23.6M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  23.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  23.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.69M, False: 20.0M]
  |  |  |  |  |  Branch (40:53): [True: 885k, False: 19.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  995|  23.6M|                    itrans_out =
  996|  23.6M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|  23.6M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  23.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 23.6M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 23.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  997|  23.6M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|  23.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  23.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.53M, False: 20.1M]
  |  |  |  |  |  Branch (40:53): [True: 847k, False: 19.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  998|  23.6M|                }
  999|  1.49M|                pi2_tmp++;
 1000|  1.49M|                pu1_pred += pred_strd;
 1001|  1.49M|                pu1_dst += dst_strd;
 1002|  1.49M|            }
 1003|  46.9k|        }
 1004|   266k|        else /* All rows of output of 1st stage are non-zero */
 1005|   266k|        {
 1006|  8.78M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (1006:24): [True: 8.51M, False: 266k]
  ------------------
 1007|  8.51M|            {
 1008|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
 1009|   142M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1009:28): [True: 134M, False: 8.51M]
  ------------------
 1010|   134M|                {
 1011|   134M|                    o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size]
 1012|   134M|                                    + g_ai2_ihevc_trans_32[3][k]
 1013|   134M|                                                    * pi2_tmp[3 * trans_size]
 1014|   134M|                                    + g_ai2_ihevc_trans_32[5][k]
 1015|   134M|                                                    * pi2_tmp[5 * trans_size]
 1016|   134M|                                    + g_ai2_ihevc_trans_32[7][k]
 1017|   134M|                                                    * pi2_tmp[7 * trans_size]
 1018|   134M|                                    + g_ai2_ihevc_trans_32[9][k]
 1019|   134M|                                                    * pi2_tmp[9 * trans_size]
 1020|   134M|                                    + g_ai2_ihevc_trans_32[11][k]
 1021|   134M|                                                    * pi2_tmp[11 * trans_size]
 1022|   134M|                                    + g_ai2_ihevc_trans_32[13][k]
 1023|   134M|                                                    * pi2_tmp[13 * trans_size]
 1024|   134M|                                    + g_ai2_ihevc_trans_32[15][k]
 1025|   134M|                                                    * pi2_tmp[15 * trans_size]
 1026|   134M|                                    + g_ai2_ihevc_trans_32[17][k]
 1027|   134M|                                                    * pi2_tmp[17 * trans_size]
 1028|   134M|                                    + g_ai2_ihevc_trans_32[19][k]
 1029|   134M|                                                    * pi2_tmp[19 * trans_size]
 1030|   134M|                                    + g_ai2_ihevc_trans_32[21][k]
 1031|   134M|                                                    * pi2_tmp[21 * trans_size]
 1032|   134M|                                    + g_ai2_ihevc_trans_32[23][k]
 1033|   134M|                                                    * pi2_tmp[23 * trans_size]
 1034|   134M|                                    + g_ai2_ihevc_trans_32[25][k]
 1035|   134M|                                                    * pi2_tmp[25 * trans_size]
 1036|   134M|                                    + g_ai2_ihevc_trans_32[27][k]
 1037|   134M|                                                    * pi2_tmp[27 * trans_size]
 1038|   134M|                                    + g_ai2_ihevc_trans_32[29][k]
 1039|   134M|                                                    * pi2_tmp[29 * trans_size]
 1040|   134M|                                    + g_ai2_ihevc_trans_32[31][k]
 1041|   134M|                                                    * pi2_tmp[31 * trans_size];
 1042|   134M|                }
 1043|  76.1M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1043:28): [True: 67.6M, False: 8.51M]
  ------------------
 1044|  67.6M|                {
 1045|  67.6M|                    eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]
 1046|  67.6M|                                    + g_ai2_ihevc_trans_32[6][k]
 1047|  67.6M|                                                    * pi2_tmp[6 * trans_size]
 1048|  67.6M|                                    + g_ai2_ihevc_trans_32[10][k]
 1049|  67.6M|                                                    * pi2_tmp[10 * trans_size]
 1050|  67.6M|                                    + g_ai2_ihevc_trans_32[14][k]
 1051|  67.6M|                                                    * pi2_tmp[14 * trans_size]
 1052|  67.6M|                                    + g_ai2_ihevc_trans_32[18][k]
 1053|  67.6M|                                                    * pi2_tmp[18 * trans_size]
 1054|  67.6M|                                    + g_ai2_ihevc_trans_32[22][k]
 1055|  67.6M|                                                    * pi2_tmp[22 * trans_size]
 1056|  67.6M|                                    + g_ai2_ihevc_trans_32[26][k]
 1057|  67.6M|                                                    * pi2_tmp[26 * trans_size]
 1058|  67.6M|                                    + g_ai2_ihevc_trans_32[30][k]
 1059|  67.6M|                                                    * pi2_tmp[30 * trans_size];
 1060|  67.6M|                }
 1061|  42.5M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1061:28): [True: 34.0M, False: 8.51M]
  ------------------
 1062|  34.0M|                {
 1063|  34.0M|                    eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]
 1064|  34.0M|                                    + g_ai2_ihevc_trans_32[12][k]
 1065|  34.0M|                                                    * pi2_tmp[12 * trans_size]
 1066|  34.0M|                                    + g_ai2_ihevc_trans_32[20][k]
 1067|  34.0M|                                                    * pi2_tmp[20 * trans_size]
 1068|  34.0M|                                    + g_ai2_ihevc_trans_32[28][k]
 1069|  34.0M|                                                    * pi2_tmp[28 * trans_size];
 1070|  34.0M|                }
 1071|  8.51M|                eeeo[0] =
 1072|  8.51M|                                g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size]
 1073|  8.51M|                                                + g_ai2_ihevc_trans_32[24][0]
 1074|  8.51M|                                                                * pi2_tmp[24
 1075|  8.51M|                                                                                * trans_size];
 1076|  8.51M|                eeeo[1] =
 1077|  8.51M|                                g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size]
 1078|  8.51M|                                                + g_ai2_ihevc_trans_32[24][1]
 1079|  8.51M|                                                                * pi2_tmp[24
 1080|  8.51M|                                                                                * trans_size];
 1081|  8.51M|                eeee[0] =
 1082|  8.51M|                                g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]
 1083|  8.51M|                                                + g_ai2_ihevc_trans_32[16][0]
 1084|  8.51M|                                                                * pi2_tmp[16
 1085|  8.51M|                                                                                * trans_size];
 1086|  8.51M|                eeee[1] =
 1087|  8.51M|                                g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]
 1088|  8.51M|                                                + g_ai2_ihevc_trans_32[16][1]
 1089|  8.51M|                                                                * pi2_tmp[16
 1090|  8.51M|                                                                                * trans_size];
 1091|       |
 1092|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
 1093|  8.51M|                eee[0] = eeee[0] + eeeo[0];
 1094|  8.51M|                eee[3] = eeee[0] - eeeo[0];
 1095|  8.51M|                eee[1] = eeee[1] + eeeo[1];
 1096|  8.51M|                eee[2] = eeee[1] - eeeo[1];
 1097|  42.5M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (1097:28): [True: 34.0M, False: 8.51M]
  ------------------
 1098|  34.0M|                {
 1099|  34.0M|                    ee[k] = eee[k] + eeo[k];
 1100|  34.0M|                    ee[k + 4] = eee[3 - k] - eeo[3 - k];
 1101|  34.0M|                }
 1102|  76.6M|                for(k = 0; k < 8; k++)
  ------------------
  |  Branch (1102:28): [True: 68.0M, False: 8.51M]
  ------------------
 1103|  68.0M|                {
 1104|  68.0M|                    e[k] = ee[k] + eo[k];
 1105|  68.0M|                    e[k + 8] = ee[7 - k] - eo[7 - k];
 1106|  68.0M|                }
 1107|   142M|                for(k = 0; k < 16; k++)
  ------------------
  |  Branch (1107:28): [True: 134M, False: 8.51M]
  ------------------
 1108|   134M|                {
 1109|   134M|                    WORD32 itrans_out;
 1110|   134M|                    itrans_out =
 1111|   134M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|   134M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   134M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 134M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 134M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1112|   134M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|   134M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   134M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 48.1M, False: 86.0M]
  |  |  |  |  |  Branch (40:53): [True: 3.37M, False: 82.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1113|   134M|                    itrans_out =
 1114|   134M|                                    CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift));
  ------------------
  |  |   53|   134M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   134M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 134M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 134M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1115|   134M|                    pu1_dst[k + 16] = CLIP_U8((itrans_out + pu1_pred[k + 16]));
  ------------------
  |  |   40|   134M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   134M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 48.4M, False: 85.7M]
  |  |  |  |  |  Branch (40:53): [True: 3.56M, False: 82.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1116|   134M|                }
 1117|  8.51M|                pi2_tmp++;
 1118|  8.51M|                pu1_pred += pred_strd;
 1119|  8.51M|                pu1_dst += dst_strd;
 1120|  8.51M|            }
 1121|   266k|        }
 1122|       |        /************************************************************************************************/
 1123|       |        /************************************END - IT_RECON_32x32****************************************/
 1124|       |        /************************************************************************************************/
 1125|   441k|    }
 1126|  1.23M|}

ihevc_itrans_recon_8x8:
  107|   525k|{
  108|   525k|    WORD32 j, k;
  109|   525k|    WORD32 e[4], o[4];
  110|   525k|    WORD32 ee[2], eo[2];
  111|   525k|    WORD32 add;
  112|   525k|    WORD32 shift;
  113|   525k|    WORD16 *pi2_tmp_orig;
  114|   525k|    WORD32 trans_size;
  115|   525k|    WORD32 zero_rows_2nd_stage = zero_cols;
  116|   525k|    WORD32 row_limit_2nd_stage;
  117|       |
  118|   525k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  420|   525k|#define TRANS_SIZE_8   8
  ------------------
  119|       |
  120|   525k|    pi2_tmp_orig = pi2_tmp;
  121|       |
  122|   525k|    if((zero_cols & 0xF0) == 0xF0)
  ------------------
  |  Branch (122:8): [True: 332k, False: 193k]
  ------------------
  123|   332k|        row_limit_2nd_stage = 4;
  124|   193k|    else
  125|   193k|        row_limit_2nd_stage = TRANS_SIZE_8;
  ------------------
  |  |  420|   193k|#define TRANS_SIZE_8   8
  ------------------
  126|       |
  127|       |
  128|   525k|    if((zero_rows & 0xF0) == 0xF0) /* First 4 rows of input are non-zero */
  ------------------
  |  Branch (128:8): [True: 416k, False: 109k]
  ------------------
  129|   416k|    {
  130|       |        /************************************************************************************************/
  131|       |        /**********************************START - IT_RECON_8x8******************************************/
  132|       |        /************************************************************************************************/
  133|       |
  134|       |        /* Inverse Transform 1st stage */
  135|   416k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|   416k|#define IT_SHIFT_STAGE_1 7
  ------------------
  136|   416k|        add = 1 << (shift - 1);
  137|       |
  138|  2.72M|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (138:20): [True: 2.30M, False: 416k]
  ------------------
  139|  2.30M|        {
  140|       |            /* Checking for Zero Cols */
  141|  2.30M|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (141:16): [True: 1.39M, False: 911k]
  ------------------
  142|  1.39M|            {
  143|  1.39M|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  144|  1.39M|            }
  145|   911k|            else
  146|   911k|            {
  147|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  148|  4.56M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (148:28): [True: 3.65M, False: 911k]
  ------------------
  149|  3.65M|                {
  150|  3.65M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  151|  3.65M|                                    + g_ai2_ihevc_trans_8[3][k]
  152|  3.65M|                                                    * pi2_src[3 * src_strd];
  153|  3.65M|                }
  154|   911k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd];
  155|   911k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd];
  156|   911k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0];
  157|   911k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0];
  158|       |
  159|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  160|   911k|                e[0] = ee[0] + eo[0];
  161|   911k|                e[3] = ee[0] - eo[0];
  162|   911k|                e[1] = ee[1] + eo[1];
  163|   911k|                e[2] = ee[1] - eo[1];
  164|  4.56M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (164:28): [True: 3.65M, False: 911k]
  ------------------
  165|  3.65M|                {
  166|  3.65M|                    pi2_tmp[k] =
  167|  3.65M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  3.65M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.65M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.95k, False: 3.65M]
  |  |  |  |  |  Branch (40:53): [True: 2.09k, False: 3.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  168|  3.65M|                    pi2_tmp[k + 4] =
  169|  3.65M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  3.65M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  3.65M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.25k, False: 3.65M]
  |  |  |  |  |  Branch (40:53): [True: 1.87k, False: 3.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  170|  3.65M|                }
  171|   911k|            }
  172|  2.30M|            pi2_src++;
  173|  2.30M|            pi2_tmp += trans_size;
  174|  2.30M|            zero_cols = zero_cols >> 1;
  175|  2.30M|        }
  176|       |
  177|   416k|        pi2_tmp = pi2_tmp_orig;
  178|       |
  179|       |        /* Inverse Transform 2nd stage */
  180|   416k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|   416k|#define IT_SHIFT_STAGE_2 12
  ------------------
  181|   416k|        add = 1 << (shift - 1);
  182|   416k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (182:12): [True: 255k, False: 160k]
  ------------------
  183|   255k|        {
  184|  2.29M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (184:24): [True: 2.04M, False: 255k]
  ------------------
  185|  2.04M|            {
  186|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  187|  10.2M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (187:28): [True: 8.16M, False: 2.04M]
  ------------------
  188|  8.16M|                {
  189|  8.16M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  190|  8.16M|                                    + g_ai2_ihevc_trans_8[3][k] * pi2_tmp[3 * trans_size];
  191|  8.16M|                }
  192|  2.04M|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  193|  2.04M|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  194|  2.04M|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  195|  2.04M|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0];
  196|       |
  197|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  198|  2.04M|                e[0] = ee[0] + eo[0];
  199|  2.04M|                e[3] = ee[0] - eo[0];
  200|  2.04M|                e[1] = ee[1] + eo[1];
  201|  2.04M|                e[2] = ee[1] - eo[1];
  202|  10.2M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (202:28): [True: 8.16M, False: 2.04M]
  ------------------
  203|  8.16M|                {
  204|  8.16M|                    WORD32 itrans_out;
  205|  8.16M|                    itrans_out =
  206|  8.16M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  8.16M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.16M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.16M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  207|  8.16M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  8.16M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.16M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.46M, False: 6.69M]
  |  |  |  |  |  Branch (40:53): [True: 757k, False: 5.94M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  208|  8.16M|                    itrans_out =
  209|  8.16M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  8.16M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  8.16M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 8.16M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|  8.16M|                    pu1_dst[k + 4] = CLIP_U8((itrans_out + pu1_pred[k + 4]));
  ------------------
  |  |   40|  8.16M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.16M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.40M, False: 6.75M]
  |  |  |  |  |  Branch (40:53): [True: 764k, False: 5.99M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  211|  8.16M|                }
  212|  2.04M|                pi2_tmp++;
  213|  2.04M|                pu1_pred += pred_strd;
  214|  2.04M|                pu1_dst += dst_strd;
  215|  2.04M|            }
  216|   255k|        }
  217|   160k|        else /* All rows of output of 1st stage are non-zero */
  218|   160k|        {
  219|  1.44M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (219:24): [True: 1.28M, False: 160k]
  ------------------
  220|  1.28M|            {
  221|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  222|  6.40M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (222:28): [True: 5.12M, False: 1.28M]
  ------------------
  223|  5.12M|                {
  224|  5.12M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  225|  5.12M|                                    + g_ai2_ihevc_trans_8[3][k]
  226|  5.12M|                                                    * pi2_tmp[3 * trans_size]
  227|  5.12M|                                    + g_ai2_ihevc_trans_8[5][k]
  228|  5.12M|                                                    * pi2_tmp[5 * trans_size]
  229|  5.12M|                                    + g_ai2_ihevc_trans_8[7][k]
  230|  5.12M|                                                    * pi2_tmp[7 * trans_size];
  231|  5.12M|                }
  232|       |
  233|  1.28M|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  234|  1.28M|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  235|  1.28M|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  236|  1.28M|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  237|  1.28M|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  238|  1.28M|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  239|  1.28M|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  240|  1.28M|                                + g_ai2_ihevc_trans_8[4][1] * pi2_tmp[4 * trans_size];
  241|       |
  242|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  243|  1.28M|                e[0] = ee[0] + eo[0];
  244|  1.28M|                e[3] = ee[0] - eo[0];
  245|  1.28M|                e[1] = ee[1] + eo[1];
  246|  1.28M|                e[2] = ee[1] - eo[1];
  247|  6.38M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (247:28): [True: 5.10M, False: 1.28M]
  ------------------
  248|  5.10M|                {
  249|  5.10M|                    WORD32 itrans_out;
  250|  5.10M|                    itrans_out =
  251|  5.10M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  5.10M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.10M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.10M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.10M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|  5.10M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  5.10M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.10M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.15M, False: 2.95M]
  |  |  |  |  |  Branch (40:53): [True: 244k, False: 2.70M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|  5.10M|                    itrans_out =
  254|  5.10M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  5.10M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  5.10M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 5.10M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 5.10M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  255|  5.10M|                    pu1_dst[k + 4] = CLIP_U8((itrans_out + pu1_pred[k + 4]));
  ------------------
  |  |   40|  5.10M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  5.10M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2.10M, False: 3.00M]
  |  |  |  |  |  Branch (40:53): [True: 204k, False: 2.79M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|  5.10M|                }
  257|  1.28M|                pi2_tmp++;
  258|  1.28M|                pu1_pred += pred_strd;
  259|  1.28M|                pu1_dst += dst_strd;
  260|  1.28M|            }
  261|   160k|        }
  262|       |        /************************************************************************************************/
  263|       |        /************************************END - IT_RECON_8x8******************************************/
  264|       |        /************************************************************************************************/
  265|   416k|    }
  266|   109k|    else /* All rows of input are non-zero */
  267|   109k|    {
  268|       |        /************************************************************************************************/
  269|       |        /**********************************START - IT_RECON_8x8******************************************/
  270|       |        /************************************************************************************************/
  271|       |
  272|       |        /* Inverse Transform 1st stage */
  273|   109k|        shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|   109k|#define IT_SHIFT_STAGE_1 7
  ------------------
  274|   109k|        add = 1 << (shift - 1);
  275|       |
  276|   678k|        for(j = 0; j < row_limit_2nd_stage; j++)
  ------------------
  |  Branch (276:20): [True: 569k, False: 109k]
  ------------------
  277|   569k|        {
  278|       |            /* Checking for Zero Cols */
  279|   569k|            if((zero_cols & 1) == 1)
  ------------------
  |  Branch (279:16): [True: 152k, False: 416k]
  ------------------
  280|   152k|            {
  281|   152k|                memset(pi2_tmp, 0, trans_size * sizeof(WORD16));
  282|   152k|            }
  283|   416k|            else
  284|   416k|            {
  285|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  286|  2.08M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (286:28): [True: 1.66M, False: 416k]
  ------------------
  287|  1.66M|                {
  288|  1.66M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd]
  289|  1.66M|                                    + g_ai2_ihevc_trans_8[3][k]
  290|  1.66M|                                                    * pi2_src[3 * src_strd]
  291|  1.66M|                                    + g_ai2_ihevc_trans_8[5][k]
  292|  1.66M|                                                    * pi2_src[5 * src_strd]
  293|  1.66M|                                    + g_ai2_ihevc_trans_8[7][k]
  294|  1.66M|                                                    * pi2_src[7 * src_strd];
  295|  1.66M|                }
  296|       |
  297|   416k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd]
  298|   416k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_src[6 * src_strd];
  299|   416k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd]
  300|   416k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_src[6 * src_strd];
  301|   416k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0]
  302|   416k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_src[4 * src_strd];
  303|   416k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0]
  304|   416k|                                + g_ai2_ihevc_trans_8[4][1] * pi2_src[4 * src_strd];
  305|       |
  306|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  307|   416k|                e[0] = ee[0] + eo[0];
  308|   416k|                e[3] = ee[0] - eo[0];
  309|   416k|                e[1] = ee[1] + eo[1];
  310|   416k|                e[2] = ee[1] - eo[1];
  311|  2.08M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (311:28): [True: 1.66M, False: 416k]
  ------------------
  312|  1.66M|                {
  313|  1.66M|                    pi2_tmp[k] =
  314|  1.66M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.66M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.66M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 9.92k, False: 1.65M]
  |  |  |  |  |  Branch (40:53): [True: 8.73k, False: 1.64M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  315|  1.66M|                    pi2_tmp[k + 4] =
  316|  1.66M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  1.66M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.66M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 9.42k, False: 1.65M]
  |  |  |  |  |  Branch (40:53): [True: 8.86k, False: 1.64M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  317|  1.66M|                }
  318|   416k|            }
  319|   569k|            pi2_src++;
  320|   569k|            pi2_tmp += trans_size;
  321|   569k|            zero_cols = zero_cols >> 1;
  322|   569k|        }
  323|       |
  324|   109k|        pi2_tmp = pi2_tmp_orig;
  325|       |
  326|       |        /* Inverse Transform 2nd stage */
  327|   109k|        shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|   109k|#define IT_SHIFT_STAGE_2 12
  ------------------
  328|   109k|        add = 1 << (shift - 1);
  329|   109k|        if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
  ------------------
  |  Branch (329:12): [True: 76.6k, False: 32.8k]
  ------------------
  330|  76.6k|        {
  331|   688k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (331:24): [True: 612k, False: 76.6k]
  ------------------
  332|   612k|            {
  333|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  334|  3.05M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (334:28): [True: 2.44M, False: 612k]
  ------------------
  335|  2.44M|                {
  336|  2.44M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  337|  2.44M|                                    + g_ai2_ihevc_trans_8[3][k] * pi2_tmp[3 * trans_size];
  338|  2.44M|                }
  339|   612k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size];
  340|   612k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size];
  341|   612k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0];
  342|   612k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0];
  343|       |
  344|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  345|   612k|                e[0] = ee[0] + eo[0];
  346|   612k|                e[3] = ee[0] - eo[0];
  347|   612k|                e[1] = ee[1] + eo[1];
  348|   612k|                e[2] = ee[1] - eo[1];
  349|  3.05M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (349:28): [True: 2.44M, False: 612k]
  ------------------
  350|  2.44M|                {
  351|  2.44M|                    WORD32 itrans_out;
  352|  2.44M|                    itrans_out =
  353|  2.44M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  2.44M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.44M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  354|  2.44M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  2.44M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 553k, False: 1.89M]
  |  |  |  |  |  Branch (40:53): [True: 479k, False: 1.41M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  355|  2.44M|                    itrans_out =
  356|  2.44M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  2.44M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  2.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 2.44M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 2.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  357|  2.44M|                    pu1_dst[k + 4] = CLIP_U8((itrans_out + pu1_pred[k + 4]));
  ------------------
  |  |   40|  2.44M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  2.44M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 573k, False: 1.87M]
  |  |  |  |  |  Branch (40:53): [True: 460k, False: 1.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  358|  2.44M|                }
  359|   612k|                pi2_tmp++;
  360|   612k|                pu1_pred += pred_strd;
  361|   612k|                pu1_dst += dst_strd;
  362|   612k|            }
  363|  76.6k|        }
  364|  32.8k|        else /* All rows of output of 1st stage are non-zero */
  365|  32.8k|        {
  366|   295k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (366:24): [True: 262k, False: 32.8k]
  ------------------
  367|   262k|            {
  368|       |                /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */
  369|  1.31M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (369:28): [True: 1.05M, False: 262k]
  ------------------
  370|  1.05M|                {
  371|  1.05M|                    o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size]
  372|  1.05M|                                    + g_ai2_ihevc_trans_8[3][k]
  373|  1.05M|                                                    * pi2_tmp[3 * trans_size]
  374|  1.05M|                                    + g_ai2_ihevc_trans_8[5][k]
  375|  1.05M|                                                    * pi2_tmp[5 * trans_size]
  376|  1.05M|                                    + g_ai2_ihevc_trans_8[7][k]
  377|  1.05M|                                                    * pi2_tmp[7 * trans_size];
  378|  1.05M|                }
  379|       |
  380|   262k|                eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]
  381|   262k|                                + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size];
  382|   262k|                eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]
  383|   262k|                                + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size];
  384|   262k|                ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]
  385|   262k|                                + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size];
  386|   262k|                ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]
  387|   262k|                                + g_ai2_ihevc_trans_8[4][1] * pi2_tmp[4 * trans_size];
  388|       |
  389|       |                /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */
  390|   262k|                e[0] = ee[0] + eo[0];
  391|   262k|                e[3] = ee[0] - eo[0];
  392|   262k|                e[1] = ee[1] + eo[1];
  393|   262k|                e[2] = ee[1] - eo[1];
  394|  1.31M|                for(k = 0; k < 4; k++)
  ------------------
  |  Branch (394:28): [True: 1.04M, False: 262k]
  ------------------
  395|  1.04M|                {
  396|  1.04M|                    WORD32 itrans_out;
  397|  1.04M|                    itrans_out =
  398|  1.04M|                                    CLIP_S16(((e[k] + o[k] + add) >> shift));
  ------------------
  |  |   53|  1.04M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.04M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.04M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.04M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  399|  1.04M|                    pu1_dst[k] = CLIP_U8((itrans_out + pu1_pred[k]));
  ------------------
  |  |   40|  1.04M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.04M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 298k, False: 749k]
  |  |  |  |  |  Branch (40:53): [True: 189k, False: 560k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  400|  1.04M|                    itrans_out =
  401|  1.04M|                                    CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift));
  ------------------
  |  |   53|  1.04M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  1.04M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 1.04M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 1.04M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  402|  1.04M|                    pu1_dst[k + 4] = CLIP_U8((itrans_out + pu1_pred[k + 4]));
  ------------------
  |  |   40|  1.04M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.04M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 282k, False: 766k]
  |  |  |  |  |  Branch (40:53): [True: 184k, False: 581k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  403|  1.04M|                }
  404|   262k|                pi2_tmp++;
  405|   262k|                pu1_pred += pred_strd;
  406|   262k|                pu1_dst += dst_strd;
  407|   262k|            }
  408|  32.8k|        }
  409|       |        /************************************************************************************************/
  410|       |        /************************************END - IT_RECON_8x8******************************************/
  411|       |        /************************************************************************************************/
  412|   109k|    }
  413|   525k|}

ihevc_memcpy:
   76|  29.2M|{
   77|  29.2M|    memcpy(pu1_dst, pu1_src, num_bytes);
   78|  29.2M|}
ihevc_memcpy_mul_8:
   82|  22.3M|{
   83|  22.3M|    memcpy(pu1_dst, pu1_src, num_bytes);
   84|  22.3M|}
ihevc_memset:
  112|  17.0M|{
  113|  17.0M|    memset(pu1_dst, value, num_bytes);
  114|  17.0M|}
ihevc_memset_mul_8:
  118|  23.9M|{
  119|  23.9M|    memset(pu1_dst, value, num_bytes);
  120|  23.9M|}
ihevc_memset_16bit:
  148|  9.79M|{
  149|  9.79M|    UWORD32 i;
  150|  49.0M|    for(i = 0; i < num_words; i++)
  ------------------
  |  Branch (150:16): [True: 39.2M, False: 9.79M]
  ------------------
  151|  39.2M|    {
  152|  39.2M|        *pu2_dst++ = value;
  153|  39.2M|    }
  154|  9.79M|}

ihevc_pad_top:
  272|  18.2k|{
  273|  18.2k|    WORD32 row;
  274|       |
  275|  1.11M|    for(row = 1; row <= pad_size; row++)
  ------------------
  |  Branch (275:18): [True: 1.09M, False: 18.2k]
  ------------------
  276|  1.09M|    {
  277|  1.09M|        memcpy(pu1_src - row * src_strd, pu1_src, wd);
  278|  1.09M|    }
  279|  18.2k|}
ihevc_pad_bottom:
  326|  18.2k|{
  327|  18.2k|    WORD32 row;
  328|       |
  329|  1.11M|    for(row = 1; row <= pad_size; row++)
  ------------------
  |  Branch (329:18): [True: 1.09M, False: 18.2k]
  ------------------
  330|  1.09M|    {
  331|  1.09M|        memcpy(pu1_src + (row - 1) * src_strd,
  332|  1.09M|               pu1_src - 1 * src_strd, wd);
  333|  1.09M|    }
  334|  18.2k|}
ihevc_pad_left_luma:
  381|   473k|{
  382|   473k|    WORD32 row;
  383|       |
  384|  12.3M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (384:18): [True: 11.8M, False: 473k]
  ------------------
  385|  11.8M|    {
  386|  11.8M|        memset(pu1_src - pad_size, *pu1_src, pad_size);
  387|       |
  388|  11.8M|        pu1_src += src_strd;
  389|  11.8M|    }
  390|   473k|}
ihevc_pad_left_chroma:
  437|   482k|{
  438|   482k|    WORD32 row;
  439|   482k|    WORD32 col;
  440|   482k|    UWORD16 *pu2_src = (UWORD16 *)pu1_src;
  441|       |
  442|   482k|    src_strd >>= 1;
  443|   482k|    pad_size >>= 1;
  444|       |
  445|  6.52M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (445:18): [True: 6.04M, False: 482k]
  ------------------
  446|  6.04M|    {
  447|  6.04M|        UWORD16 u2_uv_val;
  448|       |
  449|  6.04M|        u2_uv_val = pu2_src[0];
  450|   247M|        for(col = -pad_size; col < 0; col++)
  ------------------
  |  Branch (450:30): [True: 241M, False: 6.04M]
  ------------------
  451|   241M|            pu2_src[col] = u2_uv_val;
  452|       |
  453|  6.04M|        pu2_src += src_strd;
  454|  6.04M|    }
  455|   482k|}
ihevc_pad_right_luma:
  502|   473k|{
  503|   473k|    WORD32 row;
  504|       |
  505|  12.3M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (505:18): [True: 11.8M, False: 473k]
  ------------------
  506|  11.8M|    {
  507|  11.8M|        memset(pu1_src, *(pu1_src - 1), pad_size);
  508|       |
  509|  11.8M|        pu1_src += src_strd;
  510|  11.8M|    }
  511|   473k|}
ihevc_pad_right_chroma:
  558|   473k|{
  559|   473k|    WORD32 row;
  560|   473k|    WORD32 col;
  561|   473k|    UWORD16 *pu2_src = (UWORD16 *)pu1_src;
  562|       |
  563|   473k|    src_strd >>= 1;
  564|   473k|    pad_size >>= 1;
  565|       |
  566|  6.51M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (566:18): [True: 6.04M, False: 473k]
  ------------------
  567|  6.04M|    {
  568|  6.04M|        UWORD16 u2_uv_val;
  569|       |
  570|  6.04M|        u2_uv_val = pu2_src[-1];
  571|   247M|        for(col = 0; col < pad_size; col++)
  ------------------
  |  Branch (571:22): [True: 241M, False: 6.04M]
  ------------------
  572|   241M|            pu2_src[col] = u2_uv_val;
  573|       |
  574|  6.04M|        pu2_src += src_strd;
  575|  6.04M|    }
  576|   473k|}

ihevc_recon_4x4_ttype1:
  101|   160k|{
  102|   160k|    WORD32 i, j;
  103|   160k|    WORD32 trans_size;
  104|       |
  105|   160k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  419|   160k|#define TRANS_SIZE_4   4
  ------------------
  106|       |
  107|       |    /* Reconstruction */
  108|       |
  109|   802k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (109:16): [True: 642k, False: 160k]
  ------------------
  110|   642k|    {
  111|       |        /* Checking for Zero Cols */
  112|   642k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (112:12): [True: 180k, False: 461k]
  ------------------
  113|   180k|        {
  114|   901k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (114:24): [True: 721k, False: 180k]
  ------------------
  115|   721k|            {
  116|   721k|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  117|   721k|            }
  118|   180k|        }
  119|   461k|        else
  120|   461k|        {
  121|  2.30M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (121:24): [True: 1.84M, False: 461k]
  ------------------
  122|  1.84M|            {
  123|  1.84M|                pu1_dst[j * dst_strd] =
  124|  1.84M|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  1.84M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.84M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 257k, False: 1.59M]
  |  |  |  |  |  Branch (40:53): [True: 189k, False: 1.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  125|  1.84M|            }
  126|   461k|        }
  127|   642k|        pi2_src++;
  128|   642k|        pu1_dst++;
  129|   642k|        pu1_pred++;
  130|   642k|        zero_cols = zero_cols >> 1;
  131|   642k|    }
  132|   160k|}
ihevc_recon_4x4:
  183|  6.09k|{
  184|  6.09k|    WORD32 i, j;
  185|  6.09k|    WORD32 trans_size;
  186|       |
  187|  6.09k|    trans_size = TRANS_SIZE_4;
  ------------------
  |  |  419|  6.09k|#define TRANS_SIZE_4   4
  ------------------
  188|       |
  189|       |    /* Reconstruction */
  190|       |
  191|  30.4k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (191:16): [True: 24.3k, False: 6.09k]
  ------------------
  192|  24.3k|    {
  193|       |        /* Checking for Zero Cols */
  194|  24.3k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (194:12): [True: 10.8k, False: 13.5k]
  ------------------
  195|  10.8k|        {
  196|  54.0k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (196:24): [True: 43.2k, False: 10.8k]
  ------------------
  197|  43.2k|            {
  198|  43.2k|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  199|  43.2k|            }
  200|  10.8k|        }
  201|  13.5k|        else
  202|  13.5k|        {
  203|  67.8k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (203:24): [True: 54.2k, False: 13.5k]
  ------------------
  204|  54.2k|            {
  205|  54.2k|                pu1_dst[j * dst_strd] =
  206|  54.2k|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  54.2k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  54.2k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3.82k, False: 50.4k]
  |  |  |  |  |  Branch (40:53): [True: 5.68k, False: 44.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  207|  54.2k|            }
  208|  13.5k|        }
  209|  24.3k|        pi2_src++;
  210|  24.3k|        pu1_dst++;
  211|  24.3k|        pu1_pred++;
  212|  24.3k|        zero_cols = zero_cols >> 1;
  213|  24.3k|    }
  214|  6.09k|}
ihevc_recon_8x8:
  265|  5.31k|{
  266|  5.31k|    WORD32 i, j;
  267|  5.31k|    WORD32 trans_size;
  268|       |
  269|  5.31k|    trans_size = TRANS_SIZE_8;
  ------------------
  |  |  420|  5.31k|#define TRANS_SIZE_8   8
  ------------------
  270|       |
  271|       |    /* Reconstruction */
  272|       |
  273|  47.8k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (273:16): [True: 42.4k, False: 5.31k]
  ------------------
  274|  42.4k|    {
  275|       |        /* Checking for Zero Cols */
  276|  42.4k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (276:12): [True: 30.8k, False: 11.6k]
  ------------------
  277|  30.8k|        {
  278|   277k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (278:24): [True: 246k, False: 30.8k]
  ------------------
  279|   246k|            {
  280|   246k|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  281|   246k|            }
  282|  30.8k|        }
  283|  11.6k|        else
  284|  11.6k|        {
  285|   104k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (285:24): [True: 93.2k, False: 11.6k]
  ------------------
  286|  93.2k|            {
  287|  93.2k|                pu1_dst[j * dst_strd] =
  288|  93.2k|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|  93.2k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  93.2k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 215, False: 93.0k]
  |  |  |  |  |  Branch (40:53): [True: 1.02k, False: 92.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  289|  93.2k|            }
  290|  11.6k|        }
  291|  42.4k|        pi2_src++;
  292|  42.4k|        pu1_dst++;
  293|  42.4k|        pu1_pred++;
  294|  42.4k|        zero_cols = zero_cols >> 1;
  295|  42.4k|    }
  296|  5.31k|}
ihevc_recon_16x16:
  347|  8.06k|{
  348|  8.06k|    WORD32 i, j;
  349|  8.06k|    WORD32 trans_size;
  350|       |
  351|  8.06k|    trans_size = TRANS_SIZE_16;
  ------------------
  |  |  421|  8.06k|#define TRANS_SIZE_16 16
  ------------------
  352|       |
  353|       |    /* Reconstruction */
  354|       |
  355|   137k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (355:16): [True: 129k, False: 8.06k]
  ------------------
  356|   129k|    {
  357|       |        /* Checking for Zero Cols */
  358|   129k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (358:12): [True: 105k, False: 23.1k]
  ------------------
  359|   105k|        {
  360|  1.79M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (360:24): [True: 1.69M, False: 105k]
  ------------------
  361|  1.69M|            {
  362|  1.69M|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  363|  1.69M|            }
  364|   105k|        }
  365|  23.1k|        else
  366|  23.1k|        {
  367|   394k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (367:24): [True: 371k, False: 23.1k]
  ------------------
  368|   371k|            {
  369|   371k|                pu1_dst[j * dst_strd] =
  370|   371k|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   40|   371k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   371k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 486, False: 370k]
  |  |  |  |  |  Branch (40:53): [True: 276, False: 370k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  371|   371k|            }
  372|  23.1k|        }
  373|   129k|        pi2_src++;
  374|   129k|        pu1_dst++;
  375|   129k|        pu1_pred++;
  376|   129k|        zero_cols = zero_cols >> 1;
  377|   129k|    }
  378|  8.06k|}
ihevc_recon_32x32:
  429|  7.35k|{
  430|  7.35k|    WORD32 i, j;
  431|  7.35k|    WORD32 trans_size;
  432|       |
  433|  7.35k|    trans_size = TRANS_SIZE_32;
  ------------------
  |  |  422|  7.35k|#define TRANS_SIZE_32 32
  ------------------
  434|       |
  435|       |    /* Reconstruction */
  436|       |
  437|   242k|    for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (437:16): [True: 234k, False: 7.35k]
  ------------------
  438|   234k|    {
  439|       |        /* Checking for Zero Cols */
  440|   234k|        if((zero_cols & 1) == 1)
  ------------------
  |  Branch (440:12): [True: 218k, False: 16.6k]
  ------------------
  441|   218k|        {
  442|  7.19M|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (442:24): [True: 6.97M, False: 218k]
  ------------------
  443|  6.97M|            {
  444|  6.97M|                pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd];
  445|  6.97M|            }
  446|   218k|        }
  447|  16.6k|        else
  448|  16.6k|        {
  449|   549k|            for(j = 0; j < trans_size; j++)
  ------------------
  |  Branch (449:24): [True: 532k, False: 16.6k]
  ------------------
  450|   532k|            {
  451|   532k|                pu1_dst[j * dst_strd] =
  452|   532k|                                CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]);
  ------------------
  |  |   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: 147, False: 532k]
  |  |  |  |  |  Branch (40:53): [True: 508, False: 531k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  453|   532k|            }
  454|  16.6k|        }
  455|   234k|        pi2_src++;
  456|   234k|        pu1_dst++;
  457|   234k|        pu1_pred++;
  458|   234k|        zero_cols = zero_cols >> 1;
  459|   234k|    }
  460|  7.35k|}

ihevc_sao_band_offset_luma:
   81|   233k|{
   82|   233k|    WORD32 band_shift;
   83|   233k|    WORD32 band_table[NUM_BAND_TABLE];
   84|   233k|    WORD32 i;
   85|   233k|    WORD32 row, col;
   86|       |
   87|       |    /* Updating left and top and top-left */
   88|  7.66M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (88:18): [True: 7.42M, False: 233k]
  ------------------
   89|  7.42M|    {
   90|  7.42M|        pu1_src_left[row] = pu1_src[row * src_strd + (wd - 1)];
   91|  7.42M|    }
   92|   233k|    pu1_src_top_left[0] = pu1_src_top[wd - 1];
   93|  7.81M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (93:18): [True: 7.58M, False: 233k]
  ------------------
   94|  7.58M|    {
   95|  7.58M|        pu1_src_top[col] = pu1_src[(ht - 1) * src_strd + col];
   96|  7.58M|    }
   97|       |
   98|   233k|    band_shift = BIT_DEPTH_LUMA - 5;
  ------------------
  |  |  270|   233k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  269|   233k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
   99|  7.70M|    for(i = 0; i < NUM_BAND_TABLE; i++)
  ------------------
  |  |   56|  7.70M|#define NUM_BAND_TABLE  32
  ------------------
  |  Branch (99:16): [True: 7.47M, False: 233k]
  ------------------
  100|  7.47M|    {
  101|  7.47M|        band_table[i] = 0;
  102|  7.47M|    }
  103|  1.16M|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (103:16): [True: 934k, False: 233k]
  ------------------
  104|   934k|    {
  105|   934k|        band_table[(i + sao_band_pos) & 31] = i + 1;
  106|   934k|    }
  107|       |
  108|  7.61M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (108:18): [True: 7.38M, False: 233k]
  ------------------
  109|  7.38M|    {
  110|   243M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (110:22): [True: 236M, False: 7.38M]
  ------------------
  111|   236M|        {
  112|   236M|            WORD32 band_idx;
  113|       |
  114|   236M|            band_idx = band_table[pu1_src[col] >> band_shift];
  115|   236M|            pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[band_idx], 0, (1 << (band_shift + 5)) - 1);
  ------------------
  |  |   40|   236M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 65.0k, False: 236M]
  |  |  |  Branch (40:53): [True: 115k, False: 236M]
  |  |  ------------------
  ------------------
  116|   236M|        }
  117|  7.38M|        pu1_src += src_strd;
  118|  7.38M|    }
  119|   233k|}
ihevc_sao_band_offset_chroma:
  135|   243k|{
  136|   243k|    WORD32 band_shift;
  137|   243k|    WORD32 band_table_u[NUM_BAND_TABLE];
  138|   243k|    WORD32 band_table_v[NUM_BAND_TABLE];
  139|   243k|    WORD32 i;
  140|   243k|    WORD32 row, col;
  141|       |
  142|       |    /* Updating left and top and top-left */
  143|  4.13M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (143:18): [True: 3.88M, False: 243k]
  ------------------
  144|  3.88M|    {
  145|  3.88M|        pu1_src_left[2 * row] = pu1_src[row * src_strd + (wd - 2)];
  146|  3.88M|        pu1_src_left[2 * row + 1] = pu1_src[row * src_strd + (wd - 1)];
  147|  3.88M|    }
  148|   243k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
  149|   243k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
  150|  8.20M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (150:18): [True: 7.95M, False: 243k]
  ------------------
  151|  7.95M|    {
  152|  7.95M|        pu1_src_top[col] = pu1_src[(ht - 1) * src_strd + col];
  153|  7.95M|    }
  154|       |
  155|       |
  156|   243k|    band_shift = BIT_DEPTH_CHROMA - 5;
  ------------------
  |  |  271|   243k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  269|   243k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  157|  8.04M|    for(i = 0; i < NUM_BAND_TABLE; i++)
  ------------------
  |  |   56|  8.04M|#define NUM_BAND_TABLE  32
  ------------------
  |  Branch (157:16): [True: 7.79M, False: 243k]
  ------------------
  158|  7.79M|    {
  159|  7.79M|        band_table_u[i] = 0;
  160|  7.79M|        band_table_v[i] = 0;
  161|  7.79M|    }
  162|  1.21M|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (162:16): [True: 974k, False: 243k]
  ------------------
  163|   974k|    {
  164|   974k|        band_table_u[(i + sao_band_pos_u) & 31] = i + 1;
  165|   974k|        band_table_v[(i + sao_band_pos_v) & 31] = i + 1;
  166|   974k|    }
  167|       |
  168|  4.11M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (168:18): [True: 3.87M, False: 243k]
  ------------------
  169|  3.87M|    {
  170|   128M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (170:22): [True: 125M, False: 3.87M]
  ------------------
  171|   125M|        {
  172|   125M|            WORD32 band_idx;
  173|   125M|            WORD8 *pi1_sao_offset;
  174|       |
  175|   125M|            pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (175:30): [True: 62.6M, False: 62.5M]
  ------------------
  176|   125M|            band_idx = (0 == col % 2) ? band_table_u[pu1_src[col] >> band_shift] : band_table_v[pu1_src[col] >> band_shift];
  ------------------
  |  Branch (176:24): [True: 62.6M, False: 62.5M]
  ------------------
  177|   125M|            pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[band_idx], 0, (1 << (band_shift + 5)) - 1);
  ------------------
  |  |   40|   125M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 57.5k, False: 125M]
  |  |  |  Branch (40:53): [True: 48.3k, False: 125M]
  |  |  ------------------
  ------------------
  178|   125M|        }
  179|  3.87M|        pu1_src += src_strd;
  180|  3.87M|    }
  181|   243k|}
ihevc_sao_edge_offset_class0:
  197|  84.6k|{
  198|  84.6k|    WORD32 row, col;
  199|  84.6k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  200|  84.6k|    UWORD8 au1_src_left_tmp[MAX_CTB_SIZE];
  201|  84.6k|    WORD8 u1_sign_left, u1_sign_right;
  202|  84.6k|    WORD32 bit_depth;
  203|  84.6k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  84.6k|#define UNUSED(x) ((void)(x))
  ------------------
  204|  84.6k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  84.6k|#define UNUSED(x) ((void)(x))
  ------------------
  205|  84.6k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  270|  84.6k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  269|  84.6k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  206|       |
  207|       |    /* Initialize the mask values */
  208|  84.6k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  341|  84.6k|#define MAX_CTB_SIZE        64
  ------------------
  209|       |
  210|       |    /* Update top and top-left arrays */
  211|  84.6k|    *pu1_src_top_left = pu1_src_top[wd - 1];
  212|  2.78M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (212:18): [True: 2.70M, False: 84.6k]
  ------------------
  213|  2.70M|    {
  214|  2.70M|        au1_src_left_tmp[row] = pu1_src[row * src_strd + wd - 1];
  215|  2.70M|    }
  216|  2.96M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (216:18): [True: 2.88M, False: 84.6k]
  ------------------
  217|  2.88M|    {
  218|  2.88M|        pu1_src_top[col] = pu1_src[(ht - 1) * src_strd + col];
  219|  2.88M|    }
  220|       |
  221|       |    /* Update masks based on the availability flags */
  222|  84.6k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (222:8): [True: 859, False: 83.7k]
  ------------------
  223|    859|    {
  224|    859|        au1_mask[0] = 0;
  225|    859|    }
  226|  84.6k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (226:8): [True: 5.65k, False: 78.9k]
  ------------------
  227|  5.65k|    {
  228|  5.65k|        au1_mask[wd - 1] = 0;
  229|  5.65k|    }
  230|       |
  231|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  232|  84.6k|    {
  233|  2.78M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (233:22): [True: 2.69M, False: 84.6k]
  ------------------
  234|  2.69M|        {
  235|  2.69M|            u1_sign_left = SIGN(pu1_src[0] - pu1_src_left[row]);
  ------------------
  |  |   44|  2.69M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 2.12M, False: 568k]
  |  |  |  Branch (44:34): [True: 511k, False: 1.61M]
  |  |  ------------------
  ------------------
  236|  93.6M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (236:26): [True: 90.9M, False: 2.69M]
  ------------------
  237|  90.9M|            {
  238|  90.9M|                WORD32 edge_idx;
  239|       |
  240|  90.9M|                u1_sign_right = SIGN(pu1_src[col] - pu1_src[col + 1]);
  ------------------
  |  |   44|  90.9M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 77.7M, False: 13.2M]
  |  |  |  Branch (44:34): [True: 13.7M, False: 64.0M]
  |  |  ------------------
  ------------------
  241|  90.9M|                edge_idx = 2 + u1_sign_left + u1_sign_right;
  242|  90.9M|                u1_sign_left = -u1_sign_right;
  243|       |
  244|  90.9M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col];
  245|       |
  246|  90.9M|                if(0 != edge_idx)
  ------------------
  |  Branch (246:20): [True: 18.0M, False: 72.9M]
  ------------------
  247|  18.0M|                {
  248|  18.0M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  18.0M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2.76k, False: 18.0M]
  |  |  |  Branch (40:53): [True: 28.2k, False: 17.9M]
  |  |  ------------------
  ------------------
  249|  18.0M|                }
  250|  90.9M|            }
  251|       |
  252|  2.69M|            pu1_src += src_strd;
  253|  2.69M|        }
  254|  84.6k|    }
  255|       |
  256|       |    /* Update left array */
  257|  2.78M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (257:18): [True: 2.70M, False: 84.6k]
  ------------------
  258|  2.70M|    {
  259|  2.70M|        pu1_src_left[row] = au1_src_left_tmp[row];
  260|  2.70M|    }
  261|       |
  262|  84.6k|}
ihevc_sao_edge_offset_class0_chroma:
  280|  56.2k|{
  281|  56.2k|    WORD32 row, col;
  282|  56.2k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  283|  56.2k|    UWORD8 au1_src_left_tmp[2 * MAX_CTB_SIZE];
  284|  56.2k|    WORD8 u1_sign_left_u, u1_sign_right_u;
  285|  56.2k|    WORD8 u1_sign_left_v, u1_sign_right_v;
  286|  56.2k|    WORD32 bit_depth;
  287|  56.2k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  56.2k|#define UNUSED(x) ((void)(x))
  ------------------
  288|  56.2k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  56.2k|#define UNUSED(x) ((void)(x))
  ------------------
  289|  56.2k|    bit_depth = BIT_DEPTH_CHROMA;
  ------------------
  |  |  271|  56.2k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  269|  56.2k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  290|       |
  291|       |    /* Initialize the mask values */
  292|  56.2k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  341|  56.2k|#define MAX_CTB_SIZE        64
  ------------------
  293|       |
  294|       |    /* Update left, top and top-left arrays */
  295|  56.2k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
  296|  56.2k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
  297|   952k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (297:18): [True: 895k, False: 56.2k]
  ------------------
  298|   895k|    {
  299|   895k|        au1_src_left_tmp[2 * row] = pu1_src[row * src_strd + wd - 2];
  300|   895k|        au1_src_left_tmp[2 * row + 1] = pu1_src[row * src_strd + wd - 1];
  301|   895k|    }
  302|  1.96M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (302:18): [True: 1.91M, False: 56.2k]
  ------------------
  303|  1.91M|    {
  304|  1.91M|        pu1_src_top[col] = pu1_src[(ht - 1) * src_strd + col];
  305|  1.91M|    }
  306|       |
  307|       |    /* Update masks based on the availability flags */
  308|  56.2k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (308:8): [True: 1.79k, False: 54.4k]
  ------------------
  309|  1.79k|    {
  310|  1.79k|        au1_mask[0] = 0;
  311|  1.79k|    }
  312|  56.2k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (312:8): [True: 3.73k, False: 52.5k]
  ------------------
  313|  3.73k|    {
  314|  3.73k|        au1_mask[(wd - 1) >> 1] = 0;
  315|  3.73k|    }
  316|       |
  317|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  318|  56.2k|    {
  319|   951k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (319:22): [True: 895k, False: 56.2k]
  ------------------
  320|   895k|        {
  321|   895k|            u1_sign_left_u = SIGN(pu1_src[0] - pu1_src_left[2 * row]);
  ------------------
  |  |   44|   895k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 703k, False: 191k]
  |  |  |  Branch (44:34): [True: 211k, False: 491k]
  |  |  ------------------
  ------------------
  322|   895k|            u1_sign_left_v = SIGN(pu1_src[1] - pu1_src_left[2 * row + 1]);
  ------------------
  |  |   44|   895k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 706k, False: 188k]
  |  |  |  Branch (44:34): [True: 165k, False: 540k]
  |  |  ------------------
  ------------------
  323|  31.2M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (323:26): [True: 30.3M, False: 895k]
  ------------------
  324|  30.3M|            {
  325|  30.3M|                WORD32 edge_idx;
  326|  30.3M|                WORD8 *pi1_sao_offset;
  327|       |
  328|  30.3M|                if(0 == col % 2)
  ------------------
  |  Branch (328:20): [True: 15.2M, False: 15.1M]
  ------------------
  329|  15.2M|                {
  330|  15.2M|                    pi1_sao_offset = pi1_sao_offset_u;
  331|  15.2M|                    u1_sign_right_u = SIGN(pu1_src[col] - pu1_src[col + 2]);
  ------------------
  |  |   44|  15.2M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 12.5M, False: 2.67M]
  |  |  |  Branch (44:34): [True: 2.60M, False: 9.91M]
  |  |  ------------------
  ------------------
  332|  15.2M|                    edge_idx = 2 + u1_sign_left_u + u1_sign_right_u;
  333|  15.2M|                    u1_sign_left_u = -u1_sign_right_u;
  334|  15.2M|                }
  335|  15.1M|                else
  336|  15.1M|                {
  337|  15.1M|                    pi1_sao_offset = pi1_sao_offset_v;
  338|  15.1M|                    u1_sign_right_v = SIGN(pu1_src[col] - pu1_src[col + 2]);
  ------------------
  |  |   44|  15.1M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 13.1M, False: 2.05M]
  |  |  |  Branch (44:34): [True: 2.26M, False: 10.8M]
  |  |  ------------------
  ------------------
  339|  15.1M|                    edge_idx = 2 + u1_sign_left_v + u1_sign_right_v;
  340|  15.1M|                    u1_sign_left_v = -u1_sign_right_v;
  341|  15.1M|                }
  342|       |
  343|  30.3M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col >> 1];
  344|       |
  345|  30.3M|                if(0 != edge_idx)
  ------------------
  |  Branch (345:20): [True: 4.68M, False: 25.7M]
  ------------------
  346|  4.68M|                {
  347|  4.68M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  4.68M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.00k, False: 4.68M]
  |  |  |  Branch (40:53): [True: 1.74k, False: 4.68M]
  |  |  ------------------
  ------------------
  348|  4.68M|                }
  349|  30.3M|            }
  350|       |
  351|   895k|            pu1_src += src_strd;
  352|   895k|        }
  353|  56.2k|    }
  354|       |
  355|  1.84M|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (355:18): [True: 1.79M, False: 56.2k]
  ------------------
  356|  1.79M|    {
  357|  1.79M|        pu1_src_left[row] = au1_src_left_tmp[row];
  358|  1.79M|    }
  359|       |
  360|  56.2k|}
ihevc_sao_edge_offset_class1:
  376|  57.8k|{
  377|  57.8k|    WORD32 row, col;
  378|  57.8k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  379|  57.8k|    UWORD8 au1_src_top_tmp[MAX_CTB_SIZE];
  380|  57.8k|    WORD8 au1_sign_up[MAX_CTB_SIZE];
  381|  57.8k|    WORD8 u1_sign_down;
  382|  57.8k|    WORD32 bit_depth;
  383|  57.8k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  57.8k|#define UNUSED(x) ((void)(x))
  ------------------
  384|  57.8k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  57.8k|#define UNUSED(x) ((void)(x))
  ------------------
  385|       |
  386|  57.8k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  270|  57.8k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  269|  57.8k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  387|       |
  388|       |    /* Initialize the mask values */
  389|  57.8k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  341|  57.8k|#define MAX_CTB_SIZE        64
  ------------------
  390|       |
  391|       |    /* Update left, top and top-left arrays */
  392|  57.8k|    *pu1_src_top_left = pu1_src_top[wd - 1];
  393|  1.89M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (393:18): [True: 1.83M, False: 57.8k]
  ------------------
  394|  1.83M|    {
  395|  1.83M|        pu1_src_left[row] = pu1_src[row * src_strd + wd - 1];
  396|  1.83M|    }
  397|  1.93M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (397:18): [True: 1.87M, False: 57.8k]
  ------------------
  398|  1.87M|    {
  399|  1.87M|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
  400|  1.87M|    }
  401|       |
  402|       |    /* Update height and source pointers based on the availability flags */
  403|  57.8k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (403:8): [True: 2.45k, False: 55.3k]
  ------------------
  404|  2.45k|    {
  405|  2.45k|        pu1_src += src_strd;
  406|  2.45k|        ht--;
  407|  83.3k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (407:22): [True: 80.9k, False: 2.45k]
  ------------------
  408|  80.9k|        {
  409|  80.9k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col - src_strd]);
  ------------------
  |  |   44|  80.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 76.3k, False: 4.56k]
  |  |  |  Branch (44:34): [True: 4.95k, False: 71.4k]
  |  |  ------------------
  ------------------
  410|  80.9k|        }
  411|  2.45k|    }
  412|  55.3k|    else
  413|  55.3k|    {
  414|  1.85M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (414:22): [True: 1.79M, False: 55.3k]
  ------------------
  415|  1.79M|        {
  416|  1.79M|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col]);
  ------------------
  |  |   44|  1.79M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.48M, False: 309k]
  |  |  |  Branch (44:34): [True: 289k, False: 1.19M]
  |  |  ------------------
  ------------------
  417|  1.79M|        }
  418|  55.3k|    }
  419|  57.8k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (419:8): [True: 1.28k, False: 56.5k]
  ------------------
  420|  1.28k|    {
  421|  1.28k|        ht--;
  422|  1.28k|    }
  423|       |
  424|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  425|  57.8k|    {
  426|  1.89M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (426:22): [True: 1.83M, False: 57.8k]
  ------------------
  427|  1.83M|        {
  428|  61.1M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (428:26): [True: 59.3M, False: 1.83M]
  ------------------
  429|  59.3M|            {
  430|  59.3M|                WORD32 edge_idx;
  431|       |
  432|  59.3M|                u1_sign_down = SIGN(pu1_src[col] - pu1_src[col + src_strd]);
  ------------------
  |  |   44|  59.3M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 52.7M, False: 6.53M]
  |  |  |  Branch (44:34): [True: 7.72M, False: 45.0M]
  |  |  ------------------
  ------------------
  433|  59.3M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
  434|  59.3M|                au1_sign_up[col] = -u1_sign_down;
  435|       |
  436|  59.3M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col];
  437|       |
  438|  59.3M|                if(0 != edge_idx)
  ------------------
  |  Branch (438:20): [True: 8.90M, False: 50.4M]
  ------------------
  439|  8.90M|                {
  440|  8.90M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  8.90M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3.53k, False: 8.89M]
  |  |  |  Branch (40:53): [True: 2.95k, False: 8.89M]
  |  |  ------------------
  ------------------
  441|  8.90M|                }
  442|  59.3M|            }
  443|       |
  444|  1.83M|            pu1_src += src_strd;
  445|  1.83M|        }
  446|  57.8k|    }
  447|       |
  448|  1.93M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (448:18): [True: 1.88M, False: 57.8k]
  ------------------
  449|  1.88M|    {
  450|  1.88M|        pu1_src_top[col] = au1_src_top_tmp[col];
  451|  1.88M|    }
  452|       |
  453|  57.8k|}
ihevc_sao_edge_offset_class1_chroma:
  470|  57.1k|{
  471|  57.1k|    WORD32 row, col;
  472|  57.1k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  473|  57.1k|    UWORD8 au1_src_top_tmp[MAX_CTB_SIZE];
  474|  57.1k|    WORD8 au1_sign_up[MAX_CTB_SIZE];
  475|  57.1k|    WORD8 u1_sign_down;
  476|  57.1k|    WORD32 bit_depth;
  477|  57.1k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  57.1k|#define UNUSED(x) ((void)(x))
  ------------------
  478|  57.1k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  57.1k|#define UNUSED(x) ((void)(x))
  ------------------
  479|       |
  480|  57.1k|    bit_depth = BIT_DEPTH_CHROMA;
  ------------------
  |  |  271|  57.1k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  269|  57.1k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  481|       |
  482|       |    /* Initialize the mask values */
  483|  57.1k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  341|  57.1k|#define MAX_CTB_SIZE        64
  ------------------
  484|       |
  485|       |    /* Update left, top and top-left arrays */
  486|  57.1k|    pu1_src_top_left[0] = pu1_src_top[wd - 2];
  487|  57.1k|    pu1_src_top_left[1] = pu1_src_top[wd - 1];
  488|   964k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (488:18): [True: 907k, False: 57.1k]
  ------------------
  489|   907k|    {
  490|   907k|        pu1_src_left[2 * row] = pu1_src[row * src_strd + wd - 2];
  491|   907k|        pu1_src_left[2 * row + 1] = pu1_src[row * src_strd + wd - 1];
  492|   907k|    }
  493|  1.89M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (493:18): [True: 1.83M, False: 57.1k]
  ------------------
  494|  1.83M|    {
  495|  1.83M|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
  496|  1.83M|    }
  497|       |
  498|       |    /* Update height and source pointers based on the availability flags */
  499|  57.1k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (499:8): [True: 2.50k, False: 54.6k]
  ------------------
  500|  2.50k|    {
  501|  2.50k|        pu1_src += src_strd;
  502|  2.50k|        ht--;
  503|  80.9k|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (503:22): [True: 78.4k, False: 2.50k]
  ------------------
  504|  78.4k|        {
  505|  78.4k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col - src_strd]);
  ------------------
  |  |   44|  78.4k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 77.5k, False: 894]
  |  |  |  Branch (44:34): [True: 736, False: 76.8k]
  |  |  ------------------
  ------------------
  506|  78.4k|        }
  507|  2.50k|    }
  508|  54.6k|    else
  509|  54.6k|    {
  510|  1.81M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (510:22): [True: 1.76M, False: 54.6k]
  ------------------
  511|  1.76M|        {
  512|  1.76M|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col]);
  ------------------
  |  |   44|  1.76M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.39M, False: 361k]
  |  |  |  Branch (44:34): [True: 351k, False: 1.04M]
  |  |  ------------------
  ------------------
  513|  1.76M|        }
  514|  54.6k|    }
  515|  57.1k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (515:8): [True: 1.14k, False: 55.9k]
  ------------------
  516|  1.14k|    {
  517|  1.14k|        ht--;
  518|  1.14k|    }
  519|       |
  520|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  521|  57.1k|    {
  522|   960k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (522:22): [True: 903k, False: 57.1k]
  ------------------
  523|   903k|        {
  524|  29.8M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (524:26): [True: 28.9M, False: 903k]
  ------------------
  525|  28.9M|            {
  526|  28.9M|                WORD32 edge_idx;
  527|  28.9M|                WORD8 *pi1_sao_offset;
  528|       |
  529|  28.9M|                pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (529:34): [True: 14.4M, False: 14.4M]
  ------------------
  530|       |
  531|  28.9M|                u1_sign_down = SIGN(pu1_src[col] - pu1_src[col + src_strd]);
  ------------------
  |  |   44|  28.9M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 24.0M, False: 4.89M]
  |  |  |  Branch (44:34): [True: 4.79M, False: 19.2M]
  |  |  ------------------
  ------------------
  532|  28.9M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
  533|  28.9M|                au1_sign_up[col] = -u1_sign_down;
  534|       |
  535|  28.9M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col >> 1];
  536|       |
  537|  28.9M|                if(0 != edge_idx)
  ------------------
  |  Branch (537:20): [True: 4.37M, False: 24.5M]
  ------------------
  538|  4.37M|                {
  539|  4.37M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  4.37M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.44k, False: 4.36M]
  |  |  |  Branch (40:53): [True: 342, False: 4.36M]
  |  |  ------------------
  ------------------
  540|  4.37M|                }
  541|  28.9M|            }
  542|       |
  543|   903k|            pu1_src += src_strd;
  544|   903k|        }
  545|  57.1k|    }
  546|       |
  547|  1.89M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (547:18): [True: 1.83M, False: 57.1k]
  ------------------
  548|  1.83M|    {
  549|  1.83M|        pu1_src_top[col] = au1_src_top_tmp[col];
  550|  1.83M|    }
  551|       |
  552|  57.1k|}
ihevc_sao_edge_offset_class2:
  568|  47.4k|{
  569|  47.4k|    WORD32 row, col;
  570|  47.4k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  571|  47.4k|    UWORD8 au1_src_left_tmp[MAX_CTB_SIZE], au1_src_top_tmp[MAX_CTB_SIZE];
  572|  47.4k|    UWORD8 u1_src_top_left_tmp;
  573|  47.4k|    WORD8 au1_sign_up[MAX_CTB_SIZE + 1], au1_sign_up_tmp[MAX_CTB_SIZE + 1];
  574|  47.4k|    WORD8 u1_sign_down;
  575|  47.4k|    WORD8 *pu1_sign_up;
  576|  47.4k|    WORD8 *pu1_sign_up_tmp;
  577|  47.4k|    UWORD8 *pu1_src_left_cpy;
  578|       |
  579|  47.4k|    WORD32 bit_depth;
  580|  47.4k|    UWORD8 u1_pos_0_0_tmp;
  581|  47.4k|    UWORD8 u1_pos_wd_ht_tmp;
  582|  47.4k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  47.4k|#define UNUSED(x) ((void)(x))
  ------------------
  583|  47.4k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  47.4k|#define UNUSED(x) ((void)(x))
  ------------------
  584|       |
  585|  47.4k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  270|  47.4k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  269|  47.4k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  586|  47.4k|    pu1_sign_up = au1_sign_up;
  587|  47.4k|    pu1_sign_up_tmp = au1_sign_up_tmp;
  588|  47.4k|    pu1_src_left_cpy = pu1_src_left;
  589|       |
  590|       |    /* Initialize the mask values */
  591|  47.4k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  341|  47.4k|#define MAX_CTB_SIZE        64
  ------------------
  592|       |
  593|       |    /* Update left, top and top-left arrays */
  594|  47.4k|    u1_src_top_left_tmp = pu1_src_top[wd - 1];
  595|  1.55M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (595:18): [True: 1.50M, False: 47.4k]
  ------------------
  596|  1.50M|    {
  597|  1.50M|        au1_src_left_tmp[row] = pu1_src[row * src_strd + wd - 1];
  598|  1.50M|    }
  599|  1.58M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (599:18): [True: 1.53M, False: 47.4k]
  ------------------
  600|  1.53M|    {
  601|  1.53M|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
  602|  1.53M|    }
  603|       |
  604|       |
  605|       |    /* If top-left is available, process separately */
  606|  47.4k|    if(0 != pu1_avail[4])
  ------------------
  |  Branch (606:8): [True: 44.0k, False: 3.44k]
  ------------------
  607|  44.0k|    {
  608|  44.0k|        WORD32 edge_idx;
  609|       |
  610|  44.0k|        edge_idx = 2 + SIGN(pu1_src[0] - pu1_src_top_left[0]) +
  ------------------
  |  |   44|  44.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 37.1k, False: 6.91k]
  |  |  |  Branch (44:34): [True: 11.7k, False: 25.3k]
  |  |  ------------------
  ------------------
  611|  44.0k|                        SIGN(pu1_src[0] - pu1_src[1 + src_strd]);
  ------------------
  |  |   44|  44.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 34.8k, False: 9.14k]
  |  |  |  Branch (44:34): [True: 6.62k, False: 28.2k]
  |  |  ------------------
  ------------------
  612|       |
  613|  44.0k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  614|       |
  615|  44.0k|        if(0 != edge_idx)
  ------------------
  |  Branch (615:12): [True: 12.6k, False: 31.3k]
  ------------------
  616|  12.6k|        {
  617|  12.6k|            u1_pos_0_0_tmp = CLIP3(pu1_src[0] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  12.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1, False: 12.6k]
  |  |  |  Branch (40:53): [True: 9, False: 12.6k]
  |  |  ------------------
  ------------------
  618|  12.6k|        }
  619|  31.3k|        else
  620|  31.3k|        {
  621|  31.3k|            u1_pos_0_0_tmp = pu1_src[0];
  622|  31.3k|        }
  623|  44.0k|    }
  624|  3.44k|    else
  625|  3.44k|    {
  626|  3.44k|        u1_pos_0_0_tmp = pu1_src[0];
  627|  3.44k|    }
  628|       |
  629|       |    /* If bottom-right is available, process separately */
  630|  47.4k|    if(0 != pu1_avail[7])
  ------------------
  |  Branch (630:8): [True: 45.0k, False: 2.38k]
  ------------------
  631|  45.0k|    {
  632|  45.0k|        WORD32 edge_idx;
  633|       |
  634|  45.0k|        edge_idx = 2 + SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd - 1 - src_strd]) +
  ------------------
  |  |   44|  45.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 37.7k, False: 7.38k]
  |  |  |  Branch (44:34): [True: 6.03k, False: 31.6k]
  |  |  ------------------
  ------------------
  635|  45.0k|                        SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd + 1 + src_strd]);
  ------------------
  |  |   44|  45.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 36.2k, False: 8.82k]
  |  |  |  Branch (44:34): [True: 12.0k, False: 24.2k]
  |  |  ------------------
  ------------------
  636|       |
  637|  45.0k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  638|       |
  639|  45.0k|        if(0 != edge_idx)
  ------------------
  |  Branch (639:12): [True: 13.6k, False: 31.4k]
  ------------------
  640|  13.6k|        {
  641|  13.6k|            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|  13.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 3, False: 13.6k]
  |  |  |  Branch (40:53): [True: 14, False: 13.6k]
  |  |  ------------------
  ------------------
  642|  13.6k|        }
  643|  31.4k|        else
  644|  31.4k|        {
  645|  31.4k|            u1_pos_wd_ht_tmp = pu1_src[wd - 1 + (ht - 1) * src_strd];
  646|  31.4k|        }
  647|  45.0k|    }
  648|  2.38k|    else
  649|  2.38k|    {
  650|  2.38k|        u1_pos_wd_ht_tmp = pu1_src[wd - 1 + (ht - 1) * src_strd];
  651|  2.38k|    }
  652|       |
  653|       |    /* If Left is not available */
  654|  47.4k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (654:8): [True: 752, False: 46.7k]
  ------------------
  655|    752|    {
  656|    752|        au1_mask[0] = 0;
  657|    752|    }
  658|       |
  659|       |    /* If Top is not available */
  660|  47.4k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (660:8): [True: 2.74k, False: 44.7k]
  ------------------
  661|  2.74k|    {
  662|  2.74k|        pu1_src += src_strd;
  663|  2.74k|        ht--;
  664|  2.74k|        pu1_src_left_cpy += 1;
  665|  85.9k|        for(col = 1; col < wd; col++)
  ------------------
  |  Branch (665:22): [True: 83.2k, False: 2.74k]
  ------------------
  666|  83.2k|        {
  667|  83.2k|            pu1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col - 1 - src_strd]);
  ------------------
  |  |   44|  83.2k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 68.5k, False: 14.6k]
  |  |  |  Branch (44:34): [True: 10.9k, False: 57.5k]
  |  |  ------------------
  ------------------
  668|  83.2k|        }
  669|  2.74k|    }
  670|  44.7k|    else
  671|  44.7k|    {
  672|  1.45M|        for(col = 1; col < wd; col++)
  ------------------
  |  Branch (672:22): [True: 1.40M, False: 44.7k]
  ------------------
  673|  1.40M|        {
  674|  1.40M|            pu1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col - 1]);
  ------------------
  |  |   44|  1.40M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.14M, False: 263k]
  |  |  |  Branch (44:34): [True: 312k, False: 832k]
  |  |  ------------------
  ------------------
  675|  1.40M|        }
  676|  44.7k|    }
  677|       |
  678|       |    /* If Right is not available */
  679|  47.4k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (679:8): [True: 756, False: 46.7k]
  ------------------
  680|    756|    {
  681|    756|        au1_mask[wd - 1] = 0;
  682|    756|    }
  683|       |
  684|       |    /* If Bottom is not available */
  685|  47.4k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (685:8): [True: 1.63k, False: 45.8k]
  ------------------
  686|  1.63k|    {
  687|  1.63k|        ht--;
  688|  1.63k|    }
  689|       |
  690|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  691|  47.4k|    {
  692|  1.54M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (692:22): [True: 1.49M, False: 47.4k]
  ------------------
  693|  1.49M|        {
  694|  1.49M|            pu1_sign_up[0] = SIGN(pu1_src[0] - pu1_src_left_cpy[row - 1]);
  ------------------
  |  |   44|  1.49M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.19M, False: 301k]
  |  |  |  Branch (44:34): [True: 344k, False: 851k]
  |  |  ------------------
  ------------------
  695|  49.5M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (695:26): [True: 48.0M, False: 1.49M]
  ------------------
  696|  48.0M|            {
  697|  48.0M|                WORD32 edge_idx;
  698|       |
  699|  48.0M|                u1_sign_down = SIGN(pu1_src[col] - pu1_src[col + 1 + src_strd]);
  ------------------
  |  |   44|  48.0M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 40.3M, False: 7.71M]
  |  |  |  Branch (44:34): [True: 7.78M, False: 32.5M]
  |  |  ------------------
  ------------------
  700|  48.0M|                edge_idx = 2 + pu1_sign_up[col] + u1_sign_down;
  701|  48.0M|                pu1_sign_up_tmp[col + 1] = -u1_sign_down;
  702|       |
  703|  48.0M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col];
  704|       |
  705|  48.0M|                if(0 != edge_idx)
  ------------------
  |  Branch (705:20): [True: 10.3M, False: 37.7M]
  ------------------
  706|  10.3M|                {
  707|  10.3M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  10.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.61k, False: 10.3M]
  |  |  |  Branch (40:53): [True: 5.37k, False: 10.3M]
  |  |  ------------------
  ------------------
  708|  10.3M|                }
  709|  48.0M|            }
  710|       |
  711|       |            /* Swapping pu1_sign_up_tmp and pu1_sign_up */
  712|  1.49M|            {
  713|  1.49M|                WORD8 *pu1_swap_tmp = pu1_sign_up;
  714|  1.49M|                pu1_sign_up = pu1_sign_up_tmp;
  715|  1.49M|                pu1_sign_up_tmp = pu1_swap_tmp;
  716|  1.49M|            }
  717|       |
  718|  1.49M|            pu1_src += src_strd;
  719|  1.49M|        }
  720|       |
  721|  47.4k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd] = u1_pos_0_0_tmp;
  ------------------
  |  Branch (721:19): [True: 44.7k, False: 2.75k]
  ------------------
  722|  47.4k|        pu1_src[(pu1_avail[3] ? wd - 1 - src_strd : wd - 1)] = u1_pos_wd_ht_tmp;
  ------------------
  |  Branch (722:18): [True: 45.8k, False: 1.64k]
  ------------------
  723|  47.4k|    }
  724|       |
  725|  47.4k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (725:8): [True: 2.74k, False: 44.7k]
  ------------------
  726|  2.74k|        ht++;
  727|  47.4k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (727:8): [True: 1.63k, False: 45.8k]
  ------------------
  728|  1.63k|        ht++;
  729|  47.4k|    *pu1_src_top_left = u1_src_top_left_tmp;
  730|  1.55M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (730:18): [True: 1.50M, False: 47.4k]
  ------------------
  731|  1.50M|    {
  732|  1.50M|        pu1_src_left[row] = au1_src_left_tmp[row];
  733|  1.50M|    }
  734|  1.58M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (734:18): [True: 1.53M, False: 47.4k]
  ------------------
  735|  1.53M|    {
  736|  1.53M|        pu1_src_top[col] = au1_src_top_tmp[col];
  737|  1.53M|    }
  738|       |
  739|  47.4k|}
ihevc_sao_edge_offset_class2_chroma:
  757|  51.8k|{
  758|  51.8k|    WORD32 row, col;
  759|  51.8k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  760|  51.8k|    UWORD8 au1_src_left_tmp[2 * MAX_CTB_SIZE], au1_src_top_tmp[MAX_CTB_SIZE];
  761|  51.8k|    UWORD8 au1_src_top_left_tmp[2];
  762|  51.8k|    WORD8 au1_sign_up[MAX_CTB_SIZE + 2], au1_sign_up_tmp[MAX_CTB_SIZE + 2];
  763|  51.8k|    WORD8 u1_sign_down;
  764|  51.8k|    WORD8 *pu1_sign_up;
  765|  51.8k|    WORD8 *pu1_sign_up_tmp;
  766|  51.8k|    UWORD8 *pu1_src_left_cpy;
  767|       |
  768|  51.8k|    WORD32 bit_depth;
  769|       |
  770|  51.8k|    UWORD8 u1_pos_0_0_tmp_u;
  771|  51.8k|    UWORD8 u1_pos_0_0_tmp_v;
  772|  51.8k|    UWORD8 u1_pos_wd_ht_tmp_u;
  773|  51.8k|    UWORD8 u1_pos_wd_ht_tmp_v;
  774|  51.8k|    UNUSED(pu1_src_top_right);
  ------------------
  |  |   38|  51.8k|#define UNUSED(x) ((void)(x))
  ------------------
  775|  51.8k|    UNUSED(pu1_src_bot_left);
  ------------------
  |  |   38|  51.8k|#define UNUSED(x) ((void)(x))
  ------------------
  776|       |
  777|       |
  778|  51.8k|    bit_depth = BIT_DEPTH_CHROMA;
  ------------------
  |  |  271|  51.8k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  269|  51.8k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  779|  51.8k|    pu1_sign_up = au1_sign_up;
  780|  51.8k|    pu1_sign_up_tmp = au1_sign_up_tmp;
  781|  51.8k|    pu1_src_left_cpy = pu1_src_left;
  782|       |
  783|       |    /* Initialize the mask values */
  784|  51.8k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  341|  51.8k|#define MAX_CTB_SIZE        64
  ------------------
  785|       |
  786|       |    /* Update left, top and top-left arrays */
  787|  51.8k|    au1_src_top_left_tmp[0] = pu1_src_top[wd - 2];
  788|  51.8k|    au1_src_top_left_tmp[1] = pu1_src_top[wd - 1];
  789|   877k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (789:18): [True: 825k, False: 51.8k]
  ------------------
  790|   825k|    {
  791|   825k|        au1_src_left_tmp[2 * row] = pu1_src[row * src_strd + wd - 2];
  792|   825k|        au1_src_left_tmp[2 * row + 1] = pu1_src[row * src_strd + wd - 1];
  793|   825k|    }
  794|  1.73M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (794:18): [True: 1.68M, False: 51.8k]
  ------------------
  795|  1.68M|    {
  796|  1.68M|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
  797|  1.68M|    }
  798|       |
  799|       |
  800|       |    /* If top-left is available, process separately */
  801|  51.8k|    if(0 != pu1_avail[4])
  ------------------
  |  Branch (801:8): [True: 46.9k, False: 4.88k]
  ------------------
  802|  46.9k|    {
  803|  46.9k|        WORD32 edge_idx;
  804|       |
  805|       |        /* U */
  806|  46.9k|        edge_idx = 2 + SIGN(pu1_src[0] - pu1_src_top_left[0]) +
  ------------------
  |  |   44|  46.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 36.5k, False: 10.4k]
  |  |  |  Branch (44:34): [True: 9.71k, False: 26.7k]
  |  |  ------------------
  ------------------
  807|  46.9k|                        SIGN(pu1_src[0] - pu1_src[2 + src_strd]);
  ------------------
  |  |   44|  46.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 37.7k, False: 9.24k]
  |  |  |  Branch (44:34): [True: 8.74k, False: 28.9k]
  |  |  ------------------
  ------------------
  808|       |
  809|  46.9k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  810|       |
  811|  46.9k|        if(0 != edge_idx)
  ------------------
  |  Branch (811:12): [True: 9.86k, False: 37.0k]
  ------------------
  812|  9.86k|        {
  813|  9.86k|            u1_pos_0_0_tmp_u = CLIP3(pu1_src[0] + pi1_sao_offset_u[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  9.86k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2, False: 9.85k]
  |  |  |  Branch (40:53): [True: 0, False: 9.85k]
  |  |  ------------------
  ------------------
  814|  9.86k|        }
  815|  37.0k|        else
  816|  37.0k|        {
  817|  37.0k|            u1_pos_0_0_tmp_u = pu1_src[0];
  818|  37.0k|        }
  819|       |
  820|       |        /* V */
  821|  46.9k|        edge_idx = 2 + SIGN(pu1_src[1] - pu1_src_top_left[1]) +
  ------------------
  |  |   44|  46.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 36.6k, False: 10.3k]
  |  |  |  Branch (44:34): [True: 10.7k, False: 25.8k]
  |  |  ------------------
  ------------------
  822|  46.9k|                        SIGN(pu1_src[1] - pu1_src[1 + 2 + src_strd]);
  ------------------
  |  |   44|  46.9k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 36.4k, False: 10.5k]
  |  |  |  Branch (44:34): [True: 8.87k, False: 27.5k]
  |  |  ------------------
  ------------------
  823|       |
  824|  46.9k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  825|       |
  826|  46.9k|        if(0 != edge_idx)
  ------------------
  |  Branch (826:12): [True: 10.7k, False: 36.2k]
  ------------------
  827|  10.7k|        {
  828|  10.7k|            u1_pos_0_0_tmp_v = CLIP3(pu1_src[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: 0, False: 10.7k]
  |  |  |  Branch (40:53): [True: 2, False: 10.7k]
  |  |  ------------------
  ------------------
  829|  10.7k|        }
  830|  36.2k|        else
  831|  36.2k|        {
  832|  36.2k|            u1_pos_0_0_tmp_v = pu1_src[1];
  833|  36.2k|        }
  834|  46.9k|    }
  835|  4.88k|    else
  836|  4.88k|    {
  837|  4.88k|        u1_pos_0_0_tmp_u = pu1_src[0];
  838|  4.88k|        u1_pos_0_0_tmp_v = pu1_src[1];
  839|  4.88k|    }
  840|       |
  841|       |    /* If bottom-right is available, process separately */
  842|  51.8k|    if(0 != pu1_avail[7])
  ------------------
  |  Branch (842:8): [True: 48.4k, False: 3.36k]
  ------------------
  843|  48.4k|    {
  844|  48.4k|        WORD32 edge_idx;
  845|       |
  846|       |        /* U */
  847|  48.4k|        edge_idx = 2 + SIGN(pu1_src[wd - 2 + (ht - 1) * src_strd] - pu1_src[wd - 2 + (ht - 1) * src_strd - 2 - src_strd]) +
  ------------------
  |  |   44|  48.4k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 36.9k, False: 11.4k]
  |  |  |  Branch (44:34): [True: 11.4k, False: 25.5k]
  |  |  ------------------
  ------------------
  848|  48.4k|                        SIGN(pu1_src[wd - 2 + (ht - 1) * src_strd] - pu1_src[wd - 2 + (ht - 1) * src_strd + 2 + src_strd]);
  ------------------
  |  |   44|  48.4k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 36.5k, False: 11.9k]
  |  |  |  Branch (44:34): [True: 12.8k, False: 23.6k]
  |  |  ------------------
  ------------------
  849|       |
  850|  48.4k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  851|       |
  852|  48.4k|        if(0 != edge_idx)
  ------------------
  |  Branch (852:12): [True: 11.9k, False: 36.5k]
  ------------------
  853|  11.9k|        {
  854|  11.9k|            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|  11.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 11.9k]
  |  |  |  Branch (40:53): [True: 1, False: 11.9k]
  |  |  ------------------
  ------------------
  855|  11.9k|        }
  856|  36.5k|        else
  857|  36.5k|        {
  858|  36.5k|            u1_pos_wd_ht_tmp_u = pu1_src[wd - 2 + (ht - 1) * src_strd];
  859|  36.5k|        }
  860|       |
  861|       |        /* V */
  862|  48.4k|        edge_idx = 2 + SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd - 2 - src_strd]) +
  ------------------
  |  |   44|  48.4k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 36.9k, False: 11.4k]
  |  |  |  Branch (44:34): [True: 10.3k, False: 26.5k]
  |  |  ------------------
  ------------------
  863|  48.4k|                        SIGN(pu1_src[wd - 1 + (ht - 1) * src_strd] - pu1_src[wd - 1 + (ht - 1) * src_strd + 2 + src_strd]);
  ------------------
  |  |   44|  48.4k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 38.4k, False: 10.0k]
  |  |  |  Branch (44:34): [True: 13.3k, False: 25.0k]
  |  |  ------------------
  ------------------
  864|       |
  865|  48.4k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
  866|       |
  867|  48.4k|        if(0 != edge_idx)
  ------------------
  |  Branch (867:12): [True: 10.2k, False: 38.2k]
  ------------------
  868|  10.2k|        {
  869|  10.2k|            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|  10.2k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 10.2k]
  |  |  |  Branch (40:53): [True: 0, False: 10.2k]
  |  |  ------------------
  ------------------
  870|  10.2k|        }
  871|  38.2k|        else
  872|  38.2k|        {
  873|  38.2k|            u1_pos_wd_ht_tmp_v = pu1_src[wd - 1 + (ht - 1) * src_strd];
  874|  38.2k|        }
  875|  48.4k|    }
  876|  3.36k|    else
  877|  3.36k|    {
  878|  3.36k|        u1_pos_wd_ht_tmp_u = pu1_src[wd - 2 + (ht - 1) * src_strd];
  879|  3.36k|        u1_pos_wd_ht_tmp_v = pu1_src[wd - 1 + (ht - 1) * src_strd];
  880|  3.36k|    }
  881|       |
  882|       |    /* If Left is not available */
  883|  51.8k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (883:8): [True: 2.87k, False: 48.9k]
  ------------------
  884|  2.87k|    {
  885|  2.87k|        au1_mask[0] = 0;
  886|  2.87k|    }
  887|       |
  888|       |    /* If Top is not available */
  889|  51.8k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (889:8): [True: 2.46k, False: 49.3k]
  ------------------
  890|  2.46k|    {
  891|  2.46k|        pu1_src += src_strd;
  892|  2.46k|        pu1_src_left_cpy += 2;
  893|  2.46k|        ht--;
  894|  76.6k|        for(col = 2; col < wd; col++)
  ------------------
  |  Branch (894:22): [True: 74.1k, False: 2.46k]
  ------------------
  895|  74.1k|        {
  896|  74.1k|            pu1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col - 2 - src_strd]);
  ------------------
  |  |   44|  74.1k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 73.4k, False: 704]
  |  |  |  Branch (44:34): [True: 1.46k, False: 71.9k]
  |  |  ------------------
  ------------------
  897|  74.1k|        }
  898|  2.46k|    }
  899|  49.3k|    else
  900|  49.3k|    {
  901|  1.55M|        for(col = 2; col < wd; col++)
  ------------------
  |  Branch (901:22): [True: 1.50M, False: 49.3k]
  ------------------
  902|  1.50M|        {
  903|  1.50M|            pu1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col - 2]);
  ------------------
  |  |   44|  1.50M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.19M, False: 311k]
  |  |  |  Branch (44:34): [True: 278k, False: 913k]
  |  |  ------------------
  ------------------
  904|  1.50M|        }
  905|  49.3k|    }
  906|       |
  907|       |    /* If Right is not available */
  908|  51.8k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (908:8): [True: 1.94k, False: 49.8k]
  ------------------
  909|  1.94k|    {
  910|  1.94k|        au1_mask[(wd - 1) >> 1] = 0;
  911|  1.94k|    }
  912|       |
  913|       |    /* If Bottom is not available */
  914|  51.8k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (914:8): [True: 1.62k, False: 50.2k]
  ------------------
  915|  1.62k|    {
  916|  1.62k|        ht--;
  917|  1.62k|    }
  918|       |
  919|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
  920|  51.8k|    {
  921|   872k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (921:22): [True: 820k, False: 51.8k]
  ------------------
  922|   820k|        {
  923|   820k|            pu1_sign_up[0] = SIGN(pu1_src[0] - pu1_src_left_cpy[2 * (row - 1)]);
  ------------------
  |  |   44|   820k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 659k, False: 161k]
  |  |  |  Branch (44:34): [True: 191k, False: 467k]
  |  |  ------------------
  ------------------
  924|   820k|            pu1_sign_up[1] = SIGN(pu1_src[1] - pu1_src_left_cpy[2 * (row - 1) + 1]);
  ------------------
  |  |   44|   820k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 646k, False: 174k]
  |  |  |  Branch (44:34): [True: 191k, False: 455k]
  |  |  ------------------
  ------------------
  925|  27.3M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (925:26): [True: 26.4M, False: 820k]
  ------------------
  926|  26.4M|            {
  927|  26.4M|                WORD32 edge_idx;
  928|  26.4M|                WORD8 *pi1_sao_offset;
  929|       |
  930|  26.4M|                pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (930:34): [True: 13.2M, False: 13.2M]
  ------------------
  931|       |
  932|  26.4M|                u1_sign_down = SIGN(pu1_src[col] - pu1_src[col + 2 + src_strd]);
  ------------------
  |  |   44|  26.4M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 21.9M, False: 4.57M]
  |  |  |  Branch (44:34): [True: 4.53M, False: 17.3M]
  |  |  ------------------
  ------------------
  933|  26.4M|                edge_idx = 2 + pu1_sign_up[col] + u1_sign_down;
  934|  26.4M|                pu1_sign_up_tmp[col + 2] = -u1_sign_down;
  935|       |
  936|  26.4M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col >> 1];
  937|       |
  938|  26.4M|                if(0 != edge_idx)
  ------------------
  |  Branch (938:20): [True: 4.74M, False: 21.7M]
  ------------------
  939|  4.74M|                {
  940|  4.74M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  4.74M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.25k, False: 4.74M]
  |  |  |  Branch (40:53): [True: 435, False: 4.74M]
  |  |  ------------------
  ------------------
  941|  4.74M|                }
  942|  26.4M|            }
  943|       |
  944|       |            /* Swapping pu1_sign_up_tmp and pu1_sign_up */
  945|   820k|            {
  946|   820k|                WORD8 *pu1_swap_tmp = pu1_sign_up;
  947|   820k|                pu1_sign_up = pu1_sign_up_tmp;
  948|   820k|                pu1_sign_up_tmp = pu1_swap_tmp;
  949|   820k|            }
  950|       |
  951|   820k|            pu1_src += src_strd;
  952|   820k|        }
  953|       |
  954|  51.8k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd] = u1_pos_0_0_tmp_u;
  ------------------
  |  Branch (954:19): [True: 49.3k, False: 2.45k]
  ------------------
  955|  51.8k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd + 1] = u1_pos_0_0_tmp_v;
  ------------------
  |  Branch (955:19): [True: 49.3k, False: 2.45k]
  ------------------
  956|  51.8k|        pu1_src[(pu1_avail[3] ? wd - 2 - src_strd : wd - 2)] = u1_pos_wd_ht_tmp_u;
  ------------------
  |  Branch (956:18): [True: 50.2k, False: 1.62k]
  ------------------
  957|  51.8k|        pu1_src[(pu1_avail[3] ? wd - 1 - src_strd : wd - 1)] = u1_pos_wd_ht_tmp_v;
  ------------------
  |  Branch (957:18): [True: 50.2k, False: 1.62k]
  ------------------
  958|  51.8k|    }
  959|       |
  960|  51.8k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (960:8): [True: 2.46k, False: 49.3k]
  ------------------
  961|  2.46k|        ht++;
  962|  51.8k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (962:8): [True: 1.62k, False: 50.2k]
  ------------------
  963|  1.62k|        ht++;
  964|  51.8k|    pu1_src_top_left[0] = au1_src_top_left_tmp[0];
  965|  51.8k|    pu1_src_top_left[1] = au1_src_top_left_tmp[1];
  966|  1.70M|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (966:18): [True: 1.65M, False: 51.8k]
  ------------------
  967|  1.65M|    {
  968|  1.65M|        pu1_src_left[row] = au1_src_left_tmp[row];
  969|  1.65M|    }
  970|  1.73M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (970:18): [True: 1.68M, False: 51.8k]
  ------------------
  971|  1.68M|    {
  972|  1.68M|        pu1_src_top[col] = au1_src_top_tmp[col];
  973|  1.68M|    }
  974|       |
  975|  51.8k|}
ihevc_sao_edge_offset_class3:
  992|  45.9k|{
  993|  45.9k|    WORD32 row, col;
  994|  45.9k|    UWORD8 au1_mask[MAX_CTB_SIZE];
  995|  45.9k|    UWORD8 au1_src_top_tmp[MAX_CTB_SIZE];
  996|  45.9k|    UWORD8 au1_src_left_tmp[MAX_CTB_SIZE];
  997|  45.9k|    UWORD8 u1_src_top_left_tmp;
  998|  45.9k|    WORD8 au1_sign_up[MAX_CTB_SIZE];
  999|  45.9k|    UWORD8 *pu1_src_left_cpy;
 1000|  45.9k|    WORD8 u1_sign_down;
 1001|  45.9k|    WORD32 bit_depth;
 1002|       |
 1003|  45.9k|    UWORD8 u1_pos_0_ht_tmp;
 1004|  45.9k|    UWORD8 u1_pos_wd_0_tmp;
 1005|       |
 1006|  45.9k|    bit_depth = BIT_DEPTH_LUMA;
  ------------------
  |  |  270|  45.9k|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  269|  45.9k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1007|  45.9k|    pu1_src_left_cpy = pu1_src_left;
 1008|       |
 1009|       |    /* Initialize the mask values */
 1010|  45.9k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  341|  45.9k|#define MAX_CTB_SIZE        64
  ------------------
 1011|       |
 1012|       |    /* Update left, top and top-left arrays */
 1013|  45.9k|    u1_src_top_left_tmp = pu1_src_top[wd - 1];
 1014|  1.50M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1014:18): [True: 1.45M, False: 45.9k]
  ------------------
 1015|  1.45M|    {
 1016|  1.45M|        au1_src_left_tmp[row] = pu1_src[row * src_strd + wd - 1];
 1017|  1.45M|    }
 1018|  1.53M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1018:18): [True: 1.49M, False: 45.9k]
  ------------------
 1019|  1.49M|    {
 1020|  1.49M|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
 1021|  1.49M|    }
 1022|       |
 1023|       |    /* If top-right is available, process separately */
 1024|  45.9k|    if(0 != pu1_avail[5])
  ------------------
  |  Branch (1024:8): [True: 43.2k, False: 2.66k]
  ------------------
 1025|  43.2k|    {
 1026|  43.2k|        WORD32 edge_idx;
 1027|       |
 1028|  43.2k|        edge_idx = 2 + SIGN(pu1_src[wd - 1] - pu1_src_top_right[0]) +
  ------------------
  |  |   44|  43.2k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 30.7k, False: 12.5k]
  |  |  |  Branch (44:34): [True: 11.2k, False: 19.4k]
  |  |  ------------------
  ------------------
 1029|  43.2k|                        SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 - 1 + src_strd]);
  ------------------
  |  |   44|  43.2k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 35.4k, False: 7.79k]
  |  |  |  Branch (44:34): [True: 11.1k, False: 24.3k]
  |  |  ------------------
  ------------------
 1030|       |
 1031|  43.2k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1032|       |
 1033|  43.2k|        if(0 != edge_idx)
  ------------------
  |  Branch (1033:12): [True: 13.2k, False: 30.0k]
  ------------------
 1034|  13.2k|        {
 1035|  13.2k|            u1_pos_wd_0_tmp = CLIP3(pu1_src[wd - 1] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  13.2k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2, False: 13.2k]
  |  |  |  Branch (40:53): [True: 1, False: 13.2k]
  |  |  ------------------
  ------------------
 1036|  13.2k|        }
 1037|  30.0k|        else
 1038|  30.0k|        {
 1039|  30.0k|            u1_pos_wd_0_tmp = pu1_src[wd - 1];
 1040|  30.0k|        }
 1041|  43.2k|    }
 1042|  2.66k|    else
 1043|  2.66k|    {
 1044|  2.66k|        u1_pos_wd_0_tmp = pu1_src[wd - 1];
 1045|  2.66k|    }
 1046|       |
 1047|       |    /* If bottom-left is available, process separately */
 1048|  45.9k|    if(0 != pu1_avail[6])
  ------------------
  |  Branch (1048:8): [True: 42.3k, False: 3.55k]
  ------------------
 1049|  42.3k|    {
 1050|  42.3k|        WORD32 edge_idx;
 1051|       |
 1052|  42.3k|        edge_idx = 2 + SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src[(ht - 1) * src_strd + 1 - src_strd]) +
  ------------------
  |  |   44|  42.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 31.7k, False: 10.6k]
  |  |  |  Branch (44:34): [True: 6.63k, False: 25.1k]
  |  |  ------------------
  ------------------
 1053|  42.3k|                        SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src_bot_left[0]);
  ------------------
  |  |   44|  42.3k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 33.2k, False: 9.15k]
  |  |  |  Branch (44:34): [True: 12.6k, False: 20.6k]
  |  |  ------------------
  ------------------
 1054|       |
 1055|  42.3k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1056|       |
 1057|  42.3k|        if(0 != edge_idx)
  ------------------
  |  Branch (1057:12): [True: 15.7k, False: 26.6k]
  ------------------
 1058|  15.7k|        {
 1059|  15.7k|            u1_pos_0_ht_tmp = CLIP3(pu1_src[(ht - 1) * src_strd] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  15.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2, False: 15.7k]
  |  |  |  Branch (40:53): [True: 0, False: 15.7k]
  |  |  ------------------
  ------------------
 1060|  15.7k|        }
 1061|  26.6k|        else
 1062|  26.6k|        {
 1063|  26.6k|            u1_pos_0_ht_tmp = pu1_src[(ht - 1) * src_strd];
 1064|  26.6k|        }
 1065|  42.3k|    }
 1066|  3.55k|    else
 1067|  3.55k|    {
 1068|  3.55k|        u1_pos_0_ht_tmp = pu1_src[(ht - 1) * src_strd];
 1069|  3.55k|    }
 1070|       |
 1071|       |    /* If Left is not available */
 1072|  45.9k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (1072:8): [True: 1.98k, False: 43.9k]
  ------------------
 1073|  1.98k|    {
 1074|  1.98k|        au1_mask[0] = 0;
 1075|  1.98k|    }
 1076|       |
 1077|       |    /* If Top is not available */
 1078|  45.9k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1078:8): [True: 2.01k, False: 43.9k]
  ------------------
 1079|  2.01k|    {
 1080|  2.01k|        pu1_src += src_strd;
 1081|  2.01k|        ht--;
 1082|  2.01k|        pu1_src_left_cpy += 1;
 1083|  66.5k|        for(col = 0; col < wd - 1; col++)
  ------------------
  |  Branch (1083:22): [True: 64.5k, False: 2.01k]
  ------------------
 1084|  64.5k|        {
 1085|  64.5k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col + 1 - src_strd]);
  ------------------
  |  |   44|  64.5k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 54.2k, False: 10.2k]
  |  |  |  Branch (44:34): [True: 9.68k, False: 44.5k]
  |  |  ------------------
  ------------------
 1086|  64.5k|        }
 1087|  2.01k|    }
 1088|  43.9k|    else
 1089|  43.9k|    {
 1090|  1.42M|        for(col = 0; col < wd - 1; col++)
  ------------------
  |  Branch (1090:22): [True: 1.38M, False: 43.9k]
  ------------------
 1091|  1.38M|        {
 1092|  1.38M|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col + 1]);
  ------------------
  |  |   44|  1.38M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.03M, False: 340k]
  |  |  |  Branch (44:34): [True: 280k, False: 759k]
  |  |  ------------------
  ------------------
 1093|  1.38M|        }
 1094|  43.9k|    }
 1095|       |
 1096|       |    /* If Right is not available */
 1097|  45.9k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (1097:8): [True: 744, False: 45.1k]
  ------------------
 1098|    744|    {
 1099|    744|        au1_mask[wd - 1] = 0;
 1100|    744|    }
 1101|       |
 1102|       |    /* If Bottom is not available */
 1103|  45.9k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1103:8): [True: 1.65k, False: 44.2k]
  ------------------
 1104|  1.65k|    {
 1105|  1.65k|        ht--;
 1106|  1.65k|    }
 1107|       |
 1108|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
 1109|  45.9k|    {
 1110|  1.49M|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1110:22): [True: 1.45M, False: 45.9k]
  ------------------
 1111|  1.45M|        {
 1112|  1.45M|            au1_sign_up[wd - 1] = SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 + 1 - src_strd]);
  ------------------
  |  |   44|  1.45M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.07M, False: 371k]
  |  |  |  Branch (44:34): [True: 318k, False: 759k]
  |  |  ------------------
  ------------------
 1113|  48.1M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1113:26): [True: 46.6M, False: 1.45M]
  ------------------
 1114|  46.6M|            {
 1115|  46.6M|                WORD32 edge_idx;
 1116|       |
 1117|  46.6M|                u1_sign_down = SIGN(pu1_src[col] - ((col == 0) ? pu1_src_left_cpy[row + 1] :
  ------------------
  |  |   44|  93.3M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 39.0M, False: 7.65M]
  |  |  |  Branch (44:23): [True: 1.45M, False: 45.2M]
  |  |  |  Branch (44:34): [True: 9.27M, False: 29.7M]
  |  |  |  Branch (44:35): [True: 1.17M, False: 37.8M]
  |  |  ------------------
  ------------------
 1118|  46.6M|                                                                 pu1_src[col - 1 + src_strd]));
 1119|  46.6M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
 1120|  46.6M|                if(col > 0)
  ------------------
  |  Branch (1120:20): [True: 45.2M, False: 1.42M]
  ------------------
 1121|  45.2M|                    au1_sign_up[col - 1] = -u1_sign_down;
 1122|       |
 1123|  46.6M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col];
 1124|       |
 1125|  46.6M|                if(0 != edge_idx)
  ------------------
  |  Branch (1125:20): [True: 11.3M, False: 35.3M]
  ------------------
 1126|  11.3M|                {
 1127|  11.3M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  11.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.75k, False: 11.3M]
  |  |  |  Branch (40:53): [True: 3.36k, False: 11.3M]
  |  |  ------------------
  ------------------
 1128|  11.3M|                }
 1129|  46.6M|            }
 1130|       |
 1131|  1.45M|            pu1_src += src_strd;
 1132|  1.45M|        }
 1133|       |
 1134|  45.9k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd + wd - 1] = u1_pos_wd_0_tmp;
  ------------------
  |  Branch (1134:19): [True: 43.9k, False: 2.00k]
  ------------------
 1135|  45.9k|        pu1_src[(pu1_avail[3] ?  (-src_strd) : 0)] = u1_pos_0_ht_tmp;
  ------------------
  |  Branch (1135:18): [True: 44.2k, False: 1.65k]
  ------------------
 1136|  45.9k|    }
 1137|       |
 1138|  45.9k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1138:8): [True: 2.01k, False: 43.9k]
  ------------------
 1139|  2.01k|        ht++;
 1140|  45.9k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1140:8): [True: 1.65k, False: 44.2k]
  ------------------
 1141|  1.65k|        ht++;
 1142|  45.9k|    *pu1_src_top_left = u1_src_top_left_tmp;
 1143|  1.50M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1143:18): [True: 1.45M, False: 45.9k]
  ------------------
 1144|  1.45M|    {
 1145|  1.45M|        pu1_src_left[row] = au1_src_left_tmp[row];
 1146|  1.45M|    }
 1147|  1.53M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1147:18): [True: 1.49M, False: 45.9k]
  ------------------
 1148|  1.49M|    {
 1149|  1.49M|        pu1_src_top[col] = au1_src_top_tmp[col];
 1150|  1.49M|    }
 1151|       |
 1152|  45.9k|}
ihevc_sao_edge_offset_class3_chroma:
 1169|  49.9k|{
 1170|  49.9k|    WORD32 row, col;
 1171|  49.9k|    UWORD8 au1_mask[MAX_CTB_SIZE];
 1172|  49.9k|    UWORD8 au1_src_left_tmp[2 * MAX_CTB_SIZE], au1_src_top_tmp[MAX_CTB_SIZE];
 1173|  49.9k|    UWORD8 au1_src_top_left_tmp[2];
 1174|  49.9k|    WORD8 au1_sign_up[MAX_CTB_SIZE];
 1175|  49.9k|    UWORD8 *pu1_src_left_cpy;
 1176|  49.9k|    WORD8 u1_sign_down;
 1177|  49.9k|    WORD32 bit_depth;
 1178|       |
 1179|  49.9k|    UWORD8 u1_pos_wd_0_tmp_u;
 1180|  49.9k|    UWORD8 u1_pos_wd_0_tmp_v;
 1181|  49.9k|    UWORD8 u1_pos_0_ht_tmp_u;
 1182|  49.9k|    UWORD8 u1_pos_0_ht_tmp_v;
 1183|       |
 1184|  49.9k|    bit_depth = BIT_DEPTH_CHROMA;
  ------------------
  |  |  271|  49.9k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  269|  49.9k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
 1185|  49.9k|    pu1_src_left_cpy = pu1_src_left;
 1186|       |
 1187|       |    /* Initialize the mask values */
 1188|  49.9k|    memset(au1_mask, 0xFF, MAX_CTB_SIZE);
  ------------------
  |  |  341|  49.9k|#define MAX_CTB_SIZE        64
  ------------------
 1189|       |
 1190|       |    /* Update left, top and top-left arrays */
 1191|  49.9k|    au1_src_top_left_tmp[0] = pu1_src_top[wd - 2];
 1192|  49.9k|    au1_src_top_left_tmp[1] = pu1_src_top[wd - 1];
 1193|   843k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1193:18): [True: 793k, False: 49.9k]
  ------------------
 1194|   793k|    {
 1195|   793k|        au1_src_left_tmp[2 * row] = pu1_src[row * src_strd + wd - 2];
 1196|   793k|        au1_src_left_tmp[2 * row + 1] = pu1_src[row * src_strd + wd - 1];
 1197|   793k|    }
 1198|  1.68M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1198:18): [True: 1.63M, False: 49.9k]
  ------------------
 1199|  1.63M|    {
 1200|  1.63M|        au1_src_top_tmp[col] = pu1_src[(ht - 1) * src_strd + col];
 1201|  1.63M|    }
 1202|       |
 1203|       |
 1204|       |    /* If top-right is available, process separately */
 1205|  49.9k|    if(0 != pu1_avail[5])
  ------------------
  |  Branch (1205:8): [True: 46.8k, False: 3.13k]
  ------------------
 1206|  46.8k|    {
 1207|  46.8k|        WORD32 edge_idx;
 1208|       |
 1209|       |        /* U */
 1210|  46.8k|        edge_idx = 2 + SIGN(pu1_src[wd - 2] - pu1_src_top_right[0]) +
  ------------------
  |  |   44|  46.8k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 34.4k, False: 12.3k]
  |  |  |  Branch (44:34): [True: 11.7k, False: 22.6k]
  |  |  ------------------
  ------------------
 1211|  46.8k|                        SIGN(pu1_src[wd - 2] - pu1_src[wd - 2 - 2 + src_strd]);
  ------------------
  |  |   44|  46.8k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 34.7k, False: 12.0k]
  |  |  |  Branch (44:34): [True: 12.2k, False: 22.4k]
  |  |  ------------------
  ------------------
 1212|       |
 1213|  46.8k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1214|       |
 1215|  46.8k|        if(0 != edge_idx)
  ------------------
  |  Branch (1215:12): [True: 12.4k, False: 34.4k]
  ------------------
 1216|  12.4k|        {
 1217|  12.4k|            u1_pos_wd_0_tmp_u = CLIP3(pu1_src[wd - 2] + pi1_sao_offset_u[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  12.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1, False: 12.4k]
  |  |  |  Branch (40:53): [True: 3, False: 12.4k]
  |  |  ------------------
  ------------------
 1218|  12.4k|        }
 1219|  34.4k|        else
 1220|  34.4k|        {
 1221|  34.4k|            u1_pos_wd_0_tmp_u = pu1_src[wd - 2];
 1222|  34.4k|        }
 1223|       |
 1224|       |        /* V */
 1225|  46.8k|        edge_idx = 2 + SIGN(pu1_src[wd - 1] - pu1_src_top_right[1]) +
  ------------------
  |  |   44|  46.8k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 33.4k, False: 13.3k]
  |  |  |  Branch (44:34): [True: 12.5k, False: 20.9k]
  |  |  ------------------
  ------------------
 1226|  46.8k|                        SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 - 2 + src_strd]);
  ------------------
  |  |   44|  46.8k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 34.7k, False: 12.1k]
  |  |  |  Branch (44:34): [True: 11.4k, False: 23.2k]
  |  |  ------------------
  ------------------
 1227|       |
 1228|  46.8k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1229|       |
 1230|  46.8k|        if(0 != edge_idx)
  ------------------
  |  Branch (1230:12): [True: 14.7k, False: 32.0k]
  ------------------
 1231|  14.7k|        {
 1232|  14.7k|            u1_pos_wd_0_tmp_v = CLIP3(pu1_src[wd - 1] + pi1_sao_offset_v[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  14.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 2, False: 14.7k]
  |  |  |  Branch (40:53): [True: 15, False: 14.7k]
  |  |  ------------------
  ------------------
 1233|  14.7k|        }
 1234|  32.0k|        else
 1235|  32.0k|        {
 1236|  32.0k|            u1_pos_wd_0_tmp_v = pu1_src[wd - 1];
 1237|  32.0k|        }
 1238|  46.8k|    }
 1239|  3.13k|    else
 1240|  3.13k|    {
 1241|  3.13k|        u1_pos_wd_0_tmp_u = pu1_src[wd - 2];
 1242|  3.13k|        u1_pos_wd_0_tmp_v = pu1_src[wd - 1];
 1243|  3.13k|    }
 1244|       |
 1245|       |    /* If bottom-left is available, process separately */
 1246|  49.9k|    if(0 != pu1_avail[6])
  ------------------
  |  Branch (1246:8): [True: 48.0k, False: 1.98k]
  ------------------
 1247|  48.0k|    {
 1248|  48.0k|        WORD32 edge_idx;
 1249|       |
 1250|       |        /* U */
 1251|  48.0k|        edge_idx = 2 + SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src[(ht - 1) * src_strd + 2 - src_strd]) +
  ------------------
  |  |   44|  48.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 33.3k, False: 14.6k]
  |  |  |  Branch (44:34): [True: 10.4k, False: 22.9k]
  |  |  ------------------
  ------------------
 1252|  48.0k|                        SIGN(pu1_src[(ht - 1) * src_strd] - pu1_src_bot_left[0]);
  ------------------
  |  |   44|  48.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 36.5k, False: 11.4k]
  |  |  |  Branch (44:34): [True: 14.8k, False: 21.6k]
  |  |  ------------------
  ------------------
 1253|       |
 1254|  48.0k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1255|       |
 1256|  48.0k|        if(0 != edge_idx)
  ------------------
  |  Branch (1256:12): [True: 12.4k, False: 35.5k]
  ------------------
 1257|  12.4k|        {
 1258|  12.4k|            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|  12.4k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 12.4k]
  |  |  |  Branch (40:53): [True: 5, False: 12.4k]
  |  |  ------------------
  ------------------
 1259|  12.4k|        }
 1260|  35.5k|        else
 1261|  35.5k|        {
 1262|  35.5k|            u1_pos_0_ht_tmp_u = pu1_src[(ht - 1) * src_strd];
 1263|  35.5k|        }
 1264|       |
 1265|       |        /* V */
 1266|  48.0k|        edge_idx = 2 + SIGN(pu1_src[(ht - 1) * src_strd + 1] - pu1_src[(ht - 1) * src_strd + 1 + 2 - src_strd]) +
  ------------------
  |  |   44|  48.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 34.7k, False: 13.2k]
  |  |  |  Branch (44:34): [True: 10.8k, False: 23.8k]
  |  |  ------------------
  ------------------
 1267|  48.0k|                        SIGN(pu1_src[(ht - 1) * src_strd + 1] - pu1_src_bot_left[1]);
  ------------------
  |  |   44|  48.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 37.2k, False: 10.7k]
  |  |  |  Branch (44:34): [True: 14.2k, False: 22.9k]
  |  |  ------------------
  ------------------
 1268|       |
 1269|  48.0k|        edge_idx = gi4_ihevc_table_edge_idx[edge_idx];
 1270|       |
 1271|  48.0k|        if(0 != edge_idx)
  ------------------
  |  Branch (1271:12): [True: 11.5k, False: 36.4k]
  ------------------
 1272|  11.5k|        {
 1273|  11.5k|            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|  11.5k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 11.5k]
  |  |  |  Branch (40:53): [True: 9, False: 11.5k]
  |  |  ------------------
  ------------------
 1274|  11.5k|        }
 1275|  36.4k|        else
 1276|  36.4k|        {
 1277|  36.4k|            u1_pos_0_ht_tmp_v = pu1_src[(ht - 1) * src_strd + 1];
 1278|  36.4k|        }
 1279|  48.0k|    }
 1280|  1.98k|    else
 1281|  1.98k|    {
 1282|  1.98k|        u1_pos_0_ht_tmp_u = pu1_src[(ht - 1) * src_strd];
 1283|  1.98k|        u1_pos_0_ht_tmp_v = pu1_src[(ht - 1) * src_strd + 1];
 1284|  1.98k|    }
 1285|       |
 1286|       |    /* If Left is not available */
 1287|  49.9k|    if(0 == pu1_avail[0])
  ------------------
  |  Branch (1287:8): [True: 875, False: 49.1k]
  ------------------
 1288|    875|    {
 1289|    875|        au1_mask[0] = 0;
 1290|    875|    }
 1291|       |
 1292|       |    /* If Top is not available */
 1293|  49.9k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1293:8): [True: 1.95k, False: 48.0k]
  ------------------
 1294|  1.95k|    {
 1295|  1.95k|        pu1_src += src_strd;
 1296|  1.95k|        ht--;
 1297|  1.95k|        pu1_src_left_cpy += 2;
 1298|  58.0k|        for(col = 0; col < wd - 2; col++)
  ------------------
  |  Branch (1298:22): [True: 56.0k, False: 1.95k]
  ------------------
 1299|  56.0k|        {
 1300|  56.0k|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src[col + 2 - src_strd]);
  ------------------
  |  |   44|  56.0k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 55.1k, False: 927]
  |  |  |  Branch (44:34): [True: 778, False: 54.3k]
  |  |  ------------------
  ------------------
 1301|  56.0k|        }
 1302|  1.95k|    }
 1303|  48.0k|    else
 1304|  48.0k|    {
 1305|  1.52M|        for(col = 0; col < wd - 2; col++)
  ------------------
  |  Branch (1305:22): [True: 1.47M, False: 48.0k]
  ------------------
 1306|  1.47M|        {
 1307|  1.47M|            au1_sign_up[col] = SIGN(pu1_src[col] - pu1_src_top[col + 2]);
  ------------------
  |  |   44|  1.47M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 1.08M, False: 394k]
  |  |  |  Branch (44:34): [True: 359k, False: 722k]
  |  |  ------------------
  ------------------
 1308|  1.47M|        }
 1309|  48.0k|    }
 1310|       |
 1311|       |    /* If Right is not available */
 1312|  49.9k|    if(0 == pu1_avail[1])
  ------------------
  |  Branch (1312:8): [True: 1.26k, False: 48.7k]
  ------------------
 1313|  1.26k|    {
 1314|  1.26k|        au1_mask[(wd - 1) >> 1] = 0;
 1315|  1.26k|    }
 1316|       |
 1317|       |    /* If Bottom is not available */
 1318|  49.9k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1318:8): [True: 1.21k, False: 48.7k]
  ------------------
 1319|  1.21k|    {
 1320|  1.21k|        ht--;
 1321|  1.21k|    }
 1322|       |
 1323|       |    /* Processing is done on the intermediate buffer and the output is written to the source buffer */
 1324|  49.9k|    {
 1325|   839k|        for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1325:22): [True: 789k, False: 49.9k]
  ------------------
 1326|   789k|        {
 1327|   789k|            au1_sign_up[wd - 2] = SIGN(pu1_src[wd - 2] - pu1_src[wd - 2 + 2 - src_strd]);
  ------------------
  |  |   44|   789k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 573k, False: 215k]
  |  |  |  Branch (44:34): [True: 199k, False: 374k]
  |  |  ------------------
  ------------------
 1328|   789k|            au1_sign_up[wd - 1] = SIGN(pu1_src[wd - 1] - pu1_src[wd - 1 + 2 - src_strd]);
  ------------------
  |  |   44|   789k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 606k, False: 182k]
  |  |  |  Branch (44:34): [True: 212k, False: 394k]
  |  |  ------------------
  ------------------
 1329|  26.2M|            for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1329:26): [True: 25.5M, False: 789k]
  ------------------
 1330|  25.5M|            {
 1331|  25.5M|                WORD32 edge_idx;
 1332|  25.5M|                WORD8 *pi1_sao_offset;
 1333|       |
 1334|  25.5M|                pi1_sao_offset = (0 == col % 2) ? pi1_sao_offset_u : pi1_sao_offset_v;
  ------------------
  |  Branch (1334:34): [True: 12.7M, False: 12.7M]
  ------------------
 1335|       |
 1336|  25.5M|                u1_sign_down = SIGN(pu1_src[col] - ((col < 2) ? pu1_src_left_cpy[2 * (row + 1) + col] :
  ------------------
  |  |   44|  51.0M|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 20.1M, False: 5.39M]
  |  |  |  Branch (44:23): [True: 1.57M, False: 23.9M]
  |  |  |  Branch (44:34): [True: 5.76M, False: 14.3M]
  |  |  |  Branch (44:35): [True: 1.19M, False: 18.9M]
  |  |  ------------------
  ------------------
 1337|  25.5M|                                                                pu1_src[col - 2 + src_strd]));
 1338|  25.5M|                edge_idx = 2 + au1_sign_up[col] + u1_sign_down;
 1339|  25.5M|                if(col > 1)
  ------------------
  |  Branch (1339:20): [True: 23.9M, False: 1.54M]
  ------------------
 1340|  23.9M|                    au1_sign_up[col - 2] = -u1_sign_down;
 1341|       |
 1342|  25.5M|                edge_idx = gi4_ihevc_table_edge_idx[edge_idx] & au1_mask[col >> 1];
 1343|       |
 1344|  25.5M|                if(0 != edge_idx)
  ------------------
  |  Branch (1344:20): [True: 5.58M, False: 19.9M]
  ------------------
 1345|  5.58M|                {
 1346|  5.58M|                    pu1_src[col] = CLIP3(pu1_src[col] + pi1_sao_offset[edge_idx], 0, (1 << bit_depth) - 1);
  ------------------
  |  |   40|  5.58M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.27k, False: 5.58M]
  |  |  |  Branch (40:53): [True: 1.48k, False: 5.57M]
  |  |  ------------------
  ------------------
 1347|  5.58M|                }
 1348|  25.5M|            }
 1349|       |
 1350|   789k|            pu1_src += src_strd;
 1351|   789k|        }
 1352|       |
 1353|  49.9k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd + wd - 2] = u1_pos_wd_0_tmp_u;
  ------------------
  |  Branch (1353:19): [True: 48.0k, False: 1.94k]
  ------------------
 1354|  49.9k|        pu1_src[-(pu1_avail[2] ? ht : ht + 1) * src_strd + wd - 1] = u1_pos_wd_0_tmp_v;
  ------------------
  |  Branch (1354:19): [True: 48.0k, False: 1.94k]
  ------------------
 1355|  49.9k|        pu1_src[(pu1_avail[3] ?  (-src_strd) : 0)] = u1_pos_0_ht_tmp_u;
  ------------------
  |  Branch (1355:18): [True: 48.7k, False: 1.21k]
  ------------------
 1356|  49.9k|        pu1_src[(pu1_avail[3] ?  (-src_strd) : 0) + 1] = u1_pos_0_ht_tmp_v;
  ------------------
  |  Branch (1356:18): [True: 48.7k, False: 1.21k]
  ------------------
 1357|  49.9k|    }
 1358|       |
 1359|  49.9k|    if(0 == pu1_avail[2])
  ------------------
  |  Branch (1359:8): [True: 1.95k, False: 48.0k]
  ------------------
 1360|  1.95k|        ht++;
 1361|  49.9k|    if(0 == pu1_avail[3])
  ------------------
  |  Branch (1361:8): [True: 1.21k, False: 48.7k]
  ------------------
 1362|  1.21k|        ht++;
 1363|  49.9k|    pu1_src_top_left[0] = au1_src_top_left_tmp[0];
 1364|  49.9k|    pu1_src_top_left[1] = au1_src_top_left_tmp[1];
 1365|  1.63M|    for(row = 0; row < 2 * ht; row++)
  ------------------
  |  Branch (1365:18): [True: 1.58M, False: 49.9k]
  ------------------
 1366|  1.58M|    {
 1367|  1.58M|        pu1_src_left[row] = au1_src_left_tmp[row];
 1368|  1.58M|    }
 1369|  1.68M|    for(col = 0; col < wd; col++)
  ------------------
  |  Branch (1369:18): [True: 1.63M, False: 49.9k]
  ------------------
 1370|  1.63M|    {
 1371|  1.63M|        pu1_src_top[col] = au1_src_top_tmp[col];
 1372|  1.63M|    }
 1373|       |
 1374|  49.9k|}

ihevc_weighted_pred_uni:
  116|  18.3k|{
  117|  18.3k|    WORD32 row, col;
  118|  18.3k|    WORD32 i4_tmp;
  119|       |
  120|   169k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (120:18): [True: 150k, False: 18.3k]
  ------------------
  121|   150k|    {
  122|  1.66M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (122:22): [True: 1.51M, False: 150k]
  ------------------
  123|  1.51M|        {
  124|  1.51M|            i4_tmp = (pi2_src[col] + lvl_shift) * wgt0;
  125|  1.51M|            i4_tmp += 1 << (shift - 1);
  126|  1.51M|            i4_tmp = (i4_tmp >> shift) + off0;
  127|       |
  128|  1.51M|            pu1_dst[col] = CLIP_U8(i4_tmp);
  ------------------
  |  |   40|  1.51M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  1.51M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 407, False: 1.51M]
  |  |  |  |  |  Branch (40:53): [True: 462, False: 1.51M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  129|  1.51M|        }
  130|       |
  131|   150k|        pi2_src += src_strd;
  132|   150k|        pu1_dst += dst_strd;
  133|   150k|    }
  134|  18.3k|}
ihevc_weighted_pred_chroma_uni:
  201|  18.3k|{
  202|  18.3k|    WORD32 row, col;
  203|  18.3k|    WORD32 i4_tmp;
  204|       |
  205|  94.5k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (205:18): [True: 76.1k, False: 18.3k]
  ------------------
  206|  76.1k|    {
  207|   459k|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (207:22): [True: 383k, False: 76.1k]
  ------------------
  208|   383k|        {
  209|   383k|            i4_tmp = (pi2_src[col] + lvl_shift) * wgt0_cb;
  210|   383k|            i4_tmp += 1 << (shift - 1);
  211|   383k|            i4_tmp = (i4_tmp >> shift) + off0_cb;
  212|       |
  213|   383k|            pu1_dst[col] = CLIP_U8(i4_tmp);
  ------------------
  |  |   40|   383k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   383k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 3, False: 383k]
  |  |  |  |  |  Branch (40:53): [True: 10.0k, False: 373k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|       |
  215|   383k|            i4_tmp = (pi2_src[col + 1] + lvl_shift) * wgt0_cr;
  216|   383k|            i4_tmp += 1 << (shift - 1);
  217|   383k|            i4_tmp = (i4_tmp >> shift) + off0_cr;
  218|       |
  219|   383k|            pu1_dst[col + 1] = CLIP_U8(i4_tmp);
  ------------------
  |  |   40|   383k|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   383k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 416, False: 382k]
  |  |  |  |  |  Branch (40:53): [True: 81, False: 382k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  220|   383k|        }
  221|       |
  222|  76.1k|        pi2_src += src_strd;
  223|  76.1k|        pu1_dst += dst_strd;
  224|  76.1k|    }
  225|  18.3k|}
ihevc_weighted_pred_bi:
  307|   531k|{
  308|   531k|    WORD32 row, col;
  309|   531k|    WORD32 i4_tmp;
  310|       |
  311|  4.73M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (311:18): [True: 4.20M, False: 531k]
  ------------------
  312|  4.20M|    {
  313|  38.5M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (313:22): [True: 34.3M, False: 4.20M]
  ------------------
  314|  34.3M|        {
  315|  34.3M|            i4_tmp = (pi2_src1[col] + lvl_shift1) * wgt0;
  316|  34.3M|            i4_tmp += (pi2_src2[col] + lvl_shift2) * wgt1;
  317|  34.3M|            i4_tmp += (off0 + off1 + 1) << (shift - 1);
  318|       |
  319|  34.3M|            pu1_dst[col] = CLIP_U8(i4_tmp >> shift);
  ------------------
  |  |   40|  34.3M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  34.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.10k, False: 34.3M]
  |  |  |  |  |  Branch (40:53): [True: 40.7k, False: 34.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  320|  34.3M|        }
  321|       |
  322|  4.20M|        pi2_src1 += src_strd1;
  323|  4.20M|        pi2_src2 += src_strd2;
  324|  4.20M|        pu1_dst += dst_strd;
  325|  4.20M|    }
  326|   531k|}
ihevc_weighted_pred_chroma_bi:
  412|   535k|{
  413|   535k|    WORD32 row, col;
  414|   535k|    WORD32 i4_tmp;
  415|       |
  416|  2.68M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (416:18): [True: 2.14M, False: 535k]
  ------------------
  417|  2.14M|    {
  418|  10.9M|        for(col = 0; col < 2 * wd; col += 2)
  ------------------
  |  Branch (418:22): [True: 8.82M, False: 2.14M]
  ------------------
  419|  8.82M|        {
  420|  8.82M|            i4_tmp = (pi2_src1[col] + lvl_shift1) * wgt0_cb;
  421|  8.82M|            i4_tmp += (pi2_src2[col] + lvl_shift2) * wgt1_cb;
  422|  8.82M|            i4_tmp += (off0_cb + off1_cb + 1) << (shift - 1);
  423|       |
  424|  8.82M|            pu1_dst[col] = CLIP_U8(i4_tmp >> shift);
  ------------------
  |  |   40|  8.82M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 54, False: 8.82M]
  |  |  |  |  |  Branch (40:53): [True: 1.18k, False: 8.82M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  425|       |
  426|  8.82M|            i4_tmp = (pi2_src1[col + 1] + lvl_shift1) * wgt0_cr;
  427|  8.82M|            i4_tmp += (pi2_src2[col + 1] + lvl_shift2) * wgt1_cr;
  428|  8.82M|            i4_tmp += (off0_cr + off1_cr + 1) << (shift - 1);
  429|       |
  430|  8.82M|            pu1_dst[col + 1] = CLIP_U8(i4_tmp >> shift);
  ------------------
  |  |   40|  8.82M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  8.82M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1, False: 8.82M]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 8.82M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  431|  8.82M|        }
  432|       |
  433|  2.14M|        pi2_src1 += src_strd1;
  434|  2.14M|        pi2_src2 += src_strd2;
  435|  2.14M|        pu1_dst += dst_strd;
  436|  2.14M|    }
  437|   535k|}
ihevc_weighted_pred_bi_default:
  499|   627k|{
  500|   627k|    WORD32 row, col;
  501|   627k|    WORD32 i4_tmp;
  502|   627k|    WORD32 shift;
  503|       |
  504|   627k|    shift = SHIFT_14_MINUS_BIT_DEPTH + 1;
  ------------------
  |  |   41|   627k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|   627k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  505|  5.02M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (505:18): [True: 4.39M, False: 627k]
  ------------------
  506|  4.39M|    {
  507|  68.5M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (507:22): [True: 64.1M, False: 4.39M]
  ------------------
  508|  64.1M|        {
  509|  64.1M|            i4_tmp = pi2_src1[col] + lvl_shift1;
  510|  64.1M|            i4_tmp += pi2_src2[col] + lvl_shift2;
  511|  64.1M|            i4_tmp += 1 << (shift - 1);
  512|       |
  513|  64.1M|            pu1_dst[col] = CLIP_U8(i4_tmp >> shift);
  ------------------
  |  |   40|  64.1M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  64.1M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 119k, False: 63.9M]
  |  |  |  |  |  Branch (40:53): [True: 126k, False: 63.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  514|  64.1M|        }
  515|       |
  516|  4.39M|        pi2_src1 += src_strd1;
  517|  4.39M|        pi2_src2 += src_strd2;
  518|  4.39M|        pu1_dst += dst_strd;
  519|  4.39M|    }
  520|   627k|}

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

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

ihevc_intra_pred_chroma_planar_sse42:
  115|  85.5k|{
  116|       |
  117|  85.5k|    WORD32 row, col;
  118|  85.5k|    WORD32 log2nt = 5;
  119|  85.5k|    WORD32 two_nt, three_nt;
  120|       |
  121|  85.5k|    __m128i const_temp_4x32b, const_temp1_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
  122|  85.5k|    __m128i col_8x16b, const_temp5_4x32b, const_temp6_4x32b, zero_8x16b, const_temp7_4x32b;
  123|  85.5k|    UNUSED(src_strd);
  ------------------
  |  |   38|  85.5k|#define UNUSED(x) ((void)(x))
  ------------------
  124|  85.5k|    UNUSED(mode);
  ------------------
  |  |   38|  85.5k|#define UNUSED(x) ((void)(x))
  ------------------
  125|       |
  126|  85.5k|    switch(nt)
  127|  85.5k|    {
  128|  31.8k|        case 16:
  ------------------
  |  Branch (128:9): [True: 31.8k, False: 53.6k]
  ------------------
  129|  31.8k|            log2nt = 4;
  130|  31.8k|            break;
  131|  32.3k|        case 8:
  ------------------
  |  Branch (131:9): [True: 32.3k, False: 53.2k]
  ------------------
  132|  32.3k|            log2nt = 3;
  133|  32.3k|            break;
  134|  21.3k|        case 4:
  ------------------
  |  Branch (134:9): [True: 21.3k, False: 64.1k]
  ------------------
  135|  21.3k|            log2nt = 2;
  136|  21.3k|            break;
  137|      0|        default:
  ------------------
  |  Branch (137:9): [True: 0, False: 85.5k]
  ------------------
  138|      0|            break;
  139|  85.5k|    }
  140|  85.5k|    two_nt = 2 * nt;
  141|  85.5k|    three_nt = 3 * nt;
  142|       |
  143|       |    /* Planar filtering */
  144|       |
  145|       |/* setting vallues in  registera*/
  146|       |
  147|       |//  pu1_ref[2*(two_nt - 1 - row)]
  148|       |//  pu1_ref[2 * (three_nt + 1)]
  149|       |//  pu1_ref[2 * (two_nt + 1) + col]
  150|       |//  pu1_ref[2 * (nt - 1)]
  151|       |
  152|  85.5k|    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],
  153|  85.5k|                                      pu1_ref[2 * (three_nt + 1)], pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)],
  154|  85.5k|                                      pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)]);
  155|       |
  156|  85.5k|    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)],
  157|  85.5k|                                      pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)], pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)]);
  158|       |
  159|  85.5k|    const_temp4_4x32b = _mm_set1_epi16(nt - 1);
  160|  85.5k|    const_temp6_4x32b = _mm_set1_epi16(nt);
  161|  85.5k|    const_temp7_4x32b = _mm_set1_epi16(4);
  162|       |
  163|  85.5k|    zero_8x16b = _mm_set1_epi32(0);
  164|       |
  165|  85.5k|    if(nt % 4 == 0)
  ------------------
  |  Branch (165:8): [True: 85.5k, False: 34]
  ------------------
  166|  85.5k|    {
  167|  85.5k|        const_temp7_4x32b = _mm_set1_epi16(4);
  168|       |
  169|   931k|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (169:22): [True: 846k, False: 85.5k]
  ------------------
  170|   846k|        {
  171|   846k|            __m128i res_temp_8x16b, row_8x16b, res_temp1_8x16b, res_temp2_8x16b;
  172|   846k|            __m128i res_temp3_8x16b;
  173|       |
  174|   846k|            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],
  175|   846k|                                               pu1_ref[2 * (two_nt - 1 - row)], pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)],
  176|   846k|                                               pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)]);
  177|       |
  178|   846k|            const_temp3_4x32b  = _mm_set1_epi16((row + 1));
  179|   846k|            row_8x16b = _mm_set1_epi16((nt - 1 - row));
  180|       |
  181|   846k|            const_temp5_4x32b = _mm_set_epi16(3, 3, 2, 2, 1, 1, 0, 0);
  182|   846k|            col_8x16b = _mm_set_epi16(4, 4, 3, 3, 2, 2, 1, 1);
  183|       |
  184|   846k|            const_temp5_4x32b = _mm_sub_epi16(const_temp4_4x32b, const_temp5_4x32b);
  185|       |
  186|       |            /*(row + 1) * pu1_ref[nt - 1]*/
  187|   846k|            res_temp_8x16b  = _mm_mullo_epi16(const_temp3_4x32b,  const_temp1_4x32b);
  188|       |
  189|       |            /*(row + 1) * pu1_ref[nt - 1] + nt)*/
  190|   846k|            res_temp_8x16b = _mm_add_epi16(res_temp_8x16b, const_temp6_4x32b);
  191|       |
  192|  3.45M|            for(col = 0; col < 2 * nt; col += 8)
  ------------------
  |  Branch (192:26): [True: 2.61M, False: 846k]
  ------------------
  193|  2.61M|            {
  194|  2.61M|                __m128i src_temp_8x16b;
  195|       |
  196|       |                /* loding 8bit 16 pixles*/
  197|  2.61M|                src_temp_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (two_nt + 1) + col));
  198|       |
  199|  2.61M|                src_temp_8x16b =  _mm_cvtepu8_epi16(src_temp_8x16b); /* row=0*/
  200|       |
  201|       |                /* (nt - 1 - row) * pu1_ref[two_nt + 1 + col] */
  202|  2.61M|                res_temp1_8x16b  = _mm_mullo_epi16(src_temp_8x16b,  row_8x16b);
  203|       |
  204|       |                /*(col + 1) * pu1_ref[three_nt + 1]*/
  205|  2.61M|                res_temp2_8x16b  = _mm_mullo_epi16(const_temp_4x32b,  col_8x16b);
  206|       |
  207|       |                /*(nt - 1 - col)* pu1_ref[two_nt - 1 - row]*/
  208|  2.61M|                res_temp3_8x16b  = _mm_mullo_epi16(const_temp2_4x32b,  const_temp5_4x32b);
  209|       |
  210|  2.61M|                res_temp1_8x16b = _mm_add_epi16(res_temp_8x16b, res_temp1_8x16b);
  211|  2.61M|                res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
  212|  2.61M|                res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp3_8x16b);
  213|       |
  214|  2.61M|                res_temp1_8x16b = _mm_srli_epi16(res_temp1_8x16b, (log2nt + 1));
  215|  2.61M|                res_temp1_8x16b = _mm_packus_epi16(res_temp1_8x16b, zero_8x16b);
  216|       |
  217|  2.61M|                _mm_storel_epi64((__m128i *)(pu1_dst + (row * dst_strd) + col), res_temp1_8x16b);
  218|       |
  219|  2.61M|                const_temp5_4x32b = _mm_sub_epi16(const_temp5_4x32b, const_temp7_4x32b);
  220|  2.61M|                col_8x16b = _mm_add_epi16(col_8x16b, const_temp7_4x32b);
  221|  2.61M|            } /* inner loop ends here */
  222|   846k|        }
  223|  85.5k|    }
  224|  85.5k|}
ihevc_intra_pred_chroma_dc_sse42:
  269|  38.0k|{
  270|       |
  271|  38.0k|    WORD32 acc_dc_u, acc_dc_v;
  272|  38.0k|    WORD32 dc_val_u, dc_val_v;
  273|  38.0k|    WORD32 row;
  274|  38.0k|    WORD32 log2nt = 5;
  275|  38.0k|    __m128i src_temp1, src_temp3, src_temp4, src_temp5, src_temp6, m_mask;
  276|  38.0k|    __m128i src_temp7, src_temp8, src_temp9, src_temp10;
  277|  38.0k|    __m128i m_zero = _mm_set1_epi32(0);
  278|  38.0k|    UNUSED(src_strd);
  ------------------
  |  |   38|  38.0k|#define UNUSED(x) ((void)(x))
  ------------------
  279|  38.0k|    UNUSED(mode);
  ------------------
  |  |   38|  38.0k|#define UNUSED(x) ((void)(x))
  ------------------
  280|       |
  281|  38.0k|    switch(nt)
  282|  38.0k|    {
  283|      0|        case 32:
  ------------------
  |  Branch (283:9): [True: 0, False: 38.0k]
  ------------------
  284|      0|            log2nt = 5;
  285|      0|            break;
  286|  14.0k|        case 16:
  ------------------
  |  Branch (286:9): [True: 14.0k, False: 24.0k]
  ------------------
  287|  14.0k|            log2nt = 4;
  288|  14.0k|            break;
  289|  12.9k|        case 8:
  ------------------
  |  Branch (289:9): [True: 12.9k, False: 25.1k]
  ------------------
  290|  12.9k|            log2nt = 3;
  291|  12.9k|            break;
  292|  11.1k|        case 4:
  ------------------
  |  Branch (292:9): [True: 11.1k, False: 26.9k]
  ------------------
  293|  11.1k|            log2nt = 2;
  294|  11.1k|            break;
  295|      0|        default:
  ------------------
  |  Branch (295:9): [True: 0, False: 38.0k]
  ------------------
  296|      0|            break;
  297|  38.0k|    }
  298|       |
  299|  38.0k|    acc_dc_u = 0;
  300|  38.0k|    acc_dc_v = 0;
  301|       |
  302|       |    /* Calculate DC value for the transform block */
  303|       |
  304|  38.0k|    m_mask = _mm_loadu_si128((__m128i *)&IHEVCE_SHUFFLEMASKY9[0]);
  305|       |
  306|  38.0k|    if(nt == 16)
  ------------------
  |  Branch (306:8): [True: 14.0k, False: 24.0k]
  ------------------
  307|  14.0k|    {
  308|  14.0k|        __m128i temp_sad;
  309|       |
  310|  14.0k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  311|  14.0k|        src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 16));
  312|  14.0k|        src_temp7 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 32));
  313|  14.0k|        src_temp8 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 48));
  314|       |
  315|  14.0k|        src_temp5 =  _mm_cvtepu8_epi16(src_temp3);
  316|  14.0k|        src_temp6 =  _mm_cvtepu8_epi16(src_temp4);
  317|  14.0k|        src_temp9 =  _mm_cvtepu8_epi16(src_temp7);
  318|  14.0k|        src_temp10 =  _mm_cvtepu8_epi16(src_temp8);
  319|       |
  320|  14.0k|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  321|  14.0k|        src_temp4 = _mm_srli_si128(src_temp4, 8);
  322|  14.0k|        src_temp7 = _mm_srli_si128(src_temp7, 8);
  323|  14.0k|        src_temp8 = _mm_srli_si128(src_temp8, 8);
  324|       |
  325|  14.0k|        src_temp3 =  _mm_cvtepu8_epi16(src_temp3);
  326|  14.0k|        src_temp4 =  _mm_cvtepu8_epi16(src_temp4);
  327|  14.0k|        src_temp7 =  _mm_cvtepu8_epi16(src_temp7);
  328|  14.0k|        src_temp8 =  _mm_cvtepu8_epi16(src_temp8);
  329|       |
  330|  14.0k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  331|  14.0k|        src_temp6 = _mm_add_epi16(src_temp3, src_temp5);
  332|  14.0k|        src_temp8 = _mm_add_epi16(src_temp7, src_temp8);
  333|  14.0k|        src_temp10 = _mm_add_epi16(src_temp9, src_temp10);
  334|       |
  335|  14.0k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  336|  14.0k|        src_temp8 = _mm_add_epi16(src_temp8, src_temp10);
  337|       |
  338|  14.0k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp8);
  339|  14.0k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  340|  14.0k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  341|  14.0k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  342|       |
  343|  14.0k|        src_temp4 = _mm_cvtepi16_epi32(src_temp4);
  344|  14.0k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  345|  14.0k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  346|  14.0k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  347|  14.0k|    }
  348|       |
  349|  24.0k|    else if(nt == 8)
  ------------------
  |  Branch (349:13): [True: 12.9k, False: 11.1k]
  ------------------
  350|  12.9k|    {
  351|  12.9k|        __m128i temp_sad;
  352|  12.9k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  353|  12.9k|        src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 16));
  354|       |
  355|  12.9k|        src_temp5 =  _mm_cvtepu8_epi16(src_temp3);
  356|  12.9k|        src_temp6 =  _mm_cvtepu8_epi16(src_temp4);
  357|       |
  358|  12.9k|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  359|  12.9k|        src_temp4 = _mm_srli_si128(src_temp4, 8);
  360|       |
  361|  12.9k|        src_temp3 =  _mm_cvtepu8_epi16(src_temp3);
  362|  12.9k|        src_temp4 =  _mm_cvtepu8_epi16(src_temp4);
  363|       |
  364|  12.9k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  365|  12.9k|        src_temp6 = _mm_add_epi16(src_temp3, src_temp5);
  366|       |
  367|  12.9k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  368|  12.9k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  369|  12.9k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  370|  12.9k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  371|       |
  372|  12.9k|        src_temp4 = _mm_cvtepi16_epi32(src_temp4);
  373|  12.9k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  374|  12.9k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  375|  12.9k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  376|  12.9k|    }
  377|       |
  378|  11.1k|    else if(nt == 4)
  ------------------
  |  Branch (378:13): [True: 11.1k, False: 18.4E]
  ------------------
  379|  11.1k|    {
  380|  11.1k|        __m128i temp_sad;
  381|  11.1k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  382|       |
  383|  11.1k|        src_temp5 =  _mm_cvtepu8_epi16(src_temp3);
  384|  11.1k|        src_temp4 = _mm_srli_si128(src_temp3, 8);
  385|  11.1k|        src_temp4 =  _mm_cvtepu8_epi16(src_temp4);
  386|       |
  387|  11.1k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp5);
  388|       |
  389|  11.1k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  390|  11.1k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  391|  11.1k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  392|       |
  393|  11.1k|        src_temp4 = _mm_cvtepi16_epi32(src_temp4);
  394|  11.1k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  395|  11.1k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  396|  11.1k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  397|  11.1k|    }
  398|       |
  399|       |
  400|  38.0k|    acc_dc_u += pu1_ref[6 * nt];
  401|  38.0k|    acc_dc_v += pu1_ref[6 * nt + 1];
  402|       |
  403|  38.0k|    acc_dc_u -= pu1_ref[4 * nt];
  404|  38.0k|    acc_dc_v -= pu1_ref[4 * nt + 1];
  405|       |
  406|  38.0k|    dc_val_u = (acc_dc_u + nt) >> (log2nt + 1);
  407|  38.0k|    dc_val_v = (acc_dc_v + nt) >> (log2nt + 1);
  408|       |
  409|  38.0k|    dc_val_u = dc_val_u | (dc_val_v << 8);
  410|       |
  411|       |    /* Fill the remaining rows with DC value*/
  412|       |
  413|  38.0k|    if(nt == 4)
  ------------------
  |  Branch (413:8): [True: 11.1k, False: 26.9k]
  ------------------
  414|  11.1k|    {
  415|  11.1k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  416|       |
  417|       |        /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  418|  11.1k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  419|  11.1k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  420|  11.1k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  421|  11.1k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  422|       |
  423|  11.1k|    }
  424|  26.9k|    else if(nt == 8)
  ------------------
  |  Branch (424:13): [True: 12.9k, False: 14.0k]
  ------------------
  425|  12.9k|    {
  426|  12.9k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  427|       |
  428|       |        /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  429|  12.9k|        _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  430|  12.9k|        _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  431|  12.9k|        _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  432|  12.9k|        _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  433|       |
  434|  12.9k|        _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp1);
  435|  12.9k|        _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp1);
  436|  12.9k|        _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp1);
  437|  12.9k|        _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp1);
  438|       |
  439|  12.9k|    }
  440|       |
  441|  14.0k|    else /* nt == 16 */
  442|  14.0k|    {
  443|       |
  444|  14.0k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  445|       |
  446|  42.1k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (446:22): [True: 28.0k, False: 14.0k]
  ------------------
  447|  28.0k|        {
  448|       |            /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  449|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  450|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  451|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  452|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  453|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (0 * dst_strd)), src_temp1);
  454|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (1 * dst_strd)), src_temp1);
  455|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (2 * dst_strd)), src_temp1);
  456|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (3 * dst_strd)), src_temp1);
  457|       |
  458|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp1);
  459|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp1);
  460|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp1);
  461|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp1);
  462|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (4 * dst_strd)), src_temp1);
  463|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (5 * dst_strd)), src_temp1);
  464|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (6 * dst_strd)), src_temp1);
  465|  28.0k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (7 * dst_strd)), src_temp1);
  466|       |
  467|  28.0k|            pu1_dst += 8 * dst_strd;
  468|  28.0k|        }
  469|       |
  470|       |
  471|  14.0k|    }
  472|       |
  473|  38.0k|}

ihevc_intra_pred_chroma_planar_ssse3:
  134|   240k|{
  135|       |
  136|   240k|    WORD32 row, col;
  137|   240k|    WORD32 log2nt = 5;
  138|   240k|    WORD32 two_nt, three_nt;
  139|       |
  140|   240k|    __m128i const_temp_4x32b, const_temp1_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
  141|   240k|    __m128i col_8x16b, const_temp5_4x32b, const_temp6_4x32b, zero_8x16b, const_temp7_4x32b;
  142|   240k|    UNUSED(src_strd);
  ------------------
  |  |   38|   240k|#define UNUSED(x) ((void)(x))
  ------------------
  143|   240k|    UNUSED(mode);
  ------------------
  |  |   38|   240k|#define UNUSED(x) ((void)(x))
  ------------------
  144|   240k|    switch(nt)
  145|   240k|    {
  146|  92.5k|        case 16:
  ------------------
  |  Branch (146:9): [True: 92.5k, False: 147k]
  ------------------
  147|  92.5k|            log2nt = 4;
  148|  92.5k|            break;
  149|  86.8k|        case 8:
  ------------------
  |  Branch (149:9): [True: 86.8k, False: 153k]
  ------------------
  150|  86.8k|            log2nt = 3;
  151|  86.8k|            break;
  152|  60.9k|        case 4:
  ------------------
  |  Branch (152:9): [True: 60.9k, False: 179k]
  ------------------
  153|  60.9k|            log2nt = 2;
  154|  60.9k|            break;
  155|      0|        default:
  ------------------
  |  Branch (155:9): [True: 0, False: 240k]
  ------------------
  156|      0|            break;
  157|   240k|    }
  158|   240k|    two_nt = 2 * nt;
  159|   240k|    three_nt = 3 * nt;
  160|       |
  161|       |    /* Planar filtering */
  162|       |
  163|       |/* setting vallues in  registera*/
  164|       |
  165|       |//  pu1_ref[2*(two_nt - 1 - row)]
  166|       |//  pu1_ref[2 * (three_nt + 1)]
  167|       |//  pu1_ref[2 * (two_nt + 1) + col]
  168|       |//  pu1_ref[2 * (nt - 1)]
  169|       |
  170|   240k|    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],
  171|   240k|                                      pu1_ref[2 * (three_nt + 1)], pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)],
  172|   240k|                                      pu1_ref[2 * (three_nt + 1) + 1], pu1_ref[2 * (three_nt + 1)]);
  173|       |
  174|   240k|    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)],
  175|   240k|                                      pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)], pu1_ref[2 * (nt - 1) + 1], pu1_ref[2 * (nt - 1)]);
  176|       |
  177|   240k|    const_temp4_4x32b = _mm_set1_epi16(nt - 1);
  178|   240k|    const_temp6_4x32b = _mm_set1_epi16(nt);
  179|   240k|    const_temp7_4x32b = _mm_set1_epi16(4);
  180|       |
  181|   240k|    zero_8x16b = _mm_set1_epi32(0);
  182|       |
  183|       |
  184|   240k|    if(nt % 4 == 0)
  ------------------
  |  Branch (184:8): [True: 240k, False: 42]
  ------------------
  185|   240k|    {
  186|   240k|        const_temp7_4x32b = _mm_set1_epi16(4);
  187|       |
  188|  2.64M|        for(row = 0; row < nt; row++)
  ------------------
  |  Branch (188:22): [True: 2.40M, False: 240k]
  ------------------
  189|  2.40M|        {
  190|  2.40M|            __m128i res_temp_8x16b, row_8x16b, res_temp1_8x16b, res_temp2_8x16b;
  191|  2.40M|            __m128i res_temp3_8x16b;
  192|       |
  193|  2.40M|            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],
  194|  2.40M|                                               pu1_ref[2 * (two_nt - 1 - row)], pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)],
  195|  2.40M|                                               pu1_ref[2 * (two_nt - 1 - row) + 1], pu1_ref[2 * (two_nt - 1 - row)]);
  196|       |
  197|  2.40M|            const_temp3_4x32b  = _mm_set1_epi16((row + 1));
  198|  2.40M|            row_8x16b = _mm_set1_epi16((nt - 1 - row));
  199|       |
  200|  2.40M|            const_temp5_4x32b = _mm_set_epi16(3, 3, 2, 2, 1, 1, 0, 0);
  201|  2.40M|            col_8x16b = _mm_set_epi16(4, 4, 3, 3, 2, 2, 1, 1);
  202|       |
  203|  2.40M|            const_temp5_4x32b = _mm_sub_epi16(const_temp4_4x32b, const_temp5_4x32b);
  204|       |
  205|       |            /*(row + 1) * pu1_ref[nt - 1]*/
  206|  2.40M|            res_temp_8x16b  = _mm_mullo_epi16(const_temp3_4x32b,  const_temp1_4x32b);
  207|       |
  208|       |            /*(row + 1) * pu1_ref[nt - 1] + nt)*/
  209|  2.40M|            res_temp_8x16b = _mm_add_epi16(res_temp_8x16b, const_temp6_4x32b);
  210|       |
  211|  9.91M|            for(col = 0; col < 2 * nt; col += 8)
  ------------------
  |  Branch (211:26): [True: 7.50M, False: 2.40M]
  ------------------
  212|  7.50M|            {
  213|  7.50M|                __m128i src_temp_8x16b;
  214|       |
  215|       |                /* loding 8bit 16 pixles*/
  216|  7.50M|                src_temp_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (two_nt + 1) + col));
  217|       |
  218|       |                //src_temp_8x16b =  _mm_cvtepu8_epi16 (src_temp_8x16b); /* row=0*/
  219|  7.50M|                src_temp_8x16b = _mm_unpacklo_epi8(src_temp_8x16b, zero_8x16b);
  220|       |
  221|       |                /* (nt - 1 - row) * pu1_ref[two_nt + 1 + col] */
  222|  7.50M|                res_temp1_8x16b  = _mm_mullo_epi16(src_temp_8x16b,  row_8x16b);
  223|       |
  224|       |                /*(col + 1) * pu1_ref[three_nt + 1]*/
  225|  7.50M|                res_temp2_8x16b  = _mm_mullo_epi16(const_temp_4x32b,  col_8x16b);
  226|       |
  227|       |                /*(nt - 1 - col)* pu1_ref[two_nt - 1 - row]*/
  228|  7.50M|                res_temp3_8x16b  = _mm_mullo_epi16(const_temp2_4x32b,  const_temp5_4x32b);
  229|       |
  230|  7.50M|                res_temp1_8x16b = _mm_add_epi16(res_temp_8x16b, res_temp1_8x16b);
  231|  7.50M|                res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp2_8x16b);
  232|  7.50M|                res_temp1_8x16b = _mm_add_epi16(res_temp1_8x16b, res_temp3_8x16b);
  233|       |
  234|  7.50M|                res_temp1_8x16b = _mm_srli_epi16(res_temp1_8x16b, (log2nt + 1));
  235|  7.50M|                res_temp1_8x16b = _mm_packus_epi16(res_temp1_8x16b, zero_8x16b);
  236|       |
  237|  7.50M|                _mm_storel_epi64((__m128i *)(pu1_dst + (row * dst_strd) + col), res_temp1_8x16b);
  238|       |
  239|  7.50M|                const_temp5_4x32b = _mm_sub_epi16(const_temp5_4x32b, const_temp7_4x32b);
  240|  7.50M|                col_8x16b = _mm_add_epi16(col_8x16b, const_temp7_4x32b);
  241|  7.50M|            } /* inner loop ends here */
  242|  2.40M|        }
  243|   240k|    }
  244|   240k|}
ihevc_intra_pred_chroma_dc_ssse3:
  290|   138k|{
  291|       |
  292|   138k|    WORD32 acc_dc_u, acc_dc_v;
  293|   138k|    WORD32 dc_val_u, dc_val_v;
  294|   138k|    WORD32 row;
  295|   138k|    WORD32 log2nt = 5;
  296|   138k|    __m128i src_temp1, src_temp3, src_temp4, src_temp5, src_temp6, m_mask;
  297|   138k|    __m128i src_temp7, src_temp8, src_temp9, src_temp10;
  298|   138k|    __m128i m_zero = _mm_set1_epi32(0);
  299|   138k|    UNUSED(src_strd);
  ------------------
  |  |   38|   138k|#define UNUSED(x) ((void)(x))
  ------------------
  300|   138k|    UNUSED(mode);
  ------------------
  |  |   38|   138k|#define UNUSED(x) ((void)(x))
  ------------------
  301|       |
  302|   138k|    switch(nt)
  303|   138k|    {
  304|      0|        case 32:
  ------------------
  |  Branch (304:9): [True: 0, False: 138k]
  ------------------
  305|      0|            log2nt = 5;
  306|      0|            break;
  307|  58.4k|        case 16:
  ------------------
  |  Branch (307:9): [True: 58.4k, False: 80.2k]
  ------------------
  308|  58.4k|            log2nt = 4;
  309|  58.4k|            break;
  310|  40.5k|        case 8:
  ------------------
  |  Branch (310:9): [True: 40.5k, False: 98.1k]
  ------------------
  311|  40.5k|            log2nt = 3;
  312|  40.5k|            break;
  313|  39.6k|        case 4:
  ------------------
  |  Branch (313:9): [True: 39.6k, False: 99.0k]
  ------------------
  314|  39.6k|            log2nt = 2;
  315|  39.6k|            break;
  316|      0|        default:
  ------------------
  |  Branch (316:9): [True: 0, False: 138k]
  ------------------
  317|      0|            break;
  318|   138k|    }
  319|       |
  320|   138k|    acc_dc_u = 0;
  321|   138k|    acc_dc_v = 0;
  322|       |
  323|       |    /* Calculate DC value for the transform block */
  324|       |
  325|   138k|    m_mask = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY9[0]);
  326|       |
  327|   138k|    if(nt == 16)
  ------------------
  |  Branch (327:8): [True: 58.4k, False: 80.2k]
  ------------------
  328|  58.4k|    {
  329|  58.4k|        __m128i temp_sad, sign_8x16b;
  330|       |
  331|  58.4k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  332|  58.4k|        src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 16));
  333|  58.4k|        src_temp7 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 32));
  334|  58.4k|        src_temp8 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 48));
  335|       |
  336|  58.4k|        src_temp5  = _mm_unpacklo_epi8(src_temp3, m_zero);
  337|  58.4k|        src_temp6  = _mm_unpacklo_epi8(src_temp4, m_zero);
  338|  58.4k|        src_temp9  = _mm_unpacklo_epi8(src_temp7, m_zero);
  339|  58.4k|        src_temp10 = _mm_unpacklo_epi8(src_temp8, m_zero);
  340|       |
  341|  58.4k|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  342|  58.4k|        src_temp4 = _mm_srli_si128(src_temp4, 8);
  343|  58.4k|        src_temp7 = _mm_srli_si128(src_temp7, 8);
  344|  58.4k|        src_temp8 = _mm_srli_si128(src_temp8, 8);
  345|       |
  346|  58.4k|        src_temp3 = _mm_unpacklo_epi8(src_temp3, m_zero);
  347|  58.4k|        src_temp4 = _mm_unpacklo_epi8(src_temp4, m_zero);
  348|  58.4k|        src_temp7 = _mm_unpacklo_epi8(src_temp7, m_zero);
  349|  58.4k|        src_temp8 = _mm_unpacklo_epi8(src_temp8, m_zero);
  350|       |
  351|  58.4k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  352|  58.4k|        src_temp6 = _mm_add_epi16(src_temp3, src_temp5);
  353|  58.4k|        src_temp8 = _mm_add_epi16(src_temp7, src_temp8);
  354|  58.4k|        src_temp10 = _mm_add_epi16(src_temp9, src_temp10);
  355|       |
  356|  58.4k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  357|  58.4k|        src_temp8 = _mm_add_epi16(src_temp8, src_temp10);
  358|       |
  359|  58.4k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp8);
  360|  58.4k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  361|  58.4k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  362|  58.4k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  363|       |
  364|  58.4k|        sign_8x16b = _mm_cmpgt_epi16(m_zero, src_temp4);
  365|  58.4k|        src_temp4  = _mm_unpacklo_epi16(src_temp4, sign_8x16b);
  366|       |
  367|  58.4k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  368|  58.4k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  369|  58.4k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  370|  58.4k|    }
  371|       |
  372|  80.2k|    else if(nt == 8)
  ------------------
  |  Branch (372:13): [True: 40.5k, False: 39.6k]
  ------------------
  373|  40.5k|    {
  374|  40.5k|        __m128i temp_sad, sign_8x16b;
  375|  40.5k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  376|  40.5k|        src_temp4 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt) + 16));
  377|       |
  378|  40.5k|        src_temp5 = _mm_unpacklo_epi8(src_temp3, m_zero);
  379|  40.5k|        src_temp6 = _mm_unpacklo_epi8(src_temp4, m_zero);
  380|       |
  381|  40.5k|        src_temp3 = _mm_srli_si128(src_temp3, 8);
  382|  40.5k|        src_temp4 = _mm_srli_si128(src_temp4, 8);
  383|       |
  384|  40.5k|        src_temp3 = _mm_unpacklo_epi8(src_temp3, m_zero);
  385|  40.5k|        src_temp4 = _mm_unpacklo_epi8(src_temp4, m_zero);
  386|       |
  387|  40.5k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  388|  40.5k|        src_temp6 = _mm_add_epi16(src_temp3, src_temp5);
  389|       |
  390|  40.5k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp6);
  391|  40.5k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  392|  40.5k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  393|  40.5k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  394|       |
  395|  40.5k|        sign_8x16b = _mm_cmpgt_epi16(m_zero, src_temp4);
  396|  40.5k|        src_temp4  = _mm_unpacklo_epi16(src_temp4, sign_8x16b);
  397|       |
  398|  40.5k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  399|  40.5k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  400|  40.5k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  401|  40.5k|    }
  402|       |
  403|  39.6k|    else if(nt == 4)
  ------------------
  |  Branch (403:13): [True: 39.6k, False: 18.4E]
  ------------------
  404|  39.6k|    {
  405|  39.6k|        __m128i temp_sad, sign_8x16b;
  406|  39.6k|        src_temp3 =  _mm_loadu_si128((__m128i *)(pu1_ref + (2 * nt)));
  407|       |
  408|  39.6k|        src_temp5 =  _mm_unpacklo_epi8(src_temp3, m_zero);
  409|  39.6k|        src_temp4 = _mm_srli_si128(src_temp3, 8);
  410|       |
  411|  39.6k|        src_temp4 =  _mm_unpacklo_epi8(src_temp4, m_zero);
  412|       |
  413|  39.6k|        src_temp4 = _mm_add_epi16(src_temp4, src_temp5);
  414|       |
  415|  39.6k|        src_temp4 = _mm_shuffle_epi8(src_temp4, m_mask);
  416|  39.6k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  417|  39.6k|        src_temp4 = _mm_hadd_epi16(src_temp4, m_zero);
  418|       |
  419|  39.6k|        sign_8x16b = _mm_cmpgt_epi16(m_zero, src_temp4);
  420|  39.6k|        src_temp4  = _mm_unpacklo_epi16(src_temp4, sign_8x16b);
  421|       |
  422|  39.6k|        temp_sad  = _mm_srli_si128(src_temp4, 4); /* Next 32 bits */
  423|  39.6k|        acc_dc_u  = _mm_cvtsi128_si32(src_temp4);
  424|  39.6k|        acc_dc_v  = _mm_cvtsi128_si32(temp_sad);
  425|  39.6k|    }
  426|       |
  427|       |
  428|   138k|    acc_dc_u += pu1_ref[6 * nt];
  429|   138k|    acc_dc_v += pu1_ref[6 * nt + 1];
  430|       |
  431|   138k|    acc_dc_u -= pu1_ref[4 * nt];
  432|   138k|    acc_dc_v -= pu1_ref[4 * nt + 1];
  433|       |
  434|   138k|    dc_val_u = (acc_dc_u + nt) >> (log2nt + 1);
  435|   138k|    dc_val_v = (acc_dc_v + nt) >> (log2nt + 1);
  436|       |
  437|   138k|    dc_val_u = dc_val_u | (dc_val_v << 8);
  438|       |
  439|       |    /* Fill the remaining rows with DC value*/
  440|       |
  441|   138k|    if(nt == 4)
  ------------------
  |  Branch (441:8): [True: 39.6k, False: 99.0k]
  ------------------
  442|  39.6k|    {
  443|  39.6k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  444|       |
  445|       |        /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  446|  39.6k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  447|  39.6k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  448|  39.6k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  449|  39.6k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  450|       |
  451|  39.6k|    }
  452|  99.0k|    else if(nt == 8)
  ------------------
  |  Branch (452:13): [True: 40.5k, False: 58.4k]
  ------------------
  453|  40.5k|    {
  454|  40.5k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  455|       |
  456|       |        /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  457|  40.5k|        _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  458|  40.5k|        _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  459|  40.5k|        _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  460|  40.5k|        _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  461|       |
  462|  40.5k|        _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp1);
  463|  40.5k|        _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp1);
  464|  40.5k|        _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp1);
  465|  40.5k|        _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp1);
  466|       |
  467|  40.5k|    }
  468|       |
  469|  58.4k|    else /* nt == 16 */
  470|  58.4k|    {
  471|  58.4k|        src_temp1 = _mm_set1_epi16(dc_val_u);
  472|       |
  473|   175k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (473:22): [True: 116k, False: 58.4k]
  ------------------
  474|   116k|        {
  475|       |            /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  476|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  477|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  478|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  479|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  480|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (0 * dst_strd)), src_temp1);
  481|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (1 * dst_strd)), src_temp1);
  482|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (2 * dst_strd)), src_temp1);
  483|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (3 * dst_strd)), src_temp1);
  484|       |
  485|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp1);
  486|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp1);
  487|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp1);
  488|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp1);
  489|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (4 * dst_strd)), src_temp1);
  490|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (5 * dst_strd)), src_temp1);
  491|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (6 * dst_strd)), src_temp1);
  492|   116k|            _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (7 * dst_strd)), src_temp1);
  493|       |
  494|   116k|            pu1_dst += 8 * dst_strd;
  495|   116k|        }
  496|  58.4k|    }
  497|       |
  498|   138k|}
ihevc_intra_pred_chroma_horz_ssse3:
  544|  56.2k|{
  545|       |
  546|  56.2k|    WORD32 row;
  547|  56.2k|    __m128i temp1, temp2, temp3, temp4, temp5, temp6,  temp7, temp8;
  548|  56.2k|    UNUSED(src_strd);
  ------------------
  |  |   38|  56.2k|#define UNUSED(x) ((void)(x))
  ------------------
  549|  56.2k|    UNUSED(mode);
  ------------------
  |  |   38|  56.2k|#define UNUSED(x) ((void)(x))
  ------------------
  550|       |
  551|       |    /* Replication to next rows*/
  552|       |
  553|  56.2k|    if(nt == 8)
  ------------------
  |  Branch (553:8): [True: 17.8k, False: 38.4k]
  ------------------
  554|  17.8k|    {
  555|  53.4k|        for(row = 0; row < nt; row += 4)
  ------------------
  |  Branch (555:22): [True: 35.6k, False: 17.8k]
  ------------------
  556|  35.6k|        {
  557|  35.6k|            temp1 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 0)]);
  558|  35.6k|            temp2 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 0)]);
  559|  35.6k|            temp3 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 1)]);
  560|  35.6k|            temp4 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 1)]);
  561|  35.6k|            temp5 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 2)]);
  562|  35.6k|            temp6 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 2)]);
  563|  35.6k|            temp7 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 3)]);
  564|  35.6k|            temp8 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 3)]);
  565|       |
  566|  35.6k|            temp2 = _mm_unpacklo_epi8(temp1, temp2);
  567|  35.6k|            temp4 = _mm_unpacklo_epi8(temp3, temp4);
  568|  35.6k|            temp6 = _mm_unpacklo_epi8(temp5, temp6);
  569|  35.6k|            temp8 = _mm_unpacklo_epi8(temp7, temp8);
  570|       |
  571|  35.6k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd)), temp2);
  572|  35.6k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd)), temp4);
  573|  35.6k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd)), temp6);
  574|  35.6k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd)), temp8);
  575|       |
  576|  35.6k|        }
  577|  17.8k|    }
  578|  38.4k|    else if(nt == 16)
  ------------------
  |  Branch (578:13): [True: 19.3k, False: 19.0k]
  ------------------
  579|  19.3k|    {
  580|  96.8k|        for(row = 0; row < nt; row += 4)
  ------------------
  |  Branch (580:22): [True: 77.4k, False: 19.3k]
  ------------------
  581|  77.4k|        {
  582|  77.4k|            temp1 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 0)]);
  583|  77.4k|            temp2 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 0)]);
  584|       |
  585|  77.4k|            temp3 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 1)]);
  586|  77.4k|            temp4 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 1)]);
  587|       |
  588|  77.4k|            temp5 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 2)]);
  589|  77.4k|            temp6 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 2)]);
  590|       |
  591|  77.4k|            temp7 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * (row + 3)]);
  592|  77.4k|            temp8 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * (row + 3)]);
  593|       |
  594|  77.4k|            temp2 = _mm_unpacklo_epi8(temp1, temp2);
  595|  77.4k|            temp4 = _mm_unpacklo_epi8(temp3, temp4);
  596|  77.4k|            temp6 = _mm_unpacklo_epi8(temp5, temp6);
  597|  77.4k|            temp8 = _mm_unpacklo_epi8(temp7, temp8);
  598|       |
  599|  77.4k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd) + 0), temp2);
  600|  77.4k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 0) * dst_strd) + 16), temp2);
  601|       |
  602|  77.4k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd) + 0), temp4);
  603|  77.4k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 1) * dst_strd) + 16), temp4);
  604|       |
  605|  77.4k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd) + 0), temp6);
  606|  77.4k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 2) * dst_strd) + 16), temp6);
  607|       |
  608|  77.4k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd) + 0), temp8);
  609|  77.4k|            _mm_storeu_si128((__m128i *)(pu1_dst + ((row + 3) * dst_strd) + 16), temp8);
  610|       |
  611|       |
  612|  77.4k|        }
  613|  19.3k|    }
  614|  19.0k|    else
  615|  19.0k|    {
  616|  19.0k|        temp1 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * 0]);
  617|  19.0k|        temp2 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * 0]);
  618|       |
  619|  19.0k|        temp3 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * 1]);
  620|  19.0k|        temp4 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * 1]);
  621|       |
  622|  19.0k|        temp5 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * 2]);
  623|  19.0k|        temp6 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * 2]);
  624|       |
  625|  19.0k|        temp7 = _mm_set1_epi8(pu1_ref[(4 * nt) - 2 - 2 * 3]);
  626|  19.0k|        temp8 = _mm_set1_epi8(pu1_ref[(4 * nt) - 1 - 2 * 3]);
  627|       |
  628|  19.0k|        temp2 = _mm_unpacklo_epi8(temp1, temp2);
  629|  19.0k|        temp4 = _mm_unpacklo_epi8(temp3, temp4);
  630|  19.0k|        temp6 = _mm_unpacklo_epi8(temp5, temp6);
  631|  19.0k|        temp8 = _mm_unpacklo_epi8(temp7, temp8);
  632|       |
  633|  19.0k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), temp2);
  634|  19.0k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), temp4);
  635|  19.0k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), temp6);
  636|  19.0k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), temp8);
  637|  19.0k|    }
  638|  56.2k|}
ihevc_intra_pred_chroma_ver_ssse3:
  684|   163k|{
  685|   163k|    __m128i src_temp1;
  686|   163k|    UNUSED(src_strd);
  ------------------
  |  |   38|   163k|#define UNUSED(x) ((void)(x))
  ------------------
  687|   163k|    UNUSED(mode);
  ------------------
  |  |   38|   163k|#define UNUSED(x) ((void)(x))
  ------------------
  688|       |
  689|       |    /* Replication to next columns*/
  690|   163k|    if(nt == 8)
  ------------------
  |  Branch (690:8): [True: 48.7k, False: 114k]
  ------------------
  691|  48.7k|    {
  692|  48.7k|        src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 0));
  693|       |
  694|  48.7k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((0) * dst_strd)), src_temp1);
  695|  48.7k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((1) * dst_strd)), src_temp1);
  696|  48.7k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((2) * dst_strd)), src_temp1);
  697|  48.7k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((3) * dst_strd)), src_temp1);
  698|       |
  699|  48.7k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((4) * dst_strd)), src_temp1);
  700|  48.7k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((5) * dst_strd)), src_temp1);
  701|  48.7k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((6) * dst_strd)), src_temp1);
  702|  48.7k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((7) * dst_strd)), src_temp1);
  703|       |
  704|  48.7k|    }
  705|   163k|    if(nt == 16)
  ------------------
  |  Branch (705:8): [True: 68.2k, False: 94.9k]
  ------------------
  706|  68.2k|    {
  707|  68.2k|        __m128i temp1, temp2;
  708|       |
  709|  68.2k|        temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 0));
  710|  68.2k|        temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 16));
  711|       |
  712|       |        /*  pu1_dst[(row * dst_strd) + col] = dc_val;*/
  713|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((0) * dst_strd)), temp1);
  714|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((1) * dst_strd)), temp1);
  715|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((2) * dst_strd)), temp1);
  716|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((3) * dst_strd)), temp1);
  717|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((4) * dst_strd)), temp1);
  718|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((5) * dst_strd)), temp1);
  719|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((6) * dst_strd)), temp1);
  720|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((7) * dst_strd)), temp1);
  721|       |
  722|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((0) * dst_strd)), temp2);
  723|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((1) * dst_strd)), temp2);
  724|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((2) * dst_strd)), temp2);
  725|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((3) * dst_strd)), temp2);
  726|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((4) * dst_strd)), temp2);
  727|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((5) * dst_strd)), temp2);
  728|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((6) * dst_strd)), temp2);
  729|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((7) * dst_strd)), temp2);
  730|       |
  731|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((8) * dst_strd)), temp1);
  732|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((9) * dst_strd)), temp1);
  733|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((10) * dst_strd)), temp1);
  734|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((11) * dst_strd)), temp1);
  735|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((12) * dst_strd)), temp1);
  736|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((13) * dst_strd)), temp1);
  737|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((14) * dst_strd)), temp1);
  738|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + ((15) * dst_strd)), temp1);
  739|       |
  740|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((8) * dst_strd)), temp2);
  741|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((9) * dst_strd)), temp2);
  742|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((10) * dst_strd)), temp2);
  743|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((11) * dst_strd)), temp2);
  744|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((12) * dst_strd)), temp2);
  745|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((13) * dst_strd)), temp2);
  746|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((14) * dst_strd)), temp2);
  747|  68.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + 16 + ((15) * dst_strd)), temp2);
  748|       |
  749|  68.2k|    }
  750|  94.9k|    else
  751|  94.9k|    {
  752|  94.9k|        src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) + 2 + 0));
  753|       |
  754|  94.9k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  755|  94.9k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp1);
  756|  94.9k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp1);
  757|  94.9k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp1);
  758|       |
  759|       |
  760|  94.9k|    }
  761|       |
  762|   163k|}
ihevc_intra_pred_chroma_mode2_ssse3:
  807|  29.9k|{
  808|  29.9k|    WORD32 row, col;
  809|       |
  810|       |
  811|  29.9k|    __m128i src_temp1, src_temp2, src_temp3, src_temp4, src_temp5, src_temp6, src_temp7, src_temp8, sm2, sm3;
  812|  29.9k|    UNUSED(src_strd);
  ------------------
  |  |   38|  29.9k|#define UNUSED(x) ((void)(x))
  ------------------
  813|  29.9k|    UNUSED(mode);
  ------------------
  |  |   38|  29.9k|#define UNUSED(x) ((void)(x))
  ------------------
  814|       |
  815|  29.9k|    sm2 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY7[0]);
  816|  29.9k|    sm3 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY8[0]);
  817|       |
  818|       |    /* For the angle 45, replication is done from the corresponding angle */
  819|       |    /* intra_pred_ang = tan(angle) in q5 format */
  820|       |
  821|  29.9k|    if(nt == 4)
  ------------------
  |  Branch (821:8): [True: 7.66k, False: 22.2k]
  ------------------
  822|  7.66k|    {
  823|       |        /*pu1_ref[two_nt - row - (col+1) - 1]*/
  824|  7.66k|        src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 0 - 8 - 2));
  825|  7.66k|        src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 1 - 8 - 2));
  826|  7.66k|        src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 2 - 8 - 2));
  827|  7.66k|        src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 3 - 8 - 2));
  828|       |
  829|  7.66k|        _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), _mm_shuffle_epi8(src_temp1, sm2));
  830|  7.66k|        _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), _mm_shuffle_epi8(src_temp2, sm2));
  831|  7.66k|        _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), _mm_shuffle_epi8(src_temp3, sm2));
  832|  7.66k|        _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), _mm_shuffle_epi8(src_temp4, sm2));
  833|       |
  834|  7.66k|    }
  835|  22.2k|    else if(nt == 8)
  ------------------
  |  Branch (835:13): [True: 10.2k, False: 11.9k]
  ------------------
  836|  10.2k|    {
  837|       |        /*pu1_ref[two_nt - row - (col+1) - 1]*/
  838|  10.2k|        src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 0 - 16 - 2));
  839|  10.2k|        src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 1 - 16 - 2));
  840|  10.2k|        src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 2 - 16 - 2));
  841|  10.2k|        src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 3 - 16 - 2));
  842|  10.2k|        src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 4 - 16 - 2));
  843|  10.2k|        src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 5 - 16 - 2));
  844|  10.2k|        src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 6 - 16 - 2));
  845|  10.2k|        src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * 7 - 16 - 2));
  846|       |
  847|  10.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), _mm_shuffle_epi8(src_temp1, sm3));
  848|  10.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), _mm_shuffle_epi8(src_temp2, sm3));
  849|  10.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), _mm_shuffle_epi8(src_temp3, sm3));
  850|  10.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), _mm_shuffle_epi8(src_temp4, sm3));
  851|  10.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), _mm_shuffle_epi8(src_temp5, sm3));
  852|  10.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), _mm_shuffle_epi8(src_temp6, sm3));
  853|  10.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), _mm_shuffle_epi8(src_temp7, sm3));
  854|  10.2k|        _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), _mm_shuffle_epi8(src_temp8, sm3));
  855|       |
  856|       |
  857|  10.2k|    }
  858|  11.9k|    else
  859|  11.9k|    {
  860|  35.9k|        for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (860:22): [True: 23.9k, False: 11.9k]
  ------------------
  861|  23.9k|        {
  862|  71.8k|            for(col = 0; col < 2 * nt; col += 16)
  ------------------
  |  Branch (862:26): [True: 47.8k, False: 23.9k]
  ------------------
  863|  47.8k|            {   /*pu1_ref[two_nt - row - (col+1) - 1]*/
  864|  47.8k|                src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 0) - (col + 16) - 2));
  865|  47.8k|                src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 1) - (col + 16) - 2));
  866|  47.8k|                src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 2) - (col + 16) - 2));
  867|  47.8k|                src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 3) - (col + 16) - 2));
  868|  47.8k|                src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 4) - (col + 16) - 2));
  869|  47.8k|                src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 5) - (col + 16) - 2));
  870|  47.8k|                src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 6) - (col + 16) - 2));
  871|  47.8k|                src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + (4 * nt) - 2 * (row + 7) - (col + 16) - 2));
  872|       |
  873|  47.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 0) * dst_strd)), _mm_shuffle_epi8(src_temp1, sm3));
  874|  47.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 1) * dst_strd)), _mm_shuffle_epi8(src_temp2, sm3));
  875|  47.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 2) * dst_strd)), _mm_shuffle_epi8(src_temp3, sm3));
  876|  47.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 3) * dst_strd)), _mm_shuffle_epi8(src_temp4, sm3));
  877|  47.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 4) * dst_strd)), _mm_shuffle_epi8(src_temp5, sm3));
  878|  47.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 5) * dst_strd)), _mm_shuffle_epi8(src_temp6, sm3));
  879|  47.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 6) * dst_strd)), _mm_shuffle_epi8(src_temp7, sm3));
  880|  47.8k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + ((row + 7) * dst_strd)), _mm_shuffle_epi8(src_temp8, sm3));
  881|  47.8k|            }
  882|  23.9k|        }
  883|  11.9k|    }
  884|  29.9k|}
ihevc_intra_pred_chroma_mode_18_34_ssse3:
  929|  64.6k|{
  930|  64.6k|    WORD32 row;
  931|  64.6k|    WORD32 idx = 0;
  932|       |
  933|  64.6k|    __m128i src_temp1, src_temp2, src_temp3, src_temp4, src_temp5, src_temp6, src_temp7, src_temp8;
  934|  64.6k|    UNUSED(src_strd);
  ------------------
  |  |   38|  64.6k|#define UNUSED(x) ((void)(x))
  ------------------
  935|       |
  936|  64.6k|    if(mode == 34)
  ------------------
  |  Branch (936:8): [True: 47.8k, False: 16.8k]
  ------------------
  937|  47.8k|    {
  938|  47.8k|        if(nt == 4)
  ------------------
  |  Branch (938:12): [True: 8.48k, False: 39.3k]
  ------------------
  939|  8.48k|        {
  940|       |            /*pu1_ref[two_nt + col + idx + 1]*/
  941|  8.48k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (0 + 1) + (4 * nt) + 2 * idx + 2));
  942|  8.48k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (1 + 1) + (4 * nt) + 2 * idx + 2));
  943|  8.48k|            src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (2 + 1) + (4 * nt) + 2 * idx + 2));
  944|  8.48k|            src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (3 + 1) + (4 * nt) + 2 * idx + 2));
  945|       |
  946|  8.48k|            _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  947|  8.48k|            _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp2);
  948|  8.48k|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp3);
  949|  8.48k|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp4);
  950|       |
  951|  8.48k|        }
  952|  39.3k|        else if(nt == 8)
  ------------------
  |  Branch (952:17): [True: 16.1k, False: 23.2k]
  ------------------
  953|  16.1k|        {
  954|       |            /*pu1_ref[two_nt + col + idx + 1]*/
  955|  16.1k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (0 + 1) + (4 * nt) + 2 * idx + 2));
  956|  16.1k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (1 + 1) + (4 * nt) + 2 * idx + 2));
  957|  16.1k|            src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (2 + 1) + (4 * nt) + 2 * idx + 2));
  958|  16.1k|            src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (3 + 1) + (4 * nt) + 2 * idx + 2));
  959|  16.1k|            src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (4 + 1) + (4 * nt) + 2 * idx + 2));
  960|  16.1k|            src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (5 + 1) + (4 * nt) + 2 * idx + 2));
  961|  16.1k|            src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (6 + 1) + (4 * nt) + 2 * idx + 2));
  962|  16.1k|            src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (7 + 1) + (4 * nt) + 2 * idx + 2));
  963|       |
  964|  16.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
  965|  16.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp2);
  966|  16.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp3);
  967|  16.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp4);
  968|  16.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp5);
  969|  16.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp6);
  970|  16.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp7);
  971|  16.1k|            _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp8);
  972|       |
  973|       |
  974|  16.1k|        }
  975|  23.2k|        else
  976|  23.2k|        {
  977|  23.2k|            __m128i src_temp9, src_temp10, src_temp11, src_temp12, src_temp13, src_temp14, src_temp15, src_temp16;
  978|  69.6k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (978:26): [True: 46.4k, False: 23.2k]
  ------------------
  979|  46.4k|            {
  980|       |                /*pu1_ref[two_nt + col + idx + 1]*/
  981|  46.4k|                src_temp1  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (0 + 1) +  0 + (4 * nt) + 2 * idx + 2));
  982|  46.4k|                src_temp9  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (0 + 1) + 16 + (4 * nt) + 2 * idx + 2));
  983|  46.4k|                src_temp2  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (1 + 1) +  0 + (4 * nt) + 2 * idx + 2));
  984|  46.4k|                src_temp10 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (1 + 1) + 16 + (4 * nt) + 2 * idx + 2));
  985|  46.4k|                src_temp3  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (2 + 1) +  0 + (4 * nt) + 2 * idx + 2));
  986|  46.4k|                src_temp11 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (2 + 1) + 16 + (4 * nt) + 2 * idx + 2));
  987|  46.4k|                src_temp4  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (3 + 1) +  0 + (4 * nt) + 2 * idx + 2));
  988|  46.4k|                src_temp12 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (3 + 1) + 16 + (4 * nt) + 2 * idx + 2));
  989|       |
  990|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (0 * dst_strd)), src_temp1);
  991|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (0 * dst_strd)), src_temp9);
  992|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (1 * dst_strd)), src_temp2);
  993|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (1 * dst_strd)), src_temp10);
  994|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (2 * dst_strd)), src_temp3);
  995|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (2 * dst_strd)), src_temp11);
  996|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (3 * dst_strd)), src_temp4);
  997|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (3 * dst_strd)), src_temp12);
  998|       |
  999|  46.4k|                src_temp5  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (4 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1000|  46.4k|                src_temp13 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (4 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1001|  46.4k|                src_temp6  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (5 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1002|  46.4k|                src_temp14 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (5 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1003|  46.4k|                src_temp7  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (6 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1004|  46.4k|                src_temp15 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (6 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1005|  46.4k|                src_temp8  = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (7 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1006|  46.4k|                src_temp16 = _mm_loadu_si128((__m128i *)(pu1_ref + 2 * (7 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1007|       |
 1008|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (4 * dst_strd)), src_temp5);
 1009|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (4 * dst_strd)), src_temp13);
 1010|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (5 * dst_strd)), src_temp6);
 1011|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (5 * dst_strd)), src_temp14);
 1012|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (6 * dst_strd)), src_temp7);
 1013|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (6 * dst_strd)), src_temp15);
 1014|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (7 * dst_strd)), src_temp8);
 1015|  46.4k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (7 * dst_strd)), src_temp16);
 1016|       |
 1017|  46.4k|                pu1_ref += 2 * 8;
 1018|  46.4k|                pu1_dst += 8 * dst_strd;
 1019|  46.4k|            }
 1020|  23.2k|        }
 1021|  47.8k|    }
 1022|  16.8k|    else
 1023|  16.8k|    {
 1024|  16.8k|        if(nt == 4)
  ------------------
  |  Branch (1024:12): [True: 2.95k, False: 13.8k]
  ------------------
 1025|  2.95k|        {
 1026|       |            /*pu1_ref[two_nt + col + idx + 1]*/
 1027|  2.95k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (0 + 1) + (4 * nt) + 2 * idx + 2));
 1028|  2.95k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (1 + 1) + (4 * nt) + 2 * idx + 2));
 1029|  2.95k|            src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (2 + 1) + (4 * nt) + 2 * idx + 2));
 1030|  2.95k|            src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (3 + 1) + (4 * nt) + 2 * idx + 2));
 1031|       |
 1032|  2.95k|            _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
 1033|  2.95k|            _mm_storel_epi64((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp2);
 1034|  2.95k|            _mm_storel_epi64((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp3);
 1035|  2.95k|            _mm_storel_epi64((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp4);
 1036|       |
 1037|       |
 1038|  2.95k|        }
 1039|  13.8k|        else if(nt == 8)
  ------------------
  |  Branch (1039:17): [True: 5.36k, False: 8.52k]
  ------------------
 1040|  5.36k|        {
 1041|       |            /*pu1_ref[two_nt + col + idx + 1]*/
 1042|  5.36k|            src_temp1 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (0 + 1) + (4 * nt) + 2 * idx + 2));
 1043|  5.36k|            src_temp2 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (1 + 1) + (4 * nt) + 2 * idx + 2));
 1044|  5.36k|            src_temp3 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (2 + 1) + (4 * nt) + 2 * idx + 2));
 1045|  5.36k|            src_temp4 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (3 + 1) + (4 * nt) + 2 * idx + 2));
 1046|  5.36k|            src_temp5 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (4 + 1) + (4 * nt) + 2 * idx + 2));
 1047|  5.36k|            src_temp6 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (5 + 1) + (4 * nt) + 2 * idx + 2));
 1048|  5.36k|            src_temp7 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (6 + 1) + (4 * nt) + 2 * idx + 2));
 1049|  5.36k|            src_temp8 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (7 + 1) + (4 * nt) + 2 * idx + 2));
 1050|       |
 1051|  5.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + (0 * dst_strd)), src_temp1);
 1052|  5.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + (1 * dst_strd)), src_temp2);
 1053|  5.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + (2 * dst_strd)), src_temp3);
 1054|  5.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + (3 * dst_strd)), src_temp4);
 1055|  5.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + (4 * dst_strd)), src_temp5);
 1056|  5.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + (5 * dst_strd)), src_temp6);
 1057|  5.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + (6 * dst_strd)), src_temp7);
 1058|  5.36k|            _mm_storeu_si128((__m128i *)(pu1_dst + (7 * dst_strd)), src_temp8);
 1059|       |
 1060|       |
 1061|  5.36k|        }
 1062|  8.52k|        else
 1063|  8.52k|        {
 1064|  8.52k|            __m128i src_temp9, src_temp10, src_temp11, src_temp12, src_temp13, src_temp14, src_temp15, src_temp16;
 1065|  25.5k|            for(row = 0; row < nt; row += 8)
  ------------------
  |  Branch (1065:26): [True: 17.0k, False: 8.52k]
  ------------------
 1066|  17.0k|            {
 1067|       |                /*pu1_ref[two_nt + col + idx + 1]*/
 1068|  17.0k|                src_temp1  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (0 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1069|  17.0k|                src_temp9  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (0 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1070|  17.0k|                src_temp2  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (1 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1071|  17.0k|                src_temp10 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (1 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1072|  17.0k|                src_temp3  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (2 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1073|  17.0k|                src_temp11 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (2 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1074|  17.0k|                src_temp4  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (3 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1075|  17.0k|                src_temp12 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (3 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1076|       |
 1077|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (0 * dst_strd)), src_temp1);
 1078|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (0 * dst_strd)), src_temp9);
 1079|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (1 * dst_strd)), src_temp2);
 1080|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (1 * dst_strd)), src_temp10);
 1081|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (2 * dst_strd)), src_temp3);
 1082|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (2 * dst_strd)), src_temp11);
 1083|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (3 * dst_strd)), src_temp4);
 1084|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (3 * dst_strd)), src_temp12);
 1085|       |
 1086|  17.0k|                src_temp5  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (4 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1087|  17.0k|                src_temp13 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (4 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1088|  17.0k|                src_temp6  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (5 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1089|  17.0k|                src_temp14 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (5 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1090|  17.0k|                src_temp7  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (6 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1091|  17.0k|                src_temp15 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (6 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1092|  17.0k|                src_temp8  = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (7 + 1) +  0 + (4 * nt) + 2 * idx + 2));
 1093|  17.0k|                src_temp16 = _mm_loadu_si128((__m128i *)(pu1_ref - 2 * (7 + 1) + 16 + (4 * nt) + 2 * idx + 2));
 1094|       |
 1095|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (4 * dst_strd)), src_temp5);
 1096|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (4 * dst_strd)), src_temp13);
 1097|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (5 * dst_strd)), src_temp6);
 1098|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (5 * dst_strd)), src_temp14);
 1099|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (6 * dst_strd)), src_temp7);
 1100|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (6 * dst_strd)), src_temp15);
 1101|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst +  0 + (7 * dst_strd)), src_temp8);
 1102|  17.0k|                _mm_storeu_si128((__m128i *)(pu1_dst + 16 + (7 * dst_strd)), src_temp16);
 1103|       |
 1104|  17.0k|                pu1_ref -= 2 * 8;
 1105|  17.0k|                pu1_dst += 8 * dst_strd;
 1106|  17.0k|            }
 1107|  8.52k|        }
 1108|  16.8k|    }
 1109|       |
 1110|  64.6k|}
ihevc_intra_pred_chroma_mode_3_to_9_ssse3:
 1155|   126k|{
 1156|   126k|    WORD32 row, col;
 1157|       |
 1158|   126k|    WORD32 intra_pred_ang;
 1159|       |
 1160|   126k|    __m128i const_temp_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
 1161|   126k|    __m128i fract_4x32b, zero_8x16b, intra_pred_ang_4x32b;
 1162|   126k|    __m128i row_4x32b, two_nt_4x32b, ref_main_idx_4x32b, res_temp5_4x32b, sm1;
 1163|   126k|    UNUSED(src_strd);
  ------------------
  |  |   38|   126k|#define UNUSED(x) ((void)(x))
  ------------------
 1164|       |
 1165|       |    /* Intra Pred Angle according to the mode */
 1166|   126k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1167|       |
 1168|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1169|       |    /* samples dependent on distance to obtain destination sample */
 1170|       |
 1171|   126k|    sm1 = _mm_load_si128((__m128i *)&IHEVCE_SHUFFLEMASKY7[0]);
 1172|   126k|    const_temp_4x32b  = _mm_set1_epi16(16);
 1173|   126k|    const_temp2_4x32b = _mm_set1_epi32(31);
 1174|   126k|    const_temp3_4x32b = _mm_set1_epi16(32);
 1175|   126k|    const_temp4_4x32b = _mm_set1_epi32(4);
 1176|       |
 1177|   126k|    two_nt_4x32b = _mm_set1_epi32(1);
 1178|       |
 1179|   126k|    zero_8x16b = _mm_set1_epi16(0);
 1180|       |
 1181|       |
 1182|       |    /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 1183|   126k|    intra_pred_ang_4x32b = _mm_set1_epi32(intra_pred_ang);
 1184|       |
 1185|   126k|    row_4x32b = _mm_set_epi32(4, 3, 2, 1);
 1186|       |
 1187|   126k|    if(nt == 4)
  ------------------
  |  Branch (1187:8): [True: 38.1k, False: 88.1k]
  ------------------
 1188|  38.1k|    {
 1189|  38.1k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 1190|  38.1k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 1191|  38.1k|        const_temp2_4x32b = _mm_set1_epi16(31);
 1192|  38.1k|        const_temp4_4x32b = _mm_set1_epi16(4);
 1193|  38.1k|        two_nt_4x32b = _mm_set1_epi16((4 * nt) - 2);
 1194|       |
 1195|  38.1k|        {
 1196|  38.1k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 1197|  38.1k|            WORD8  ai1_fract_temp_val[16], ai1_src_temp_val[16];
 1198|       |
 1199|  38.1k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b;
 1200|  38.1k|            __m128i src_values10;
 1201|       |
 1202|  38.1k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 1203|       |
 1204|       |            /* pos = ((row + 1) * intra_pred_ang); */
 1205|  38.1k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 1206|       |
 1207|       |            /* fract = pos & (31); */
 1208|  38.1k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 1209|       |
 1210|  38.1k|            ref_main_idx_4x32b = _mm_srai_epi16(res_temp5_4x32b,  5);
 1211|       |
 1212|  38.1k|            ref_main_idx_4x32b = _mm_add_epi16(ref_main_idx_4x32b,  ref_main_idx_4x32b);
 1213|       |
 1214|  38.1k|            ref_main_idx_4x32b = _mm_sub_epi16(two_nt_4x32b, ref_main_idx_4x32b);
 1215|       |
 1216|  38.1k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 1217|       |
 1218|       |            /*(32 - fract) */
 1219|  38.1k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 1220|       |
 1221|  38.1k|            _mm_storel_epi64((__m128i *)(ai1_fract_temp_val), fract_4x32b);
 1222|  38.1k|            _mm_storel_epi64((__m128i *)(ai1_src_temp_val),  src_values10);
 1223|       |
 1224|  38.1k|            fract1_8x16b = _mm_set1_epi8(ai1_fract_temp_val[0]);  /* col=0*/
 1225|  38.1k|            fract2_8x16b = _mm_set1_epi8(ai1_fract_temp_val[2]);  /* col=1*/
 1226|  38.1k|            fract3_8x16b = _mm_set1_epi8(ai1_fract_temp_val[4]);  /* col=2*/
 1227|  38.1k|            fract4_8x16b = _mm_set1_epi8(ai1_fract_temp_val[6]);  /* col=3*/
 1228|       |
 1229|  38.1k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp_val[0]);  /* col=0*/
 1230|  38.1k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp_val[2]);  /* col=1*/
 1231|  38.1k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp_val[4]);  /* col=2*/
 1232|  38.1k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp_val[6]);  /* col=3*/
 1233|       |
 1234|  38.1k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 1235|  38.1k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 1236|  38.1k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 1237|  38.1k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 1238|       |
 1239|  38.1k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 1240|  38.1k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 1241|  38.1k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 1242|  38.1k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 1243|       |
 1244|  38.1k|            {
 1245|  38.1k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1246|  38.1k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 1247|       |
 1248|       |                /* loding 8-bit 16 pixels */
 1249|  38.1k|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx1 - 8)); /* col=0*/
 1250|  38.1k|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx2 - 8)); /* col=1*/
 1251|  38.1k|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx3 - 8)); /* col=2*/
 1252|  38.1k|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx4 - 8)); /* col=3*/
 1253|       |
 1254|  38.1k|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 2); /* col=0*/
 1255|  38.1k|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 2); /* col=1*/
 1256|  38.1k|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 2); /* col=2*/
 1257|  38.1k|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 2); /* col=3*/
 1258|       |
 1259|  38.1k|                src_temp1_8x16b =  _mm_unpacklo_epi8(src_temp1_8x16b, src_temp5_8x16b); /* col=0*/
 1260|  38.1k|                src_temp2_8x16b =  _mm_unpacklo_epi8(src_temp2_8x16b, src_temp6_8x16b); /* col=1*/
 1261|  38.1k|                src_temp3_8x16b =  _mm_unpacklo_epi8(src_temp3_8x16b, src_temp7_8x16b); /* col=2*/
 1262|  38.1k|                src_temp4_8x16b =  _mm_unpacklo_epi8(src_temp4_8x16b, src_temp8_8x16b); /* col=3*/
 1263|       |
 1264|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 1265|  38.1k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 1266|  38.1k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 1267|  38.1k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 1268|  38.1k|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 1269|       |
 1270|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 1271|  38.1k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 1272|  38.1k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 1273|  38.1k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 1274|  38.1k|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 1275|       |
 1276|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 1277|  38.1k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 1278|  38.1k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 1279|  38.1k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 1280|  38.1k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 1281|       |
 1282|       |                /* converting 16 bit to 8 bit */
 1283|  38.1k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, zero_8x16b); /* col=0*/
 1284|  38.1k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, zero_8x16b); /* col=1*/
 1285|  38.1k|                src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, zero_8x16b); /* col=2*/
 1286|  38.1k|                src_temp4_8x16b = _mm_packus_epi16(src_temp4_8x16b, zero_8x16b); /* col=3*/
 1287|       |
 1288|  38.1k|                src_temp1_8x16b = _mm_shuffle_epi8(src_temp1_8x16b, sm1);
 1289|  38.1k|                src_temp2_8x16b = _mm_shuffle_epi8(src_temp2_8x16b, sm1);
 1290|  38.1k|                src_temp3_8x16b = _mm_shuffle_epi8(src_temp3_8x16b, sm1);
 1291|  38.1k|                src_temp4_8x16b = _mm_shuffle_epi8(src_temp4_8x16b, sm1);
 1292|       |
 1293|  38.1k|                src_temp5_8x16b = _mm_unpacklo_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1294|  38.1k|                src_temp6_8x16b = _mm_unpacklo_epi16(src_temp3_8x16b, src_temp4_8x16b);
 1295|       |
 1296|  38.1k|                src_temp8_8x16b = _mm_unpacklo_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1297|  38.1k|                src_temp7_8x16b = _mm_unpackhi_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1298|       |
 1299|  38.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 0)), src_temp8_8x16b);             /* row=0*/
 1300|       |
 1301|  38.1k|                src_temp2_8x16b  = _mm_shuffle_epi32(src_temp8_8x16b, _MM_SHUFFLE(3, 2, 3, 2));
 1302|  38.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (1))), src_temp2_8x16b);       /* row=1*/
 1303|       |
 1304|  38.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (2))), src_temp7_8x16b);       /* row=2*/
 1305|       |
 1306|  38.1k|                src_temp4_8x16b  = _mm_shuffle_epi32(src_temp7_8x16b, _MM_SHUFFLE(3, 2, 3, 2));
 1307|  38.1k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (3))), src_temp4_8x16b);       /* row=4*/
 1308|       |
 1309|  38.1k|            }
 1310|  38.1k|        }
 1311|  38.1k|    }
 1312|  88.1k|    else
 1313|  88.1k|    {
 1314|  88.1k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 1315|  88.1k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 1316|  88.1k|        const_temp2_4x32b = _mm_set1_epi16(31);
 1317|  88.1k|        const_temp4_4x32b = _mm_set1_epi16(8);
 1318|  88.1k|        two_nt_4x32b = _mm_set1_epi16((4 * nt) - 2);
 1319|       |
 1320|   229k|        for(col = 0; col < 2 * nt; col += 16)
  ------------------
  |  Branch (1320:22): [True: 141k, False: 88.1k]
  ------------------
 1321|   141k|        {
 1322|   141k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 1323|   141k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 1324|   141k|            WORD8  ai1_fract_temp_val[16], ai1_src_temp_val[16];
 1325|       |
 1326|   141k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b;
 1327|   141k|            __m128i fract5_8x16b, fract6_8x16b, fract7_8x16b, fract8_8x16b, src_values10;
 1328|       |
 1329|   141k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 1330|   141k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 1331|       |
 1332|       |            /* pos = ((row + 1) * intra_pred_ang); */
 1333|   141k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 1334|       |
 1335|       |            /* fract = pos & (31); */
 1336|   141k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 1337|       |
 1338|   141k|            ref_main_idx_4x32b = _mm_srai_epi16(res_temp5_4x32b,  5);
 1339|       |
 1340|   141k|            ref_main_idx_4x32b = _mm_add_epi16(ref_main_idx_4x32b,  ref_main_idx_4x32b);
 1341|       |
 1342|   141k|            ref_main_idx_4x32b = _mm_sub_epi16(two_nt_4x32b, ref_main_idx_4x32b);
 1343|       |
 1344|   141k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 1345|       |
 1346|       |            /*(32 - fract) */
 1347|   141k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 1348|       |
 1349|   141k|            _mm_storeu_si128((__m128i *)(ai1_fract_temp_val), fract_4x32b);
 1350|   141k|            _mm_storeu_si128((__m128i *)(ai1_src_temp_val),  src_values10);
 1351|       |
 1352|   141k|            fract1_8x16b = _mm_set1_epi8(ai1_fract_temp_val[0]);  /* col=0*/
 1353|   141k|            fract2_8x16b = _mm_set1_epi8(ai1_fract_temp_val[2]);  /* col=1*/
 1354|   141k|            fract3_8x16b = _mm_set1_epi8(ai1_fract_temp_val[4]);  /* col=2*/
 1355|   141k|            fract4_8x16b = _mm_set1_epi8(ai1_fract_temp_val[6]);  /* col=3*/
 1356|       |
 1357|   141k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp_val[0]);  /* col=0*/
 1358|   141k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp_val[2]);  /* col=1*/
 1359|   141k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp_val[4]);  /* col=2*/
 1360|   141k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp_val[6]);  /* col=3*/
 1361|       |
 1362|   141k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 1363|   141k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 1364|   141k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 1365|   141k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 1366|       |
 1367|   141k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 1368|   141k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 1369|   141k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 1370|   141k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 1371|       |
 1372|   141k|            fract5_8x16b = _mm_set1_epi8(ai1_fract_temp_val[8]);  /* col=5*/
 1373|   141k|            fract6_8x16b = _mm_set1_epi8(ai1_fract_temp_val[10]);  /* col=6*/
 1374|   141k|            fract7_8x16b = _mm_set1_epi8(ai1_fract_temp_val[12]);  /* col=7*/
 1375|   141k|            fract8_8x16b = _mm_set1_epi8(ai1_fract_temp_val[14]);  /* col=8*/
 1376|       |
 1377|   141k|            temp11_8x16b = _mm_set1_epi8(ai1_src_temp_val[8]);  /* col=0*/
 1378|   141k|            temp12_8x16b = _mm_set1_epi8(ai1_src_temp_val[10]);  /* col=1*/
 1379|   141k|            temp13_8x16b = _mm_set1_epi8(ai1_src_temp_val[12]);  /* col=2*/
 1380|   141k|            temp14_8x16b = _mm_set1_epi8(ai1_src_temp_val[14]);  /* col=3*/
 1381|       |
 1382|   141k|            temp11_8x16b = _mm_unpacklo_epi8(temp11_8x16b, fract5_8x16b);
 1383|   141k|            temp12_8x16b = _mm_unpacklo_epi8(temp12_8x16b, fract6_8x16b);
 1384|   141k|            temp13_8x16b = _mm_unpacklo_epi8(temp13_8x16b, fract7_8x16b);
 1385|   141k|            temp14_8x16b = _mm_unpacklo_epi8(temp14_8x16b, fract8_8x16b);
 1386|       |
 1387|   141k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 1388|   141k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 1389|   141k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 1390|   141k|            pi2_ref_main_idx8 = _mm_extract_epi16(ref_main_idx_4x32b, 7);    /* col=8*/
 1391|       |
 1392|   634k|            for(row = 0; row < nt; row += 4)
  ------------------
  |  Branch (1392:26): [True: 493k, False: 141k]
  ------------------
 1393|   493k|            {
 1394|   493k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1395|   493k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 1396|       |
 1397|   493k|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 1398|   493k|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 1399|       |
 1400|       |                /* loding 8-bit 16 pixels */
 1401|   493k|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx1 - row - (8 + row))); /* col=0*/
 1402|   493k|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx2 - row - (8 + row))); /* col=1*/
 1403|   493k|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx3 - row - (8 + row))); /* col=2*/
 1404|   493k|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx4 - row - (8 + row))); /* col=3*/
 1405|       |
 1406|   493k|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 2); /* col=0*/
 1407|   493k|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 2); /* col=1*/
 1408|   493k|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 2); /* col=2*/
 1409|   493k|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 2); /* col=3*/
 1410|       |
 1411|   493k|                src_temp1_8x16b =  _mm_unpacklo_epi8(src_temp1_8x16b, src_temp5_8x16b); /* col=0*/
 1412|   493k|                src_temp2_8x16b =  _mm_unpacklo_epi8(src_temp2_8x16b, src_temp6_8x16b); /* col=1*/
 1413|   493k|                src_temp3_8x16b =  _mm_unpacklo_epi8(src_temp3_8x16b, src_temp7_8x16b); /* col=2*/
 1414|   493k|                src_temp4_8x16b =  _mm_unpacklo_epi8(src_temp4_8x16b, src_temp8_8x16b); /* col=3*/
 1415|       |
 1416|       |                /* loding 8-bit 16 pixels */
 1417|   493k|                src_temp15_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx5 - row - row - 8)); /* col=5*/
 1418|   493k|                src_temp16_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx6 - row - row - 8)); /* col=6*/
 1419|   493k|                src_temp17_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx7 - row - row - 8)); /* col=7*/
 1420|   493k|                src_temp18_8x16b = _mm_loadu_si128((__m128i *)(pu1_ref + pi2_ref_main_idx8 - row - row - 8)); /* col=8*/
 1421|       |
 1422|   493k|                src_temp11_8x16b = _mm_srli_si128(src_temp15_8x16b, 2); /* col=5*/
 1423|   493k|                src_temp12_8x16b = _mm_srli_si128(src_temp16_8x16b, 2); /* col=6*/
 1424|   493k|                src_temp13_8x16b = _mm_srli_si128(src_temp17_8x16b, 2); /* col=7*/
 1425|   493k|                src_temp14_8x16b = _mm_srli_si128(src_temp18_8x16b, 2); /* col=8*/
 1426|       |
 1427|   493k|                src_temp11_8x16b =  _mm_unpacklo_epi8(src_temp11_8x16b, src_temp15_8x16b); /* col=0*/
 1428|   493k|                src_temp12_8x16b =  _mm_unpacklo_epi8(src_temp12_8x16b, src_temp16_8x16b); /* col=1*/
 1429|   493k|                src_temp13_8x16b =  _mm_unpacklo_epi8(src_temp13_8x16b, src_temp17_8x16b); /* col=2*/
 1430|   493k|                src_temp14_8x16b =  _mm_unpacklo_epi8(src_temp14_8x16b, src_temp18_8x16b); /* col=3*/
 1431|       |
 1432|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 1433|   493k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 1434|   493k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 1435|   493k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 1436|   493k|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 1437|       |
 1438|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 1439|   493k|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 1440|   493k|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 1441|   493k|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 1442|   493k|                src_temp14_8x16b = _mm_maddubs_epi16(src_temp14_8x16b, temp14_8x16b);
 1443|       |
 1444|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 1445|   493k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 1446|   493k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 1447|   493k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 1448|   493k|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 1449|       |
 1450|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 1451|   493k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 1452|   493k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 1453|   493k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 1454|   493k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 1455|       |
 1456|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 1457|   493k|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 1458|   493k|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 1459|   493k|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 1460|   493k|                src_temp14_8x16b = _mm_add_epi16(src_temp14_8x16b, const_temp_4x32b);
 1461|       |
 1462|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 1463|   493k|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 1464|   493k|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 1465|   493k|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 1466|   493k|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 1467|       |
 1468|       |                /* converting 16 bit to 8 bit */
 1469|   493k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, zero_8x16b); /* col=0*/
 1470|   493k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, zero_8x16b); /* col=1*/
 1471|   493k|                src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, zero_8x16b); /* col=2*/
 1472|   493k|                src_temp4_8x16b = _mm_packus_epi16(src_temp4_8x16b, zero_8x16b); /* col=3*/
 1473|       |
 1474|   493k|                src_temp1_8x16b = _mm_shuffle_epi8(src_temp1_8x16b, sm1);
 1475|   493k|                src_temp2_8x16b = _mm_shuffle_epi8(src_temp2_8x16b, sm1);
 1476|   493k|                src_temp3_8x16b = _mm_shuffle_epi8(src_temp3_8x16b, sm1);
 1477|   493k|                src_temp4_8x16b = _mm_shuffle_epi8(src_temp4_8x16b, sm1);
 1478|       |
 1479|       |                /* converting 16 bit to 8 bit */
 1480|   493k|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, zero_8x16b); /* col=5*/
 1481|   493k|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, zero_8x16b); /* col=6*/
 1482|   493k|                src_temp13_8x16b = _mm_packus_epi16(src_temp13_8x16b, zero_8x16b); /* col=7*/
 1483|   493k|                src_temp14_8x16b = _mm_packus_epi16(src_temp14_8x16b, zero_8x16b); /* col=8*/
 1484|       |
 1485|   493k|                src_temp11_8x16b = _mm_shuffle_epi8(src_temp11_8x16b, sm1);
 1486|   493k|                src_temp12_8x16b = _mm_shuffle_epi8(src_temp12_8x16b, sm1);
 1487|   493k|                src_temp13_8x16b = _mm_shuffle_epi8(src_temp13_8x16b, sm1);
 1488|   493k|                src_temp14_8x16b = _mm_shuffle_epi8(src_temp14_8x16b, sm1);
 1489|       |
 1490|   493k|                src_temp5_8x16b = _mm_unpacklo_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1491|   493k|                src_temp6_8x16b = _mm_unpacklo_epi16(src_temp3_8x16b, src_temp4_8x16b);
 1492|       |
 1493|   493k|                src_temp8_8x16b = _mm_unpacklo_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1494|   493k|                src_temp7_8x16b = _mm_unpackhi_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1495|       |
 1496|   493k|                src_temp15_8x16b = _mm_unpacklo_epi16(src_temp11_8x16b, src_temp12_8x16b);
 1497|   493k|                src_temp16_8x16b = _mm_unpacklo_epi16(src_temp13_8x16b, src_temp14_8x16b);
 1498|       |
 1499|   493k|                src_temp18_8x16b = _mm_unpacklo_epi32(src_temp15_8x16b, src_temp16_8x16b);
 1500|   493k|                src_temp17_8x16b = _mm_unpackhi_epi32(src_temp15_8x16b, src_temp16_8x16b);
 1501|       |
 1502|   493k|                src_temp11_8x16b = _mm_unpacklo_epi64(src_temp8_8x16b, src_temp18_8x16b);
 1503|   493k|                src_temp12_8x16b = _mm_unpackhi_epi64(src_temp8_8x16b, src_temp18_8x16b);
 1504|   493k|                src_temp13_8x16b = _mm_unpacklo_epi64(src_temp7_8x16b, src_temp17_8x16b);
 1505|   493k|                src_temp14_8x16b = _mm_unpackhi_epi64(src_temp7_8x16b, src_temp17_8x16b);
 1506|       |
 1507|   493k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * row)),    src_temp11_8x16b);          /* row=0*/
 1508|   493k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 1))), src_temp12_8x16b);       /* row=1*/
 1509|   493k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 2))), src_temp13_8x16b);       /* row=2*/
 1510|   493k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 3))), src_temp14_8x16b);       /* row=4*/
 1511|       |
 1512|   493k|            }
 1513|   141k|        }
 1514|  88.1k|    }
 1515|   126k|}
ihevc_intra_pred_chroma_mode_11_to_17_ssse3:
 1561|   157k|{
 1562|       |    /* This function and ihevc_intra_pred_CHROMA_mode_19_to_25 are same except*/
 1563|       |    /* for ref main & side samples assignment,can be combined for */
 1564|       |    /* optimzation*/
 1565|       |
 1566|   157k|    WORD32 row, col, k;
 1567|   157k|    WORD32 intra_pred_ang, inv_ang, inv_ang_sum;
 1568|   157k|    WORD32 ref_idx;
 1569|       |
 1570|       |
 1571|   157k|    __m128i const_temp_4x32b, const_temp2_4x32b, const_temp3_4x32b, const_temp4_4x32b;
 1572|   157k|    __m128i fract_4x32b, zero_8x16b, intra_pred_ang_4x32b;
 1573|   157k|    __m128i row_4x32b, two_nt_4x32b, ref_main_idx_4x32b, res_temp5_4x32b;
 1574|       |
 1575|   157k|    UWORD8 ref_temp[2 * MAX_CU_SIZE + 2];
 1576|   157k|    UWORD8 *ref_main;
 1577|   157k|    UNUSED(src_strd);
  ------------------
  |  |   38|   157k|#define UNUSED(x) ((void)(x))
  ------------------
 1578|       |
 1579|   157k|    inv_ang_sum = 128;
 1580|       |
 1581|   157k|    intra_pred_ang = gai4_ihevc_ang_table[mode];
 1582|       |
 1583|   157k|    inv_ang = gai4_ihevc_inv_ang_table[mode - 11];
 1584|       |    /* Intermediate reference samples for negative angle modes */
 1585|       |    /* This have to be removed during optimization*/
 1586|       |
 1587|       |    /* For horizontal modes, (ref main = ref left) (ref side = ref above) */
 1588|       |
 1589|       |
 1590|   157k|    ref_main = ref_temp + 2 * nt;
 1591|  2.06M|    for(k = 0; k < (2 * (nt + 1)); k += 2)
  ------------------
  |  Branch (1591:16): [True: 1.90M, False: 157k]
  ------------------
 1592|  1.90M|    {
 1593|  1.90M|        ref_temp[k + (2 * (nt - 1))] = pu1_ref[(4 * nt) - k];
 1594|  1.90M|        ref_temp[k + 1 + (2 * (nt - 1))] = pu1_ref[(4 * nt) - k + 1];
 1595|  1.90M|    }
 1596|       |
 1597|   157k|    ref_main = ref_temp + (2 * (nt - 1));
 1598|   157k|    ref_idx = (nt * intra_pred_ang) >> 5;
 1599|       |
 1600|       |    /* SIMD Optimization can be done using look-up table for the loop */
 1601|       |    /* For negative angled derive the main reference samples from side */
 1602|       |    /* reference samples refer to section 8.4.4.2.6 */
 1603|       |
 1604|   689k|    for(k = -2; k > (2 * ref_idx); k -= 2)
  ------------------
  |  Branch (1604:17): [True: 531k, False: 157k]
  ------------------
 1605|   531k|    {
 1606|   531k|        inv_ang_sum += inv_ang;
 1607|   531k|        ref_main[k] = pu1_ref[(4 * nt) + ((inv_ang_sum >> 8) << 1)];
 1608|   531k|        ref_main[k + 1] = pu1_ref[((4 * nt) + 1) + ((inv_ang_sum >> 8) << 1)];
 1609|   531k|    }
 1610|       |
 1611|       |    /* For the angles other then 45 degree, interpolation btw 2 neighboring */
 1612|       |    /* samples dependent on distance to obtain destination sample */
 1613|       |
 1614|   157k|    const_temp_4x32b  = _mm_set1_epi16(16);
 1615|   157k|    const_temp2_4x32b = _mm_set1_epi32(31);
 1616|   157k|    const_temp3_4x32b = _mm_set1_epi16(32);
 1617|   157k|    const_temp4_4x32b = _mm_set1_epi32(4);
 1618|       |
 1619|   157k|    two_nt_4x32b = _mm_set1_epi32(1);
 1620|       |
 1621|   157k|    zero_8x16b = _mm_set1_epi16(0);
 1622|       |
 1623|       |
 1624|       |    /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 1625|   157k|    intra_pred_ang_4x32b = _mm_set1_epi32(intra_pred_ang);
 1626|       |
 1627|   157k|    row_4x32b = _mm_set_epi32(4, 3, 2, 1);
 1628|       |
 1629|   157k|    if(nt == 4)
  ------------------
  |  Branch (1629:8): [True: 36.8k, False: 120k]
  ------------------
 1630|  36.8k|    {
 1631|  36.8k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 1632|  36.8k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 1633|  36.8k|        const_temp2_4x32b = _mm_set1_epi16(31);
 1634|  36.8k|        const_temp4_4x32b = _mm_set1_epi16(4);
 1635|  36.8k|        two_nt_4x32b = _mm_set1_epi16(1);
 1636|       |
 1637|  36.8k|        {
 1638|  36.8k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 1639|  36.8k|            WORD8  ai1_fract_temp_val[16], ai1_src_temp_val[16];
 1640|       |
 1641|  36.8k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b;
 1642|  36.8k|            __m128i src_values10;
 1643|       |
 1644|  36.8k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 1645|       |
 1646|       |            /* pos = ((row + 1) * intra_pred_ang); */
 1647|  36.8k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 1648|       |
 1649|       |            /* fract = pos & (31); */
 1650|  36.8k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 1651|       |
 1652|  36.8k|            ref_main_idx_4x32b = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 1653|  36.8k|            ref_main_idx_4x32b = _mm_add_epi16(ref_main_idx_4x32b, ref_main_idx_4x32b);
 1654|       |
 1655|  36.8k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 1656|       |
 1657|       |            /*(32 - fract) */
 1658|  36.8k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 1659|       |
 1660|  36.8k|            _mm_storel_epi64((__m128i *)(ai1_fract_temp_val), fract_4x32b);
 1661|  36.8k|            _mm_storel_epi64((__m128i *)(ai1_src_temp_val),  src_values10);
 1662|       |
 1663|  36.8k|            fract1_8x16b = _mm_set1_epi8(ai1_fract_temp_val[0]);  /* col=0*/
 1664|  36.8k|            fract2_8x16b = _mm_set1_epi8(ai1_fract_temp_val[2]);  /* col=1*/
 1665|  36.8k|            fract3_8x16b = _mm_set1_epi8(ai1_fract_temp_val[4]);  /* col=2*/
 1666|  36.8k|            fract4_8x16b = _mm_set1_epi8(ai1_fract_temp_val[6]);  /* col=3*/
 1667|       |
 1668|  36.8k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp_val[0]);  /* col=0*/
 1669|  36.8k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp_val[2]);  /* col=1*/
 1670|  36.8k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp_val[4]);  /* col=2*/
 1671|  36.8k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp_val[6]);  /* col=3*/
 1672|       |
 1673|  36.8k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 1674|  36.8k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 1675|  36.8k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 1676|  36.8k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 1677|       |
 1678|  36.8k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 1679|  36.8k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 1680|  36.8k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 1681|  36.8k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 1682|       |
 1683|  36.8k|            {
 1684|  36.8k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1685|  36.8k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 1686|       |
 1687|       |                /* loding 8-bit 16 pixels */
 1688|  36.8k|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx1)); /* col=0*/
 1689|  36.8k|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx2)); /* col=1*/
 1690|  36.8k|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx3)); /* col=2*/
 1691|  36.8k|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx4)); /* col=3*/
 1692|       |
 1693|  36.8k|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 2); /* col=0*/
 1694|  36.8k|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 2); /* col=1*/
 1695|  36.8k|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 2); /* col=2*/
 1696|  36.8k|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 2); /* col=3*/
 1697|       |
 1698|  36.8k|                src_temp1_8x16b =  _mm_unpacklo_epi8(src_temp5_8x16b, src_temp1_8x16b); /* col=0*/
 1699|  36.8k|                src_temp2_8x16b =  _mm_unpacklo_epi8(src_temp6_8x16b, src_temp2_8x16b); /* col=1*/
 1700|  36.8k|                src_temp3_8x16b =  _mm_unpacklo_epi8(src_temp7_8x16b, src_temp3_8x16b); /* col=2*/
 1701|  36.8k|                src_temp4_8x16b =  _mm_unpacklo_epi8(src_temp8_8x16b, src_temp4_8x16b); /* col=3*/
 1702|       |
 1703|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 1704|  36.8k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 1705|  36.8k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 1706|  36.8k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 1707|  36.8k|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 1708|       |
 1709|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 1710|  36.8k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 1711|  36.8k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 1712|  36.8k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 1713|  36.8k|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 1714|       |
 1715|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 1716|  36.8k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 1717|  36.8k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 1718|  36.8k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 1719|  36.8k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 1720|       |
 1721|       |                /* converting 16 bit to 8 bit */
 1722|  36.8k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, zero_8x16b); /* col=0*/
 1723|  36.8k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, zero_8x16b); /* col=1*/
 1724|  36.8k|                src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, zero_8x16b); /* col=2*/
 1725|  36.8k|                src_temp4_8x16b = _mm_packus_epi16(src_temp4_8x16b, zero_8x16b); /* col=3*/
 1726|       |
 1727|  36.8k|                src_temp5_8x16b = _mm_unpacklo_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1728|  36.8k|                src_temp6_8x16b = _mm_unpacklo_epi16(src_temp3_8x16b, src_temp4_8x16b);
 1729|       |
 1730|  36.8k|                src_temp8_8x16b = _mm_unpacklo_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1731|  36.8k|                src_temp7_8x16b = _mm_unpackhi_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1732|       |
 1733|  36.8k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * 0)), src_temp8_8x16b);             /* row=0*/
 1734|       |
 1735|  36.8k|                src_temp2_8x16b  = _mm_shuffle_epi32(src_temp8_8x16b, _MM_SHUFFLE(3, 2, 3, 2));
 1736|  36.8k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (1))), src_temp2_8x16b);       /* row=1*/
 1737|       |
 1738|  36.8k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (2))), src_temp7_8x16b);       /* row=2*/
 1739|       |
 1740|  36.8k|                src_temp4_8x16b  = _mm_shuffle_epi32(src_temp7_8x16b, _MM_SHUFFLE(3, 2, 3, 2));
 1741|  36.8k|                _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd * (3))), src_temp4_8x16b);       /* row=4*/
 1742|       |
 1743|  36.8k|            }
 1744|  36.8k|        }
 1745|  36.8k|    }
 1746|   120k|    else
 1747|   120k|    {
 1748|   120k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 1749|   120k|        row_4x32b = _mm_set_epi16(8, 7, 6, 5, 4, 3, 2, 1);
 1750|   120k|        const_temp2_4x32b = _mm_set1_epi16(31);
 1751|   120k|        const_temp4_4x32b = _mm_set1_epi16(8);
 1752|   120k|        two_nt_4x32b = _mm_set1_epi16(1);
 1753|       |
 1754|   321k|        for(col = 0; col < 2 * nt; col += 16)
  ------------------
  |  Branch (1754:22): [True: 200k, False: 120k]
  ------------------
 1755|   200k|        {
 1756|   200k|            WORD16 pi2_ref_main_idx1, pi2_ref_main_idx2, pi2_ref_main_idx3, pi2_ref_main_idx4;
 1757|   200k|            WORD16 pi2_ref_main_idx5, pi2_ref_main_idx6, pi2_ref_main_idx7, pi2_ref_main_idx8;
 1758|   200k|            WORD8  ai1_fract_temp_val[16], ai1_src_temp_val[16];
 1759|       |
 1760|   200k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b;
 1761|   200k|            __m128i fract5_8x16b, fract6_8x16b, fract7_8x16b, fract8_8x16b, src_values10;
 1762|       |
 1763|   200k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 1764|   200k|            __m128i temp11_8x16b, temp12_8x16b, temp13_8x16b, temp14_8x16b;
 1765|       |
 1766|       |            /* pos = ((row + 1) * intra_pred_ang); */
 1767|   200k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 1768|       |
 1769|       |            /* fract = pos & (31); */
 1770|   200k|            fract_4x32b = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 1771|       |
 1772|   200k|            ref_main_idx_4x32b = _mm_add_epi16(two_nt_4x32b, _mm_srai_epi16(res_temp5_4x32b,  5));
 1773|   200k|            ref_main_idx_4x32b = _mm_add_epi16(ref_main_idx_4x32b, ref_main_idx_4x32b);
 1774|       |
 1775|   200k|            row_4x32b = _mm_add_epi16(row_4x32b, const_temp4_4x32b);
 1776|       |
 1777|       |            /*(32 - fract) */
 1778|   200k|            src_values10 = _mm_sub_epi16(const_temp3_4x32b, fract_4x32b);
 1779|       |
 1780|   200k|            _mm_storeu_si128((__m128i *)(ai1_fract_temp_val), fract_4x32b);
 1781|   200k|            _mm_storeu_si128((__m128i *)(ai1_src_temp_val),  src_values10);
 1782|       |
 1783|   200k|            fract1_8x16b = _mm_set1_epi8(ai1_fract_temp_val[0]);  /* col=0*/
 1784|   200k|            fract2_8x16b = _mm_set1_epi8(ai1_fract_temp_val[2]);  /* col=1*/
 1785|   200k|            fract3_8x16b = _mm_set1_epi8(ai1_fract_temp_val[4]);  /* col=2*/
 1786|   200k|            fract4_8x16b = _mm_set1_epi8(ai1_fract_temp_val[6]);  /* col=3*/
 1787|       |
 1788|   200k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp_val[0]);  /* col=0*/
 1789|   200k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp_val[2]);  /* col=1*/
 1790|   200k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp_val[4]);  /* col=2*/
 1791|   200k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp_val[6]);  /* col=3*/
 1792|       |
 1793|   200k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 1794|   200k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 1795|   200k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 1796|   200k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 1797|       |
 1798|   200k|            pi2_ref_main_idx1 = _mm_extract_epi16(ref_main_idx_4x32b, 0);    /* col=0*/
 1799|   200k|            pi2_ref_main_idx2 = _mm_extract_epi16(ref_main_idx_4x32b, 1);    /* col=1*/
 1800|   200k|            pi2_ref_main_idx3 = _mm_extract_epi16(ref_main_idx_4x32b, 2);    /* col=2*/
 1801|   200k|            pi2_ref_main_idx4 = _mm_extract_epi16(ref_main_idx_4x32b, 3);    /* col=3*/
 1802|       |
 1803|   200k|            fract5_8x16b = _mm_set1_epi8(ai1_fract_temp_val[8]);  /* col=5*/
 1804|   200k|            fract6_8x16b = _mm_set1_epi8(ai1_fract_temp_val[10]);  /* col=6*/
 1805|   200k|            fract7_8x16b = _mm_set1_epi8(ai1_fract_temp_val[12]);  /* col=7*/
 1806|   200k|            fract8_8x16b = _mm_set1_epi8(ai1_fract_temp_val[14]);  /* col=8*/
 1807|       |
 1808|   200k|            temp11_8x16b = _mm_set1_epi8(ai1_src_temp_val[8]);  /* col=0*/
 1809|   200k|            temp12_8x16b = _mm_set1_epi8(ai1_src_temp_val[10]);  /* col=1*/
 1810|   200k|            temp13_8x16b = _mm_set1_epi8(ai1_src_temp_val[12]);  /* col=2*/
 1811|   200k|            temp14_8x16b = _mm_set1_epi8(ai1_src_temp_val[14]);  /* col=3*/
 1812|       |
 1813|   200k|            temp11_8x16b = _mm_unpacklo_epi8(temp11_8x16b, fract5_8x16b);
 1814|   200k|            temp12_8x16b = _mm_unpacklo_epi8(temp12_8x16b, fract6_8x16b);
 1815|   200k|            temp13_8x16b = _mm_unpacklo_epi8(temp13_8x16b, fract7_8x16b);
 1816|   200k|            temp14_8x16b = _mm_unpacklo_epi8(temp14_8x16b, fract8_8x16b);
 1817|       |
 1818|   200k|            pi2_ref_main_idx5 = _mm_extract_epi16(ref_main_idx_4x32b, 4);    /* col=5*/
 1819|   200k|            pi2_ref_main_idx6 = _mm_extract_epi16(ref_main_idx_4x32b, 5);    /* col=6*/
 1820|   200k|            pi2_ref_main_idx7 = _mm_extract_epi16(ref_main_idx_4x32b, 6);    /* col=7*/
 1821|   200k|            pi2_ref_main_idx8 = _mm_extract_epi16(ref_main_idx_4x32b, 7);    /* col=8*/
 1822|       |
 1823|   918k|            for(row = 0; row < nt; row += 4)
  ------------------
  |  Branch (1823:26): [True: 717k, False: 200k]
  ------------------
 1824|   717k|            {
 1825|   717k|                __m128i src_temp1_8x16b, src_temp2_8x16b, src_temp3_8x16b, src_temp4_8x16b;
 1826|   717k|                __m128i src_temp5_8x16b, src_temp6_8x16b, src_temp7_8x16b, src_temp8_8x16b;
 1827|       |
 1828|   717k|                __m128i src_temp11_8x16b, src_temp12_8x16b, src_temp13_8x16b, src_temp14_8x16b;
 1829|   717k|                __m128i src_temp15_8x16b, src_temp16_8x16b, src_temp17_8x16b, src_temp18_8x16b;
 1830|       |
 1831|       |                /* loding 8-bit 16 pixels */
 1832|   717k|                src_temp5_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx1 + row + row)); /* col=0*/
 1833|   717k|                src_temp6_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx2 + row + row)); /* col=1*/
 1834|   717k|                src_temp7_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx3 + row + row)); /* col=2*/
 1835|   717k|                src_temp8_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx4 + row + row)); /* col=3*/
 1836|       |
 1837|   717k|                src_temp1_8x16b = _mm_srli_si128(src_temp5_8x16b, 2); /* col=0*/
 1838|   717k|                src_temp2_8x16b = _mm_srli_si128(src_temp6_8x16b, 2); /* col=1*/
 1839|   717k|                src_temp3_8x16b = _mm_srli_si128(src_temp7_8x16b, 2); /* col=2*/
 1840|   717k|                src_temp4_8x16b = _mm_srli_si128(src_temp8_8x16b, 2); /* col=3*/
 1841|       |
 1842|   717k|                src_temp1_8x16b =  _mm_unpacklo_epi8(src_temp5_8x16b, src_temp1_8x16b); /* col=0*/
 1843|   717k|                src_temp2_8x16b =  _mm_unpacklo_epi8(src_temp6_8x16b, src_temp2_8x16b); /* col=1*/
 1844|   717k|                src_temp3_8x16b =  _mm_unpacklo_epi8(src_temp7_8x16b, src_temp3_8x16b); /* col=2*/
 1845|   717k|                src_temp4_8x16b =  _mm_unpacklo_epi8(src_temp8_8x16b, src_temp4_8x16b); /* col=3*/
 1846|       |
 1847|       |                /* loding 8-bit 16 pixels */
 1848|   717k|                src_temp15_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx5 + row + row)); /* col=5*/
 1849|   717k|                src_temp16_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx6 + row + row)); /* col=6*/
 1850|   717k|                src_temp17_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx7 + row + row)); /* col=7*/
 1851|   717k|                src_temp18_8x16b = _mm_loadu_si128((__m128i *)(ref_main + pi2_ref_main_idx8 + row + row)); /* col=8*/
 1852|       |
 1853|   717k|                src_temp11_8x16b = _mm_srli_si128(src_temp15_8x16b, 2); /* col=5*/
 1854|   717k|                src_temp12_8x16b = _mm_srli_si128(src_temp16_8x16b, 2); /* col=6*/
 1855|   717k|                src_temp13_8x16b = _mm_srli_si128(src_temp17_8x16b, 2); /* col=7*/
 1856|   717k|                src_temp14_8x16b = _mm_srli_si128(src_temp18_8x16b, 2); /* col=8*/
 1857|       |
 1858|   717k|                src_temp11_8x16b =  _mm_unpacklo_epi8(src_temp15_8x16b, src_temp11_8x16b); /* col=0*/
 1859|   717k|                src_temp12_8x16b =  _mm_unpacklo_epi8(src_temp16_8x16b, src_temp12_8x16b); /* col=1*/
 1860|   717k|                src_temp13_8x16b =  _mm_unpacklo_epi8(src_temp17_8x16b, src_temp13_8x16b); /* col=2*/
 1861|   717k|                src_temp14_8x16b =  _mm_unpacklo_epi8(src_temp18_8x16b, src_temp14_8x16b); /* col=3*/
 1862|       |
 1863|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 1864|   717k|                src_temp1_8x16b = _mm_maddubs_epi16(src_temp1_8x16b, temp1_8x16b);
 1865|   717k|                src_temp2_8x16b = _mm_maddubs_epi16(src_temp2_8x16b, temp2_8x16b);
 1866|   717k|                src_temp3_8x16b = _mm_maddubs_epi16(src_temp3_8x16b, temp3_8x16b);
 1867|   717k|                src_temp4_8x16b = _mm_maddubs_epi16(src_temp4_8x16b, temp4_8x16b);
 1868|       |
 1869|       |                /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 1870|   717k|                src_temp11_8x16b = _mm_maddubs_epi16(src_temp11_8x16b, temp11_8x16b);
 1871|   717k|                src_temp12_8x16b = _mm_maddubs_epi16(src_temp12_8x16b, temp12_8x16b);
 1872|   717k|                src_temp13_8x16b = _mm_maddubs_epi16(src_temp13_8x16b, temp13_8x16b);
 1873|   717k|                src_temp14_8x16b = _mm_maddubs_epi16(src_temp14_8x16b, temp14_8x16b);
 1874|       |
 1875|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 1876|   717k|                src_temp1_8x16b = _mm_add_epi16(src_temp1_8x16b, const_temp_4x32b);
 1877|   717k|                src_temp2_8x16b = _mm_add_epi16(src_temp2_8x16b, const_temp_4x32b);
 1878|   717k|                src_temp3_8x16b = _mm_add_epi16(src_temp3_8x16b, const_temp_4x32b);
 1879|   717k|                src_temp4_8x16b = _mm_add_epi16(src_temp4_8x16b, const_temp_4x32b);
 1880|       |
 1881|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 1882|   717k|                src_temp1_8x16b = _mm_srai_epi16(src_temp1_8x16b,  5);   /* col=0*/
 1883|   717k|                src_temp2_8x16b = _mm_srai_epi16(src_temp2_8x16b,  5);   /* col=1*/
 1884|   717k|                src_temp3_8x16b = _mm_srai_epi16(src_temp3_8x16b,  5);   /* col=2*/
 1885|   717k|                src_temp4_8x16b = _mm_srai_epi16(src_temp4_8x16b,  5);   /* col=3*/
 1886|       |
 1887|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 1888|   717k|                src_temp11_8x16b = _mm_add_epi16(src_temp11_8x16b, const_temp_4x32b);
 1889|   717k|                src_temp12_8x16b = _mm_add_epi16(src_temp12_8x16b, const_temp_4x32b);
 1890|   717k|                src_temp13_8x16b = _mm_add_epi16(src_temp13_8x16b, const_temp_4x32b);
 1891|   717k|                src_temp14_8x16b = _mm_add_epi16(src_temp14_8x16b, const_temp_4x32b);
 1892|       |
 1893|       |                /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 1894|   717k|                src_temp11_8x16b = _mm_srai_epi16(src_temp11_8x16b,  5);   /* col=5*/
 1895|   717k|                src_temp12_8x16b = _mm_srai_epi16(src_temp12_8x16b,  5);   /* col=6*/
 1896|   717k|                src_temp13_8x16b = _mm_srai_epi16(src_temp13_8x16b,  5);   /* col=7*/
 1897|   717k|                src_temp14_8x16b = _mm_srai_epi16(src_temp14_8x16b,  5);   /* col=8*/
 1898|       |
 1899|       |                /* converting 16 bit to 8 bit */
 1900|   717k|                src_temp1_8x16b = _mm_packus_epi16(src_temp1_8x16b, zero_8x16b); /* col=0*/
 1901|   717k|                src_temp2_8x16b = _mm_packus_epi16(src_temp2_8x16b, zero_8x16b); /* col=1*/
 1902|   717k|                src_temp3_8x16b = _mm_packus_epi16(src_temp3_8x16b, zero_8x16b); /* col=2*/
 1903|   717k|                src_temp4_8x16b = _mm_packus_epi16(src_temp4_8x16b, zero_8x16b); /* col=3*/
 1904|       |
 1905|       |                /* converting 16 bit to 8 bit */
 1906|   717k|                src_temp11_8x16b = _mm_packus_epi16(src_temp11_8x16b, zero_8x16b); /* col=5*/
 1907|   717k|                src_temp12_8x16b = _mm_packus_epi16(src_temp12_8x16b, zero_8x16b); /* col=6*/
 1908|   717k|                src_temp13_8x16b = _mm_packus_epi16(src_temp13_8x16b, zero_8x16b); /* col=7*/
 1909|   717k|                src_temp14_8x16b = _mm_packus_epi16(src_temp14_8x16b, zero_8x16b); /* col=8*/
 1910|       |
 1911|   717k|                src_temp5_8x16b = _mm_unpacklo_epi16(src_temp1_8x16b, src_temp2_8x16b);
 1912|   717k|                src_temp6_8x16b = _mm_unpacklo_epi16(src_temp3_8x16b, src_temp4_8x16b);
 1913|       |
 1914|   717k|                src_temp8_8x16b = _mm_unpacklo_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1915|   717k|                src_temp7_8x16b = _mm_unpackhi_epi32(src_temp5_8x16b, src_temp6_8x16b);
 1916|       |
 1917|   717k|                src_temp15_8x16b = _mm_unpacklo_epi16(src_temp11_8x16b, src_temp12_8x16b);
 1918|   717k|                src_temp16_8x16b = _mm_unpacklo_epi16(src_temp13_8x16b, src_temp14_8x16b);
 1919|       |
 1920|   717k|                src_temp18_8x16b = _mm_unpacklo_epi32(src_temp15_8x16b, src_temp16_8x16b);
 1921|   717k|                src_temp17_8x16b = _mm_unpackhi_epi32(src_temp15_8x16b, src_temp16_8x16b);
 1922|       |
 1923|   717k|                src_temp11_8x16b = _mm_unpacklo_epi64(src_temp8_8x16b, src_temp18_8x16b);
 1924|   717k|                src_temp12_8x16b = _mm_unpackhi_epi64(src_temp8_8x16b, src_temp18_8x16b);
 1925|   717k|                src_temp13_8x16b = _mm_unpacklo_epi64(src_temp7_8x16b, src_temp17_8x16b);
 1926|   717k|                src_temp14_8x16b = _mm_unpackhi_epi64(src_temp7_8x16b, src_temp17_8x16b);
 1927|       |
 1928|   717k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * row)),    src_temp11_8x16b);          /* row=0*/
 1929|   717k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 1))), src_temp12_8x16b);       /* row=1*/
 1930|   717k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 2))), src_temp13_8x16b);       /* row=2*/
 1931|   717k|                _mm_storeu_si128((__m128i *)(pu1_dst + col + (dst_strd * (row + 3))), src_temp14_8x16b);       /* row=4*/
 1932|       |
 1933|   717k|            }
 1934|   200k|        }
 1935|   120k|    }
 1936|   157k|}
ihevc_intra_pred_chroma_mode_19_to_25_ssse3:
 1981|   151k|{
 1982|   151k|    WORD32 row, k;
 1983|   151k|    WORD32 intra_pred_ang, idx;
 1984|   151k|    WORD32 inv_ang, inv_ang_sum, pos, fract;
 1985|   151k|    WORD32 ref_main_idx, ref_idx;
 1986|   151k|    UWORD8 ref_temp[(2 * MAX_CU_SIZE) + 2];
 1987|   151k|    UWORD8 *ref_main;
 1988|       |
 1989|   151k|    __m128i zero_8x16b, fract_8x16b, const_temp_8x16b;
 1990|   151k|    UNUSED(src_strd);
  ------------------
  |  |   38|   151k|#define UNUSED(x) ((void)(x))
  ------------------
 1991|       |
 1992|   151k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 1993|   151k|    inv_ang = gai4_ihevc_inv_ang_table_chroma[mode - 12];
 1994|       |
 1995|       |    /* Intermediate reference samples for negative angle modes */
 1996|       |    /* This have to be removed during optimization*/
 1997|       |    /* For horizontal modes, (ref main = ref above) (ref side = ref left) */
 1998|   151k|    ref_main = ref_temp + 2 * nt;
 1999|  1.99M|    for(k = 0; k < (2 * (nt + 1)); k += 2)
  ------------------
  |  Branch (1999:16): [True: 1.84M, False: 151k]
  ------------------
 2000|  1.84M|    {
 2001|  1.84M|        ref_temp[k + (2 * (nt - 1))] = pu1_ref[(4 * nt) + k];
 2002|  1.84M|        ref_temp[k + 1 + (2 * (nt - 1))] = pu1_ref[(4 * nt) + k + 1];
 2003|  1.84M|    }
 2004|       |
 2005|   151k|    ref_idx = (nt * intra_pred_ang) >> 5;
 2006|   151k|    inv_ang_sum = 128;
 2007|   151k|    ref_main = ref_temp + (2 * (nt - 1));
 2008|       |    /* SIMD Optimization can be done using look-up table for the loop */
 2009|       |    /* For negative angled derive the main reference samples from side */
 2010|       |    /*  reference samples refer to section 8.4.4.2.6 */
 2011|   790k|    for(k = -2; k > (2 * ref_idx); k -= 2)
  ------------------
  |  Branch (2011:17): [True: 639k, False: 151k]
  ------------------
 2012|   639k|    {
 2013|   639k|        inv_ang_sum += inv_ang;
 2014|   639k|        ref_main[k] = pu1_ref[(4 * nt) - (inv_ang_sum >> 8) * 2];
 2015|   639k|        ref_main[k + 1] = pu1_ref[((4 * nt) + 1) - (inv_ang_sum >> 8) * 2];
 2016|   639k|    }
 2017|       |
 2018|   151k|    const_temp_8x16b = _mm_set1_epi16(16);
 2019|       |
 2020|   151k|    if(nt == 4) /* if nt =4*/
  ------------------
  |  Branch (2020:8): [True: 28.5k, False: 122k]
  ------------------
 2021|  28.5k|    {
 2022|  28.5k|        __m128i const_temp2_4x32b, const_temp3_4x32b;
 2023|  28.5k|        __m128i src_values10, src_values11, zero_8x16b, intra_pred_ang_4x32b;
 2024|  28.5k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 2025|       |
 2026|       |
 2027|  28.5k|        const_temp2_4x32b = _mm_set1_epi32(31);
 2028|  28.5k|        const_temp3_4x32b = _mm_set1_epi32(32);
 2029|       |
 2030|  28.5k|        two_nt_4x32b = _mm_set1_epi32(2);
 2031|       |
 2032|  28.5k|        zero_8x16b = _mm_set1_epi16(0);
 2033|       |
 2034|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 2035|  28.5k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2036|       |
 2037|  28.5k|        row_4x32b = _mm_set_epi16(4, 3, 2, 1, 4, 3, 2, 1);
 2038|  28.5k|        {
 2039|  28.5k|            WORD32 ref_main_idx1, ref_main_idx2, ref_main_idx3, ref_main_idx4;
 2040|  28.5k|            WORD8  ai1_src_temp0_val[16], ai1_src_temp1_val[16];
 2041|       |
 2042|  28.5k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b, res_temp5_4x32b;
 2043|  28.5k|            __m128i src_values0, src_values1, src_values2, src_values3, src_values13;
 2044|  28.5k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2045|  28.5k|            __m128i ref_main_temp0, ref_main_temp1, ref_main_temp2, sign_8x16b;
 2046|       |
 2047|       |            /* pos = ((row + 1) * intra_pred_ang); */
 2048|  28.5k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2049|  28.5k|            sign_8x16b      = _mm_cmpgt_epi16(zero_8x16b, res_temp5_4x32b);
 2050|  28.5k|            res_temp5_4x32b = _mm_unpacklo_epi16(res_temp5_4x32b, sign_8x16b);
 2051|       |
 2052|  28.5k|            src_values12 = _mm_add_epi32(two_nt_4x32b, _mm_srai_epi32(res_temp5_4x32b,  5));
 2053|  28.5k|            src_values12 = _mm_add_epi32(src_values12, _mm_srai_epi32(res_temp5_4x32b,  5));
 2054|       |
 2055|  28.5k|            ref_main_temp0 = _mm_srli_si128(src_values12, 4);  /* next 32 bit values */
 2056|  28.5k|            ref_main_temp1 = _mm_srli_si128(src_values12, 8);  /* next 32 bit values */
 2057|  28.5k|            ref_main_temp2 = _mm_srli_si128(src_values12, 12); /* next 32 bit values */
 2058|  28.5k|            ref_main_idx1  = _mm_cvtsi128_si32(src_values12);    /* row=0*/
 2059|  28.5k|            ref_main_idx2  = _mm_cvtsi128_si32(ref_main_temp0);  /* row=1*/
 2060|  28.5k|            ref_main_idx3  = _mm_cvtsi128_si32(ref_main_temp1);  /* row=2*/
 2061|  28.5k|            ref_main_idx4  = _mm_cvtsi128_si32(ref_main_temp2);  /* row=3*/
 2062|       |
 2063|       |            /* fract = pos & (31); */
 2064|  28.5k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2065|       |
 2066|       |            /*(32 - fract) */
 2067|  28.5k|            src_values10 = _mm_sub_epi32(const_temp3_4x32b, src_values11);
 2068|       |
 2069|  28.5k|            _mm_storeu_si128((__m128i *)(ai1_src_temp1_val), src_values11);
 2070|  28.5k|            _mm_storeu_si128((__m128i *)(ai1_src_temp0_val), src_values10);
 2071|       |
 2072|  28.5k|            fract1_8x16b = _mm_set1_epi8(ai1_src_temp1_val[0]);  /* row=0*/
 2073|  28.5k|            fract2_8x16b = _mm_set1_epi8(ai1_src_temp1_val[4]);  /* row=1*/
 2074|  28.5k|            fract3_8x16b = _mm_set1_epi8(ai1_src_temp1_val[8]);  /* row=2*/
 2075|  28.5k|            fract4_8x16b = _mm_set1_epi8(ai1_src_temp1_val[12]);  /* row=3*/
 2076|       |
 2077|  28.5k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp0_val[0]);  /* row=0*/
 2078|  28.5k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp0_val[4]);  /* row=1*/
 2079|  28.5k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp0_val[8]);  /* row=2*/
 2080|  28.5k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp0_val[12]);  /* row=3*/
 2081|       |
 2082|  28.5k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 2083|  28.5k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 2084|  28.5k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 2085|  28.5k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 2086|       |
 2087|       |// inner loop starts from here
 2088|  28.5k|            src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx1));  /* col = 0-7   */
 2089|  28.5k|            src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx2));  /* col = 8-15  */
 2090|  28.5k|            src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx3));  /* col = 16-23 */
 2091|  28.5k|            src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx4));  /* col = 24-31 */
 2092|       |
 2093|  28.5k|            src_values10 = _mm_srli_si128(src_values0, 2);
 2094|  28.5k|            src_values11 = _mm_srli_si128(src_values1, 2);
 2095|  28.5k|            src_values12 = _mm_srli_si128(src_values2, 2);
 2096|  28.5k|            src_values13 = _mm_srli_si128(src_values3, 2);
 2097|       |
 2098|  28.5k|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2099|  28.5k|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2100|  28.5k|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2101|  28.5k|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2102|       |
 2103|  28.5k|            src_values0 = _mm_maddubs_epi16(src_values0, temp1_8x16b);
 2104|  28.5k|            src_values1 = _mm_maddubs_epi16(src_values1, temp2_8x16b);
 2105|  28.5k|            src_values2 = _mm_maddubs_epi16(src_values2, temp3_8x16b);
 2106|  28.5k|            src_values3 = _mm_maddubs_epi16(src_values3, temp4_8x16b);
 2107|       |
 2108|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2109|  28.5k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2110|  28.5k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2111|  28.5k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2112|  28.5k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 2113|       |
 2114|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2115|  28.5k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2116|  28.5k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2117|  28.5k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2118|  28.5k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2119|       |
 2120|       |            /* converting 16 bit to 8 bit */
 2121|  28.5k|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2122|  28.5k|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2123|  28.5k|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2124|  28.5k|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2125|       |
 2126|  28.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_values0);       /* row=0*/
 2127|  28.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((1) * dst_strd)), src_values1);   /* row=1*/
 2128|  28.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((2) * dst_strd)), src_values2);   /* row=2*/
 2129|  28.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((3) * dst_strd)), src_values3);   /* row=3*/
 2130|       |
 2131|  28.5k|        }
 2132|  28.5k|    }
 2133|   122k|    else if(nt == 8) /* for nt = 16 case */
  ------------------
  |  Branch (2133:13): [True: 48.2k, False: 74.5k]
  ------------------
 2134|  48.2k|    {
 2135|  48.2k|        WORD32 ref_main_idx1, fract1, temp, temp1;
 2136|  48.2k|        __m128i fract1_8x16b, temp_8x16b, temp1_8x16b;
 2137|       |
 2138|  48.2k|        zero_8x16b = _mm_set1_epi16(0);
 2139|       |
 2140|   241k|        for(row = 0; row < nt; row += 2)
  ------------------
  |  Branch (2140:22): [True: 193k, False: 48.2k]
  ------------------
 2141|   193k|        {
 2142|   193k|            __m128i src_values0, src_values1, src_values2, src_values3;
 2143|   193k|            __m128i  src_values10, src_values11, src_values12, src_values13;
 2144|       |
 2145|   193k|            pos = ((row + 1) * intra_pred_ang);
 2146|   193k|            idx = pos >> 5;
 2147|   193k|            fract = pos & (31);
 2148|   193k|            temp = 32 - fract;
 2149|   193k|            ref_main_idx = 2 * idx + 2; /* col from 0-15 */
 2150|       |
 2151|   193k|            pos = ((row + 2) * intra_pred_ang);
 2152|   193k|            idx = pos >> 5;
 2153|   193k|            fract1 = pos & (31);
 2154|   193k|            temp1 = 32 - fract1;
 2155|   193k|            ref_main_idx1 = 2 * idx + 2; /* col from 0-15 */
 2156|       |
 2157|   193k|            fract_8x16b  = _mm_set1_epi8(fract);
 2158|   193k|            fract1_8x16b = _mm_set1_epi8(fract1);
 2159|   193k|            temp_8x16b   = _mm_set1_epi8(temp);
 2160|   193k|            temp1_8x16b  = _mm_set1_epi8(temp1);
 2161|       |
 2162|   193k|            temp_8x16b = _mm_unpacklo_epi8(temp_8x16b, fract_8x16b);
 2163|   193k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 2164|       |
 2165|       |            /* row=0 */
 2166|   193k|            src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx));     /* col = 0-7   */
 2167|   193k|            src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx + 8));   /* col = 8-15  */
 2168|       |
 2169|       |            /* row=1 */
 2170|   193k|            src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx1));   /* col = 0-7  */
 2171|   193k|            src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx1 + 8));  /* col = 8-15 */
 2172|       |
 2173|   193k|            src_values10 = _mm_srli_si128(src_values0, 2);
 2174|   193k|            src_values11 = _mm_srli_si128(src_values1, 2);
 2175|   193k|            src_values12 = _mm_srli_si128(src_values2, 2);
 2176|   193k|            src_values13 = _mm_srli_si128(src_values3, 2);
 2177|       |
 2178|   193k|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2179|   193k|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2180|   193k|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2181|   193k|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2182|       |
 2183|   193k|            src_values0 = _mm_maddubs_epi16(src_values0, temp_8x16b);
 2184|   193k|            src_values1 = _mm_maddubs_epi16(src_values1, temp_8x16b);
 2185|       |
 2186|   193k|            src_values2 = _mm_maddubs_epi16(src_values2, temp1_8x16b);
 2187|   193k|            src_values3 = _mm_maddubs_epi16(src_values3, temp1_8x16b);
 2188|       |
 2189|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2190|   193k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2191|   193k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2192|       |
 2193|   193k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2194|   193k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 2195|       |
 2196|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2197|   193k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2198|   193k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2199|       |
 2200|   193k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2201|   193k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2202|       |
 2203|       |            /* converting 16 bit to 8 bit */
 2204|   193k|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2205|   193k|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2206|       |
 2207|   193k|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2208|   193k|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2209|       |
 2210|       |            /* loding 8-bit 8 pixels values */
 2211|   193k|            _mm_storel_epi64((__m128i *)(pu1_dst), src_values0);
 2212|   193k|            _mm_storel_epi64((__m128i *)(pu1_dst + 8), src_values1);
 2213|       |
 2214|   193k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), src_values2);
 2215|   193k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + 8), src_values3);
 2216|       |
 2217|   193k|            pu1_dst += 2 * dst_strd;
 2218|   193k|        }
 2219|  48.2k|    }
 2220|  74.5k|    else if(nt == 16)
  ------------------
  |  Branch (2220:13): [True: 74.5k, False: 18.4E]
  ------------------
 2221|  74.5k|    {
 2222|  74.5k|        WORD32 temp;
 2223|       |        /* unroll the col loop (inner) */
 2224|  74.5k|        zero_8x16b = _mm_set1_epi16(0);
 2225|       |
 2226|  1.26M|        for(row = 0; row < nt; row += 1)
  ------------------
  |  Branch (2226:22): [True: 1.18M, False: 74.5k]
  ------------------
 2227|  1.18M|        {
 2228|  1.18M|            __m128i  src_values0, src_values1, src_values2, src_values3, temp_8x16b;
 2229|  1.18M|            __m128i  src_values10, src_values11, src_values12, src_values13;
 2230|       |
 2231|  1.18M|            pos = ((row + 1) * intra_pred_ang);
 2232|  1.18M|            idx = pos >> 5;
 2233|  1.18M|            fract = pos & (31);
 2234|  1.18M|            temp = 32 - fract;
 2235|  1.18M|            ref_main_idx = 2 * idx + 2; /* col from 0-31 */
 2236|       |
 2237|  1.18M|            fract_8x16b = _mm_set1_epi8(fract);
 2238|  1.18M|            temp_8x16b  = _mm_set1_epi8(temp);
 2239|       |
 2240|  1.18M|            temp_8x16b = _mm_unpacklo_epi8(temp_8x16b, fract_8x16b);
 2241|       |
 2242|  1.18M|            src_values0 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx));     /* col = 0-7   */
 2243|  1.18M|            src_values1 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx + 8));   /* col = 8-15  */
 2244|  1.18M|            src_values2 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx + 16));  /* col = 16-23 */
 2245|  1.18M|            src_values3 = _mm_loadu_si128((__m128i *)(ref_main + ref_main_idx + 24));  /* col = 24-31 */
 2246|       |
 2247|  1.18M|            src_values10 = _mm_srli_si128(src_values0, 2);
 2248|  1.18M|            src_values11 = _mm_srli_si128(src_values1, 2);
 2249|  1.18M|            src_values12 = _mm_srli_si128(src_values2, 2);
 2250|  1.18M|            src_values13 = _mm_srli_si128(src_values3, 2);
 2251|       |
 2252|  1.18M|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2253|  1.18M|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2254|  1.18M|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2255|  1.18M|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2256|       |
 2257|       |            /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2258|  1.18M|            src_values0 = _mm_maddubs_epi16(src_values0, temp_8x16b);
 2259|  1.18M|            src_values1 = _mm_maddubs_epi16(src_values1, temp_8x16b);
 2260|  1.18M|            src_values2 = _mm_maddubs_epi16(src_values2, temp_8x16b);
 2261|  1.18M|            src_values3 = _mm_maddubs_epi16(src_values3, temp_8x16b);
 2262|       |
 2263|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2264|  1.18M|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2265|  1.18M|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2266|  1.18M|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2267|  1.18M|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 2268|       |
 2269|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2270|  1.18M|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2271|  1.18M|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2272|  1.18M|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2273|  1.18M|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2274|       |
 2275|       |            /* converting 16 bit to 8 bit */
 2276|  1.18M|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2277|  1.18M|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2278|  1.18M|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2279|  1.18M|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2280|       |
 2281|       |            /* loding 8-bit 8 pixels values */
 2282|  1.18M|            _mm_storel_epi64((__m128i *)(pu1_dst), src_values0);
 2283|  1.18M|            _mm_storel_epi64((__m128i *)(pu1_dst + 8), src_values1);
 2284|  1.18M|            _mm_storel_epi64((__m128i *)(pu1_dst + 16), src_values2);
 2285|  1.18M|            _mm_storel_epi64((__m128i *)(pu1_dst + 24), src_values3);
 2286|       |
 2287|  1.18M|            pu1_dst += dst_strd;
 2288|       |
 2289|  1.18M|        }
 2290|  74.5k|    }
 2291|   151k|}
ihevc_intra_pred_chroma_mode_27_to_33_ssse3:
 2337|   147k|{
 2338|   147k|    WORD32 row;
 2339|   147k|    WORD32 pos, fract;
 2340|   147k|    WORD32 intra_pred_ang;
 2341|   147k|    WORD32 idx, ref_main_idx;
 2342|       |
 2343|   147k|    __m128i zero_8x16b, fract_8x16b, const_temp_8x16b;
 2344|   147k|    UNUSED(src_strd);
  ------------------
  |  |   38|   147k|#define UNUSED(x) ((void)(x))
  ------------------
 2345|       |
 2346|   147k|    intra_pred_ang = gai4_ihevc_ang_table_chroma[mode];
 2347|   147k|    const_temp_8x16b = _mm_set1_epi16(16);
 2348|       |
 2349|   147k|    if(nt == 4) /* if nt =4*/
  ------------------
  |  Branch (2349:8): [True: 40.2k, False: 107k]
  ------------------
 2350|  40.2k|    {
 2351|  40.2k|        __m128i const_temp2_4x32b, const_temp3_4x32b;
 2352|  40.2k|        __m128i src_values10, src_values11, zero_8x16b, intra_pred_ang_4x32b;
 2353|  40.2k|        __m128i row_4x32b, two_nt_4x32b, src_values12;
 2354|       |
 2355|  40.2k|        const_temp2_4x32b = _mm_set1_epi32(31);
 2356|  40.2k|        const_temp3_4x32b = _mm_set1_epi32(32);
 2357|       |
 2358|  40.2k|        two_nt_4x32b = _mm_set1_epi32((4 * nt) + 2);
 2359|       |
 2360|  40.2k|        zero_8x16b = _mm_set1_epi16(0);
 2361|       |
 2362|       |        /* intra_pred_ang = gai4_ihevc_ang_table[mode]; */
 2363|  40.2k|        intra_pred_ang_4x32b = _mm_set1_epi16(intra_pred_ang);
 2364|  40.2k|        row_4x32b = _mm_set_epi16(4, 3, 2, 1, 4, 3, 2, 1);
 2365|       |
 2366|  40.2k|        {
 2367|  40.2k|            WORD32 ref_main_idx1, ref_main_idx2, ref_main_idx3, ref_main_idx4;
 2368|  40.2k|            WORD8  ai1_src_temp0_val[16], ai1_src_temp1_val[16];
 2369|       |
 2370|  40.2k|            __m128i fract1_8x16b, fract2_8x16b, fract3_8x16b, fract4_8x16b, res_temp5_4x32b;
 2371|  40.2k|            __m128i src_values0, src_values1, src_values2, src_values3, src_values13;
 2372|  40.2k|            __m128i temp1_8x16b, temp2_8x16b, temp3_8x16b, temp4_8x16b;
 2373|  40.2k|            __m128i ref_main_temp0, ref_main_temp1, ref_main_temp2, sign_8x16b;
 2374|       |
 2375|       |            /* pos = ((row + 1) * intra_pred_ang); */
 2376|  40.2k|            res_temp5_4x32b  = _mm_mullo_epi16(row_4x32b, intra_pred_ang_4x32b);
 2377|  40.2k|            sign_8x16b      = _mm_cmpgt_epi16(zero_8x16b, res_temp5_4x32b);
 2378|  40.2k|            res_temp5_4x32b = _mm_unpacklo_epi16(res_temp5_4x32b, sign_8x16b);
 2379|       |
 2380|  40.2k|            src_values12 = _mm_add_epi32(two_nt_4x32b, _mm_srai_epi32(res_temp5_4x32b,  5));
 2381|  40.2k|            src_values12 = _mm_add_epi32(src_values12, _mm_srai_epi32(res_temp5_4x32b,  5));
 2382|       |
 2383|  40.2k|            ref_main_temp0 = _mm_srli_si128(src_values12, 4);  /* next 32 bit values */
 2384|  40.2k|            ref_main_temp1 = _mm_srli_si128(src_values12, 8);  /* next 32 bit values */
 2385|  40.2k|            ref_main_temp2 = _mm_srli_si128(src_values12, 12); /* next 32 bit values */
 2386|  40.2k|            ref_main_idx1  = _mm_cvtsi128_si32(src_values12);    /* row=0*/
 2387|  40.2k|            ref_main_idx2  = _mm_cvtsi128_si32(ref_main_temp0);  /* row=1*/
 2388|  40.2k|            ref_main_idx3  = _mm_cvtsi128_si32(ref_main_temp1);  /* row=2*/
 2389|  40.2k|            ref_main_idx4  = _mm_cvtsi128_si32(ref_main_temp2);  /* row=3*/
 2390|       |
 2391|       |            /* fract = pos & (31); */
 2392|  40.2k|            src_values11 = _mm_and_si128(res_temp5_4x32b, const_temp2_4x32b);
 2393|       |
 2394|       |            /*(32 - fract) */
 2395|  40.2k|            src_values10 = _mm_sub_epi32(const_temp3_4x32b, src_values11);
 2396|       |
 2397|  40.2k|            _mm_storeu_si128((__m128i *)(ai1_src_temp1_val), src_values11);
 2398|  40.2k|            _mm_storeu_si128((__m128i *)(ai1_src_temp0_val), src_values10);
 2399|       |
 2400|  40.2k|            fract1_8x16b = _mm_set1_epi8(ai1_src_temp1_val[0]);  /* row=0*/
 2401|  40.2k|            fract2_8x16b = _mm_set1_epi8(ai1_src_temp1_val[4]);  /* row=1*/
 2402|  40.2k|            fract3_8x16b = _mm_set1_epi8(ai1_src_temp1_val[8]);  /* row=2*/
 2403|  40.2k|            fract4_8x16b = _mm_set1_epi8(ai1_src_temp1_val[12]);  /* row=3*/
 2404|       |
 2405|  40.2k|            temp1_8x16b = _mm_set1_epi8(ai1_src_temp0_val[0]);  /* row=0*/
 2406|  40.2k|            temp2_8x16b = _mm_set1_epi8(ai1_src_temp0_val[4]);  /* row=1*/
 2407|  40.2k|            temp3_8x16b = _mm_set1_epi8(ai1_src_temp0_val[8]);  /* row=2*/
 2408|  40.2k|            temp4_8x16b = _mm_set1_epi8(ai1_src_temp0_val[12]);  /* row=3*/
 2409|       |
 2410|  40.2k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 2411|  40.2k|            temp2_8x16b = _mm_unpacklo_epi8(temp2_8x16b, fract2_8x16b);
 2412|  40.2k|            temp3_8x16b = _mm_unpacklo_epi8(temp3_8x16b, fract3_8x16b);
 2413|  40.2k|            temp4_8x16b = _mm_unpacklo_epi8(temp4_8x16b, fract4_8x16b);
 2414|       |
 2415|       |// inner loop starts from here
 2416|  40.2k|            src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx1));  /* col = 0-7   */
 2417|  40.2k|            src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx2));  /* col = 8-15  */
 2418|  40.2k|            src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx3));  /* col = 16-23 */
 2419|  40.2k|            src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx4));  /* col = 24-31 */
 2420|       |
 2421|  40.2k|            src_values10 = _mm_srli_si128(src_values0, 2);
 2422|  40.2k|            src_values11 = _mm_srli_si128(src_values1, 2);
 2423|  40.2k|            src_values12 = _mm_srli_si128(src_values2, 2);
 2424|  40.2k|            src_values13 = _mm_srli_si128(src_values3, 2);
 2425|       |
 2426|  40.2k|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2427|  40.2k|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2428|  40.2k|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2429|  40.2k|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2430|       |
 2431|  40.2k|            src_values0 = _mm_maddubs_epi16(src_values0, temp1_8x16b);
 2432|  40.2k|            src_values1 = _mm_maddubs_epi16(src_values1, temp2_8x16b);
 2433|  40.2k|            src_values2 = _mm_maddubs_epi16(src_values2, temp3_8x16b);
 2434|  40.2k|            src_values3 = _mm_maddubs_epi16(src_values3, temp4_8x16b);
 2435|       |
 2436|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2437|  40.2k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2438|  40.2k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2439|  40.2k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2440|  40.2k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 2441|       |
 2442|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2443|  40.2k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2444|  40.2k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2445|  40.2k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2446|  40.2k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2447|       |
 2448|       |            /* converting 16 bit to 8 bit */
 2449|  40.2k|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2450|  40.2k|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2451|  40.2k|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2452|  40.2k|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2453|       |
 2454|  40.2k|            _mm_storel_epi64((__m128i *)(pu1_dst + (0 * dst_strd)), src_values0);       /* row=0*/
 2455|  40.2k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((1) * dst_strd)), src_values1);   /* row=1*/
 2456|  40.2k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((2) * dst_strd)), src_values2);   /* row=2*/
 2457|  40.2k|            _mm_storel_epi64((__m128i *)(pu1_dst + ((3) * dst_strd)), src_values3);   /* row=3*/
 2458|       |
 2459|  40.2k|        }
 2460|  40.2k|    }
 2461|       |
 2462|   107k|    else if(nt == 8) /* for nt = 16 case */
  ------------------
  |  Branch (2462:13): [True: 39.8k, False: 67.7k]
  ------------------
 2463|  39.8k|    {
 2464|  39.8k|        WORD32 ref_main_idx1, fract1, temp, temp1;
 2465|  39.8k|        __m128i fract1_8x16b, temp_8x16b, temp1_8x16b;
 2466|       |
 2467|  39.8k|        zero_8x16b = _mm_set1_epi16(0);
 2468|       |
 2469|   199k|        for(row = 0; row < nt; row += 2)
  ------------------
  |  Branch (2469:22): [True: 159k, False: 39.8k]
  ------------------
 2470|   159k|        {
 2471|   159k|            __m128i src_values0, src_values1, src_values2, src_values3;
 2472|   159k|            __m128i  src_values10, src_values11, src_values12, src_values13;
 2473|       |
 2474|   159k|            pos = ((row + 1) * intra_pred_ang);
 2475|   159k|            idx = pos >> 5;
 2476|   159k|            fract = pos & (31);
 2477|   159k|            temp = 32 - fract;
 2478|   159k|            ref_main_idx = (4 * nt) + 2 * idx + 2; /* col from 0-15 */
 2479|       |
 2480|   159k|            pos = ((row + 2) * intra_pred_ang);
 2481|   159k|            idx = pos >> 5;
 2482|   159k|            fract1 = pos & (31);
 2483|   159k|            temp1 = 32 - fract1;
 2484|   159k|            ref_main_idx1 = (4 * nt) + 2 * idx + 2; /* col from 0-15 */
 2485|       |
 2486|   159k|            fract_8x16b  = _mm_set1_epi8(fract);
 2487|   159k|            fract1_8x16b = _mm_set1_epi8(fract1);
 2488|   159k|            temp_8x16b   = _mm_set1_epi8(temp);
 2489|   159k|            temp1_8x16b  = _mm_set1_epi8(temp1);
 2490|       |
 2491|   159k|            temp_8x16b = _mm_unpacklo_epi8(temp_8x16b, fract_8x16b);
 2492|   159k|            temp1_8x16b = _mm_unpacklo_epi8(temp1_8x16b, fract1_8x16b);
 2493|       |
 2494|       |            /* row=0 */
 2495|   159k|            src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx));     /* col = 0-7   */
 2496|   159k|            src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx + 8));   /* col = 8-15  */
 2497|       |
 2498|       |            /* row=1 */
 2499|   159k|            src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx1));    /* col = 0-7  */
 2500|   159k|            src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx1 + 8));  /* col = 8-15 */
 2501|       |
 2502|   159k|            src_values10 = _mm_srli_si128(src_values0, 2);
 2503|   159k|            src_values11 = _mm_srli_si128(src_values1, 2);
 2504|   159k|            src_values12 = _mm_srli_si128(src_values2, 2);
 2505|   159k|            src_values13 = _mm_srli_si128(src_values3, 2);
 2506|       |
 2507|   159k|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2508|   159k|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2509|   159k|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2510|   159k|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2511|       |
 2512|   159k|            src_values0 = _mm_maddubs_epi16(src_values0, temp_8x16b);
 2513|   159k|            src_values1 = _mm_maddubs_epi16(src_values1, temp_8x16b);
 2514|       |
 2515|   159k|            src_values2 = _mm_maddubs_epi16(src_values2, temp1_8x16b);
 2516|   159k|            src_values3 = _mm_maddubs_epi16(src_values3, temp1_8x16b);
 2517|       |
 2518|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2519|   159k|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2520|   159k|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2521|       |
 2522|   159k|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2523|   159k|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 2524|       |
 2525|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2526|   159k|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2527|   159k|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2528|       |
 2529|   159k|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2530|   159k|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2531|       |
 2532|       |            /* converting 16 bit to 8 bit */
 2533|   159k|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2534|   159k|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2535|       |
 2536|   159k|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2537|   159k|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2538|       |
 2539|       |            /* loding 8-bit 8 pixels values */
 2540|   159k|            _mm_storel_epi64((__m128i *)(pu1_dst), src_values0);
 2541|   159k|            _mm_storel_epi64((__m128i *)(pu1_dst + 8), src_values1);
 2542|       |
 2543|   159k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), src_values2);
 2544|   159k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd + 8), src_values3);
 2545|       |
 2546|   159k|            pu1_dst += 2 * dst_strd;
 2547|   159k|        }
 2548|  39.8k|    }
 2549|  67.7k|    else if(nt == 16)
  ------------------
  |  Branch (2549:13): [True: 67.6k, False: 17]
  ------------------
 2550|  67.6k|    {
 2551|  67.6k|        WORD32 temp;
 2552|       |        /* unroll the col loop (inner) */
 2553|  67.6k|        zero_8x16b = _mm_set1_epi16(0);
 2554|       |
 2555|  1.14M|        for(row = 0; row < nt; row += 1)
  ------------------
  |  Branch (2555:22): [True: 1.07M, False: 67.6k]
  ------------------
 2556|  1.07M|        {
 2557|  1.07M|            __m128i  src_values0, src_values1, src_values2, src_values3, temp_8x16b;
 2558|  1.07M|            __m128i  src_values10, src_values11, src_values12, src_values13;
 2559|       |
 2560|  1.07M|            pos = ((row + 1) * intra_pred_ang);
 2561|  1.07M|            idx = pos >> 5;
 2562|  1.07M|            fract = pos & (31);
 2563|  1.07M|            temp = 32 - fract;
 2564|  1.07M|            ref_main_idx = (4 * nt) + 2 * idx + 2; /* col from 0-31 */
 2565|       |
 2566|  1.07M|            fract_8x16b = _mm_set1_epi8(fract);
 2567|  1.07M|            temp_8x16b  = _mm_set1_epi8(temp);
 2568|       |
 2569|  1.07M|            temp_8x16b = _mm_unpacklo_epi8(temp_8x16b, fract_8x16b);
 2570|       |
 2571|  1.07M|            src_values0 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx));     /* col = 0-7   */
 2572|  1.07M|            src_values1 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx + 8));   /* col = 8-15  */
 2573|  1.07M|            src_values2 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx + 16));  /* col = 16-23 */
 2574|  1.07M|            src_values3 = _mm_loadu_si128((__m128i *)(pu1_ref + ref_main_idx + 24));  /* col = 24-31 */
 2575|       |
 2576|  1.07M|            src_values10 = _mm_srli_si128(src_values0, 2);
 2577|  1.07M|            src_values11 = _mm_srli_si128(src_values1, 2);
 2578|  1.07M|            src_values12 = _mm_srli_si128(src_values2, 2);
 2579|  1.07M|            src_values13 = _mm_srli_si128(src_values3, 2);
 2580|       |
 2581|  1.07M|            src_values0 = _mm_unpacklo_epi8(src_values0, src_values10);
 2582|  1.07M|            src_values1 = _mm_unpacklo_epi8(src_values1, src_values11);
 2583|  1.07M|            src_values2 = _mm_unpacklo_epi8(src_values2, src_values12);
 2584|  1.07M|            src_values3 = _mm_unpacklo_epi8(src_values3, src_values13);
 2585|       |
 2586|       |            /* fract*(pu1_ref[ref_main_idx + 1]- pu1_ref[ref_main_idx]) */
 2587|  1.07M|            src_values0 = _mm_maddubs_epi16(src_values0, temp_8x16b);
 2588|  1.07M|            src_values1 = _mm_maddubs_epi16(src_values1, temp_8x16b);
 2589|  1.07M|            src_values2 = _mm_maddubs_epi16(src_values2, temp_8x16b);
 2590|  1.07M|            src_values3 = _mm_maddubs_epi16(src_values3, temp_8x16b);
 2591|       |
 2592|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16)*/
 2593|  1.07M|            src_values0 = _mm_add_epi16(src_values0, const_temp_8x16b);
 2594|  1.07M|            src_values1 = _mm_add_epi16(src_values1, const_temp_8x16b);
 2595|  1.07M|            src_values2 = _mm_add_epi16(src_values2, const_temp_8x16b);
 2596|  1.07M|            src_values3 = _mm_add_epi16(src_values3, const_temp_8x16b);
 2597|       |
 2598|       |            /*((32 - fract)* pu1_ref[ref_main_idx]+ fract * pu1_ref[ref_main_idx + 1] + 16) >>5*/
 2599|  1.07M|            src_values0 = _mm_srai_epi16(src_values0,  5);
 2600|  1.07M|            src_values1 = _mm_srai_epi16(src_values1,  5);
 2601|  1.07M|            src_values2 = _mm_srai_epi16(src_values2,  5);
 2602|  1.07M|            src_values3 = _mm_srai_epi16(src_values3,  5);
 2603|       |
 2604|       |            /* converting 16 bit to 8 bit */
 2605|  1.07M|            src_values0 = _mm_packus_epi16(src_values0, zero_8x16b);
 2606|  1.07M|            src_values1 = _mm_packus_epi16(src_values1, zero_8x16b);
 2607|  1.07M|            src_values2 = _mm_packus_epi16(src_values2, zero_8x16b);
 2608|  1.07M|            src_values3 = _mm_packus_epi16(src_values3, zero_8x16b);
 2609|       |
 2610|       |            /* loding 8-bit 8 pixels values */
 2611|  1.07M|            _mm_storel_epi64((__m128i *)(pu1_dst), src_values0);
 2612|  1.07M|            _mm_storel_epi64((__m128i *)(pu1_dst + 8), src_values1);
 2613|  1.07M|            _mm_storel_epi64((__m128i *)(pu1_dst + 16), src_values2);
 2614|  1.07M|            _mm_storel_epi64((__m128i *)(pu1_dst + 24), src_values3);
 2615|       |
 2616|  1.07M|            pu1_dst += dst_strd;
 2617|       |
 2618|  1.07M|        }
 2619|  67.6k|    }
 2620|   147k|}

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

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

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

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

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

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

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

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

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

ihevcd_bitstream.c:CLZ:
   76|  1.05M|{
   77|  1.05M|    if(u4_word)
  ------------------
  |  Branch (77:8): [True: 1.04M, False: 12.0k]
  ------------------
   78|  1.04M|        return (__builtin_clz(u4_word));
   79|  12.0k|    else
   80|  12.0k|        return 31;
   81|  1.05M|}
ihevcd_parse_slice_header.c:CLZ:
   76|  9.71k|{
   77|  9.71k|    if(u4_word)
  ------------------
  |  Branch (77:8): [True: 9.59k, False: 116]
  ------------------
   78|  9.59k|        return (__builtin_clz(u4_word));
   79|    116|    else
   80|    116|        return 31;
   81|  9.71k|}
ihevcd_parse_residual.c:CLZ:
   76|   280M|{
   77|   280M|    if(u4_word)
  ------------------
  |  Branch (77:8): [True: 254M, False: 25.7M]
  ------------------
   78|   254M|        return (__builtin_clz(u4_word));
   79|  25.7M|    else
   80|  25.7M|        return 31;
   81|   280M|}
ihevcd_parse_residual.c:CTZ:
   89|  13.3M|{
   90|  13.3M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 13.3M]
  ------------------
   91|      0|        return 31;
   92|  13.3M|    else
   93|  13.3M|    {
   94|  13.3M|        unsigned int index;
   95|  13.3M|        index = __builtin_ctz(u4_word);
   96|  13.3M|        return (UWORD32)index;
   97|  13.3M|    }
   98|  13.3M|}
ihevcd_cabac.c:CLZ:
   76|  91.5M|{
   77|  91.5M|    if(u4_word)
  ------------------
  |  Branch (77:8): [True: 91.5M, False: 0]
  ------------------
   78|  91.5M|        return (__builtin_clz(u4_word));
   79|      0|    else
   80|      0|        return 31;
   81|  91.5M|}
ihevcd_iquant_itrans_recon_ctb.c:CLZ:
   76|  34.1M|{
   77|  34.1M|    if(u4_word)
  ------------------
  |  Branch (77:8): [True: 34.1M, False: 18.4E]
  ------------------
   78|  34.1M|        return (__builtin_clz(u4_word));
   79|  18.4E|    else
   80|  18.4E|        return 31;
   81|  34.1M|}
ihevcd_deblk.c:CTZ:
   89|   306M|{
   90|   306M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 104M, False: 202M]
  ------------------
   91|   104M|        return 31;
   92|   202M|    else
   93|   202M|    {
   94|   202M|        unsigned int index;
   95|   202M|        index = __builtin_ctz(u4_word);
   96|   202M|        return (UWORD32)index;
   97|   202M|    }
   98|   306M|}
ihevcd_sao.c:CTZ:
   89|   135M|{
   90|   135M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 673k, False: 134M]
  ------------------
   91|   673k|        return 31;
   92|   134M|    else
   93|   134M|    {
   94|   134M|        unsigned int index;
   95|   134M|        index = __builtin_ctz(u4_word);
   96|   134M|        return (UWORD32)index;
   97|   134M|    }
   98|   135M|}
ihevc_intra_pred_filters.c:CTZ:
   89|  12.5M|{
   90|  12.5M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 12.5M]
  ------------------
   91|      0|        return 31;
   92|  12.5M|    else
   93|  12.5M|    {
   94|  12.5M|        unsigned int index;
   95|  12.5M|        index = __builtin_ctz(u4_word);
   96|  12.5M|        return (UWORD32)index;
   97|  12.5M|    }
   98|  12.5M|}
ihevc_chroma_intra_pred_filters.c:CTZ:
   89|  6.13M|{
   90|  6.13M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 6.13M]
  ------------------
   91|      0|        return 31;
   92|  6.13M|    else
   93|  6.13M|    {
   94|  6.13M|        unsigned int index;
   95|  6.13M|        index = __builtin_ctz(u4_word);
   96|  6.13M|        return (UWORD32)index;
   97|  6.13M|    }
   98|  6.13M|}
ihevc_intra_pred_filters_ssse3_intr.c:CTZ:
   89|  1.45M|{
   90|  1.45M|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 1.45M]
  ------------------
   91|      0|        return 31;
   92|  1.45M|    else
   93|  1.45M|    {
   94|  1.45M|        unsigned int index;
   95|  1.45M|        index = __builtin_ctz(u4_word);
   96|  1.45M|        return (UWORD32)index;
   97|  1.45M|    }
   98|  1.45M|}
ihevc_intra_pred_filters_sse42_intr.c:CTZ:
   89|   384k|{
   90|   384k|    if(0 == u4_word)
  ------------------
  |  Branch (90:8): [True: 0, False: 384k]
  ------------------
   91|      0|        return 31;
   92|   384k|    else
   93|   384k|    {
   94|   384k|        unsigned int index;
   95|   384k|        index = __builtin_ctz(u4_word);
   96|   384k|        return (UWORD32)index;
   97|   384k|    }
   98|   384k|}

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

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

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

ihevcd_set_default_params:
  904|  1.62k|{
  905|       |
  906|  1.62k|    WORD32 ret = IV_SUCCESS;
  907|       |
  908|  1.62k|    ps_codec->e_pic_skip_mode = IVD_SKIP_NONE;
  909|  1.62k|    ps_codec->i4_strd = 0;
  910|  1.62k|    ps_codec->i4_disp_strd = 0;
  911|  1.62k|    ps_codec->i4_header_mode = 0;
  912|  1.62k|    ps_codec->e_pic_out_order = IVD_DISPLAY_FRAME_OUT;
  913|  1.62k|    return ret;
  914|  1.62k|}
ihevcd_update_function_ptr:
  917|  2.42k|{
  918|       |
  919|       |    /* Init inter pred function array */
  920|  2.42k|    ps_codec->apf_inter_pred[0] = NULL;
  921|  2.42k|    ps_codec->apf_inter_pred[1] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_fptr;
  922|  2.42k|    ps_codec->apf_inter_pred[2] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_fptr;
  923|  2.42k|    ps_codec->apf_inter_pred[3] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_fptr;
  924|  2.42k|    ps_codec->apf_inter_pred[4] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr;
  925|  2.42k|    ps_codec->apf_inter_pred[5] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_w16out_fptr;
  926|  2.42k|    ps_codec->apf_inter_pred[6] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16out_fptr;
  927|  2.42k|    ps_codec->apf_inter_pred[7] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr;
  928|  2.42k|    ps_codec->apf_inter_pred[8] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr;
  929|  2.42k|    ps_codec->apf_inter_pred[9] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_fptr;
  930|  2.42k|    ps_codec->apf_inter_pred[10] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_w16out_fptr;
  931|  2.42k|    ps_codec->apf_inter_pred[11] = NULL;
  932|  2.42k|    ps_codec->apf_inter_pred[12] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_fptr;
  933|  2.42k|    ps_codec->apf_inter_pred[13] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_fptr;
  934|  2.42k|    ps_codec->apf_inter_pred[14] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_fptr;
  935|  2.42k|    ps_codec->apf_inter_pred[15] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr;
  936|  2.42k|    ps_codec->apf_inter_pred[16] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_w16out_fptr;
  937|  2.42k|    ps_codec->apf_inter_pred[17] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16out_fptr;
  938|  2.42k|    ps_codec->apf_inter_pred[18] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr;
  939|  2.42k|    ps_codec->apf_inter_pred[19] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr;
  940|  2.42k|    ps_codec->apf_inter_pred[20] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_fptr;
  941|  2.42k|    ps_codec->apf_inter_pred[21] = (pf_inter_pred)ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr;
  942|       |
  943|       |    /* Init intra pred function array */
  944|  2.42k|    ps_codec->apf_intra_pred_luma[0] = (pf_intra_pred)NULL;
  945|  2.42k|    ps_codec->apf_intra_pred_luma[1] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_planar_fptr;
  946|  2.42k|    ps_codec->apf_intra_pred_luma[2] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_dc_fptr;
  947|  2.42k|    ps_codec->apf_intra_pred_luma[3] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_mode2_fptr;
  948|  2.42k|    ps_codec->apf_intra_pred_luma[4] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_3_to_9_fptr;
  949|  2.42k|    ps_codec->apf_intra_pred_luma[5] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_horz_fptr;
  950|  2.42k|    ps_codec->apf_intra_pred_luma[6] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_11_to_17_fptr;
  951|  2.42k|    ps_codec->apf_intra_pred_luma[7] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_18_34_fptr;
  952|  2.42k|    ps_codec->apf_intra_pred_luma[8] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_19_to_25_fptr;
  953|  2.42k|    ps_codec->apf_intra_pred_luma[9] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_ver_fptr;
  954|  2.42k|    ps_codec->apf_intra_pred_luma[10] =  (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_27_to_33_fptr;
  955|       |
  956|  2.42k|    ps_codec->apf_intra_pred_chroma[0] = (pf_intra_pred)NULL;
  957|  2.42k|    ps_codec->apf_intra_pred_chroma[1] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_planar_fptr;
  958|  2.42k|    ps_codec->apf_intra_pred_chroma[2] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_dc_fptr;
  959|  2.42k|    ps_codec->apf_intra_pred_chroma[3] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode2_fptr;
  960|  2.42k|    ps_codec->apf_intra_pred_chroma[4] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_3_to_9_fptr;
  961|  2.42k|    ps_codec->apf_intra_pred_chroma[5] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_horz_fptr;
  962|  2.42k|    ps_codec->apf_intra_pred_chroma[6] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_11_to_17_fptr;
  963|  2.42k|    ps_codec->apf_intra_pred_chroma[7] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_18_34_fptr;
  964|  2.42k|    ps_codec->apf_intra_pred_chroma[8] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_19_to_25_fptr;
  965|  2.42k|    ps_codec->apf_intra_pred_chroma[9] =  (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_ver_fptr;
  966|  2.42k|    ps_codec->apf_intra_pred_chroma[10] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_27_to_33_fptr;
  967|       |
  968|       |    /* Init itrans_recon function array */
  969|  2.42k|    ps_codec->apf_itrans_recon[0] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr;
  970|  2.42k|    ps_codec->apf_itrans_recon[1] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_4x4_fptr;
  971|  2.42k|    ps_codec->apf_itrans_recon[2] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_8x8_fptr;
  972|  2.42k|    ps_codec->apf_itrans_recon[3] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_16x16_fptr;
  973|  2.42k|    ps_codec->apf_itrans_recon[4] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_32x32_fptr;
  974|  2.42k|    ps_codec->apf_itrans_recon[5] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_chroma_itrans_recon_4x4_fptr;
  975|  2.42k|    ps_codec->apf_itrans_recon[6] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_chroma_itrans_recon_8x8_fptr;
  976|  2.42k|    ps_codec->apf_itrans_recon[7] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_chroma_itrans_recon_16x16_fptr;
  977|       |
  978|       |    /* Init recon function array */
  979|  2.42k|    ps_codec->apf_recon[0] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_4x4_ttype1_fptr;
  980|  2.42k|    ps_codec->apf_recon[1] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_4x4_fptr;
  981|  2.42k|    ps_codec->apf_recon[2] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_8x8_fptr;
  982|  2.42k|    ps_codec->apf_recon[3] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_16x16_fptr;
  983|  2.42k|    ps_codec->apf_recon[4] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_32x32_fptr;
  984|  2.42k|    ps_codec->apf_recon[5] = (pf_recon)ps_codec->s_func_selector.ihevc_chroma_recon_4x4_fptr;
  985|  2.42k|    ps_codec->apf_recon[6] = (pf_recon)ps_codec->s_func_selector.ihevc_chroma_recon_8x8_fptr;
  986|  2.42k|    ps_codec->apf_recon[7] = (pf_recon)ps_codec->s_func_selector.ihevc_chroma_recon_16x16_fptr;
  987|       |
  988|       |    /* Init itrans_recon_dc function array */
  989|  2.42k|    ps_codec->apf_itrans_recon_dc[0] = (pf_itrans_recon_dc)ps_codec->s_func_selector.ihevcd_itrans_recon_dc_luma_fptr;
  990|  2.42k|    ps_codec->apf_itrans_recon_dc[1] = (pf_itrans_recon_dc)ps_codec->s_func_selector.ihevcd_itrans_recon_dc_chroma_fptr;
  991|       |
  992|       |    /* Init sao function array */
  993|  2.42k|    ps_codec->apf_sao_luma[0] = (pf_sao_luma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_fptr;
  994|  2.42k|    ps_codec->apf_sao_luma[1] = (pf_sao_luma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_fptr;
  995|  2.42k|    ps_codec->apf_sao_luma[2] = (pf_sao_luma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_fptr;
  996|  2.42k|    ps_codec->apf_sao_luma[3] = (pf_sao_luma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_fptr;
  997|       |
  998|  2.42k|    ps_codec->apf_sao_chroma[0] = (pf_sao_chroma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_chroma_fptr;
  999|  2.42k|    ps_codec->apf_sao_chroma[1] = (pf_sao_chroma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_chroma_fptr;
 1000|  2.42k|    ps_codec->apf_sao_chroma[2] = (pf_sao_chroma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_chroma_fptr;
 1001|  2.42k|    ps_codec->apf_sao_chroma[3] = (pf_sao_chroma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_chroma_fptr;
 1002|  2.42k|}
ihevcd_init:
 1024|  1.62k|{
 1025|  1.62k|    WORD32 status = IV_SUCCESS;
 1026|  1.62k|    WORD32 i;
 1027|       |
 1028|       |    /* Free any dynamic buffers that are allocated */
 1029|  1.62k|    ihevcd_free_dynamic_bufs(ps_codec);
 1030|       |
 1031|  1.62k|    ps_codec->u4_allocate_dynamic_done = 0;
 1032|  1.62k|    ps_codec->i4_num_disp_bufs = 1;
 1033|  1.62k|    ps_codec->i4_flush_mode = 0;
 1034|       |
 1035|  1.62k|    ps_codec->i4_ht = ps_codec->i4_disp_ht = 0;
 1036|  1.62k|    ps_codec->i4_wd = ps_codec->i4_disp_wd = 0;
 1037|  1.62k|    ps_codec->i4_strd = 0;
 1038|  1.62k|    ps_codec->i4_disp_strd = 0;
 1039|  1.62k|    ps_codec->i4_num_cores = 1;
 1040|       |
 1041|  1.62k|    ps_codec->u4_pic_cnt = 0;
 1042|  1.62k|    ps_codec->u4_disp_cnt = 0;
 1043|       |
 1044|  1.62k|    ps_codec->i4_header_mode = 0;
 1045|  1.62k|    ps_codec->i4_header_in_slice_mode = 0;
 1046|  1.62k|    ps_codec->i4_sps_done = 0;
 1047|  1.62k|    ps_codec->i4_pps_done = 0;
 1048|  1.62k|    ps_codec->i4_init_done   = 1;
 1049|  1.62k|    ps_codec->i4_first_pic_done = 0;
 1050|  1.62k|    ps_codec->s_parse.i4_first_pic_init = 0;
 1051|  1.62k|    ps_codec->i4_error_code = 0;
 1052|  1.62k|    ps_codec->i4_reset_flag = 0;
 1053|  1.62k|    ps_codec->i4_cra_as_first_pic = 1;
 1054|  1.62k|    ps_codec->i4_rasl_output_flag = 0;
 1055|       |
 1056|  1.62k|    ps_codec->i4_prev_poc_msb = 0;
 1057|  1.62k|    ps_codec->i4_prev_poc_lsb = -1;
 1058|  1.62k|    ps_codec->i4_max_prev_poc_lsb = -1;
 1059|  1.62k|    ps_codec->s_parse.i4_abs_pic_order_cnt = -1;
 1060|       |
 1061|       |    /* Set ref chroma format by default to 420SP UV interleaved */
 1062|  1.62k|    ps_codec->e_ref_chroma_fmt = IV_YUV_420SP_UV;
 1063|       |
 1064|       |    /* If the codec is in shared mode and required format is 420 SP VU interleaved then change
 1065|       |     * reference buffers chroma format
 1066|       |     */
 1067|  1.62k|    if(IV_YUV_420SP_VU == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (1067:8): [True: 404, False: 1.21k]
  ------------------
 1068|    404|    {
 1069|    404|        ps_codec->e_ref_chroma_fmt = IV_YUV_420SP_VU;
 1070|    404|    }
 1071|       |
 1072|       |
 1073|       |
 1074|  1.62k|    ps_codec->i4_disable_deblk_pic = 0;
 1075|       |
 1076|  1.62k|    ps_codec->i4_degrade_pic_cnt    = 0;
 1077|  1.62k|    ps_codec->i4_degrade_pics       = 0;
 1078|  1.62k|    ps_codec->i4_degrade_type       = 0;
 1079|  1.62k|    ps_codec->i4_disable_sao_pic    = 0;
 1080|  1.62k|    ps_codec->i4_fullpel_inter_pred = 0;
 1081|  1.62k|    ps_codec->u4_enable_fmt_conv_ahead = 0;
 1082|  1.62k|    ps_codec->i4_share_disp_buf_cnt = 0;
 1083|       |
 1084|  1.62k|    {
 1085|  1.62k|        sps_t *ps_sps = ps_codec->ps_sps_base;
 1086|  1.62k|        pps_t *ps_pps = ps_codec->ps_pps_base;
 1087|       |
 1088|  29.2k|        for(i = 0; i < MAX_SPS_CNT; i++)
  ------------------
  |  |  317|  29.2k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  |  Branch (1088:20): [True: 27.5k, False: 1.62k]
  ------------------
 1089|  27.5k|        {
 1090|  27.5k|            ps_sps->i1_sps_valid = 0;
 1091|  27.5k|            ps_sps++;
 1092|  27.5k|        }
 1093|       |
 1094|   107k|        for(i = 0; i < MAX_PPS_CNT; i++)
  ------------------
  |  |  334|   107k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (1094:20): [True: 105k, False: 1.62k]
  ------------------
 1095|   105k|        {
 1096|   105k|            ps_pps->i1_pps_valid = 0;
 1097|   105k|            ps_pps++;
 1098|   105k|        }
 1099|  1.62k|    }
 1100|       |
 1101|  1.62k|    ihevcd_set_default_params(ps_codec);
 1102|       |    /* Initialize MV Bank buffer manager */
 1103|  1.62k|    ihevc_buf_mgr_init((buf_mgr_t *)ps_codec->pv_mv_buf_mgr);
 1104|       |
 1105|       |    /* Initialize Picture buffer manager */
 1106|  1.62k|    ihevc_buf_mgr_init((buf_mgr_t *)ps_codec->pv_pic_buf_mgr);
 1107|       |
 1108|  1.62k|    ps_codec->ps_pic_buf = (pic_buf_t *)ps_codec->pv_pic_buf_base;
 1109|       |
 1110|  1.62k|    memset(ps_codec->ps_pic_buf, 0, BUF_MGR_MAX_CNT  * sizeof(pic_buf_t));
  ------------------
  |  |   37|  1.62k|#define BUF_MGR_MAX_CNT 64
  ------------------
 1111|       |
 1112|       |
 1113|       |
 1114|       |    /* Initialize display buffer manager */
 1115|  1.62k|    ihevc_disp_mgr_init((disp_mgr_t *)ps_codec->pv_disp_buf_mgr);
 1116|       |
 1117|       |    /* Initialize dpb manager */
 1118|  1.62k|    ihevc_dpb_mgr_init((dpb_mgr_t *)ps_codec->pv_dpb_mgr);
 1119|       |
 1120|  1.62k|    ps_codec->e_processor_soc = SOC_GENERIC;
 1121|       |    /* The following can be over-ridden using soc parameter as a hack */
 1122|  1.62k|    ps_codec->u4_nctb = 0x7FFFFFFF;
 1123|  1.62k|    ihevcd_init_arch(ps_codec);
 1124|       |
 1125|  1.62k|    ihevcd_init_function_ptr(ps_codec);
 1126|       |
 1127|  1.62k|    ihevcd_update_function_ptr(ps_codec);
 1128|       |
 1129|  1.62k|    return status;
 1130|  1.62k|}
ihevcd_allocate_static_bufs:
 1157|    797|{
 1158|    797|    WORD32 size;
 1159|    797|    void *pv_buf;
 1160|    797|    UWORD8 *pu1_buf;
 1161|    797|    WORD32 i;
 1162|    797|    codec_t *ps_codec;
 1163|    797|    IV_API_CALL_STATUS_T status = IV_SUCCESS;
 1164|    797|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 1165|    797|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1166|    797|    void *pv_mem_ctxt;
 1167|       |
 1168|       |    /* Request memory for HEVCD object */
 1169|    797|    ps_create_op->s_ivd_create_op_t.pv_handle = NULL;
 1170|       |
 1171|    797|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 1172|    797|    pf_aligned_free = ps_create_ip->s_ivd_create_ip_t.pf_aligned_free;
 1173|    797|    pv_mem_ctxt  = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 1174|       |
 1175|       |
 1176|    797|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, sizeof(iv_obj_t));
 1177|    797|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1178|    797|    memset(pv_buf, 0, sizeof(iv_obj_t));
 1179|    797|    *pps_codec_obj = (iv_obj_t *)pv_buf;
 1180|    797|    ps_create_op->s_ivd_create_op_t.pv_handle = *pps_codec_obj;
 1181|       |
 1182|       |
 1183|    797|    (*pps_codec_obj)->pv_codec_handle = NULL;
 1184|    797|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, sizeof(codec_t));
 1185|    797|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1186|    797|    (*pps_codec_obj)->pv_codec_handle = (codec_t *)pv_buf;
 1187|    797|    ps_codec = (codec_t *)pv_buf;
 1188|       |
 1189|    797|    memset(ps_codec, 0, sizeof(codec_t));
 1190|       |
 1191|    797|#ifndef LOGO_EN
 1192|    797|    ps_codec->i4_share_disp_buf = ps_create_ip->s_ivd_create_ip_t.u4_share_disp_buf;
 1193|       |#else
 1194|       |    ps_codec->i4_share_disp_buf = 0;
 1195|       |#endif
 1196|       |
 1197|       |    /* Shared display mode is supported only for 420SP and 420P formats */
 1198|    797|    if((ps_create_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420P) &&
  ------------------
  |  Branch (1198:8): [True: 516, False: 281]
  ------------------
 1199|    797|       (ps_create_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_UV) &&
  ------------------
  |  Branch (1199:8): [True: 424, False: 92]
  ------------------
 1200|    797|       (ps_create_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_VU))
  ------------------
  |  Branch (1200:8): [True: 123, False: 301]
  ------------------
 1201|    123|    {
 1202|    123|        ps_codec->i4_share_disp_buf = 0;
 1203|    123|    }
 1204|       |
 1205|    797|    if (ps_create_ip->s_ivd_create_ip_t.u4_size == sizeof(ihevcd_cxa_create_ip_t))
  ------------------
  |  Branch (1205:9): [True: 797, False: 0]
  ------------------
 1206|    797|    {
 1207|    797|        ps_codec->u1_enable_cu_info = ps_create_ip->u4_enable_frame_info;
 1208|    797|    }
 1209|       |
 1210|    797|    ps_codec->e_chroma_fmt = ps_create_ip->s_ivd_create_ip_t.e_output_format;
 1211|       |
 1212|    797|    ps_codec->pf_aligned_alloc = pf_aligned_alloc;
 1213|    797|    ps_codec->pf_aligned_free = pf_aligned_free;
 1214|    797|    ps_codec->pv_mem_ctxt = pv_mem_ctxt;
 1215|    797|    ps_codec->i4_threads_active = ps_create_ip->u4_keep_threads_active;
 1216|       |
 1217|       |    /* Request memory to hold thread handles for each processing thread */
 1218|    797|    size = MAX_PROCESS_THREADS * ithread_get_handle_size();
  ------------------
  |  |  121|    797|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|    797|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
 1219|    797|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1220|    797|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1221|    797|    memset(pv_buf, 0, size);
 1222|       |
 1223|  7.17k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  7.17k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  7.17k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1223:16): [True: 6.37k, False: 797]
  ------------------
 1224|  6.37k|    {
 1225|  6.37k|        WORD32 handle_size = ithread_get_handle_size();
 1226|  6.37k|        ps_codec->apv_process_thread_handle[i] =
 1227|  6.37k|                        (UWORD8 *)pv_buf + (i * handle_size);
 1228|  6.37k|    }
 1229|       |
 1230|    797|    if(ps_codec->i4_threads_active)
  ------------------
  |  Branch (1230:8): [True: 797, False: 0]
  ------------------
 1231|    797|    {
 1232|       |        /* Request memory to hold mutex (start/done) for each processing thread */
 1233|    797|        size = 2 * MAX_PROCESS_THREADS * ithread_get_mutex_lock_size();
  ------------------
  |  |  121|    797|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|    797|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
 1234|    797|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1235|    797|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1236|    797|        memset(pv_buf, 0, size);
 1237|       |
 1238|  7.17k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  7.17k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  7.17k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1238:20): [True: 6.37k, False: 797]
  ------------------
 1239|  6.37k|        {
 1240|  6.37k|            WORD32 ret;
 1241|  6.37k|            WORD32 mutex_size = ithread_get_mutex_lock_size();
 1242|  6.37k|            ps_codec->apv_proc_start_mutex[i] =
 1243|  6.37k|                            (UWORD8 *)pv_buf + (2 * i * mutex_size);
 1244|  6.37k|            ps_codec->apv_proc_done_mutex[i] =
 1245|  6.37k|                            (UWORD8 *)pv_buf + ((2 * i + 1) * mutex_size);
 1246|       |
 1247|  6.37k|            ret = ithread_mutex_init(ps_codec->apv_proc_start_mutex[i]);
 1248|  6.37k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  6.37k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 6.37k]
  |  |  ------------------
  ------------------
 1249|       |
 1250|  6.37k|            ret = ithread_mutex_init(ps_codec->apv_proc_done_mutex[i]);
 1251|  6.37k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  6.37k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 6.37k]
  |  |  ------------------
  ------------------
 1252|  6.37k|        }
 1253|       |
 1254|    797|        size = 2 * MAX_PROCESS_THREADS * ithread_get_cond_struct_size();
  ------------------
  |  |  121|    797|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|    797|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
 1255|    797|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1256|    797|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1257|    797|        memset(pv_buf, 0, size);
 1258|       |
 1259|  7.17k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  7.17k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  7.17k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1259:20): [True: 6.37k, False: 797]
  ------------------
 1260|  6.37k|        {
 1261|  6.37k|            WORD32 ret;
 1262|  6.37k|            WORD32 cond_size = ithread_get_cond_struct_size();
 1263|  6.37k|            ps_codec->apv_proc_start_condition[i] =
 1264|  6.37k|                            (UWORD8 *)pv_buf + (2 * i * cond_size);
 1265|  6.37k|            ps_codec->apv_proc_done_condition[i] =
 1266|  6.37k|                            (UWORD8 *)pv_buf + ((2 * i + 1) * cond_size);
 1267|       |
 1268|  6.37k|            ret = ithread_cond_init(ps_codec->apv_proc_start_condition[i]);
 1269|  6.37k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  6.37k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 6.37k]
  |  |  ------------------
  ------------------
 1270|       |
 1271|  6.37k|            ret = ithread_cond_init(ps_codec->apv_proc_done_condition[i]);
 1272|  6.37k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  6.37k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 6.37k]
  |  |  ------------------
  ------------------
 1273|  6.37k|        }
 1274|    797|    }
 1275|       |
 1276|       |    /* Request memory for static bitstream buffer which holds bitstream after emulation prevention */
 1277|    797|    size = MIN_BITSBUF_SIZE;
  ------------------
  |  |  188|    797|#define MIN_BITSBUF_SIZE (1024 * 1024)
  ------------------
 1278|    797|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size + 16); //Alloc extra for parse optimization
 1279|    797|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1280|    797|    memset(pv_buf, 0, size + 16);
 1281|    797|    ps_codec->pu1_bitsbuf_static = pv_buf;
 1282|    797|    ps_codec->u4_bitsbuf_size_static = size;
 1283|       |
 1284|       |    /* size for holding display manager context */
 1285|    797|    size = sizeof(buf_mgr_t);
 1286|    797|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1287|    797|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1288|    797|    memset(pv_buf, 0, size);
 1289|    797|    ps_codec->pv_disp_buf_mgr = pv_buf;
 1290|       |
 1291|       |    /* size for holding dpb manager context */
 1292|    797|    size = sizeof(dpb_mgr_t);
 1293|    797|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1294|    797|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1295|    797|    memset(pv_buf, 0, size);
 1296|    797|    ps_codec->pv_dpb_mgr = pv_buf;
 1297|       |
 1298|       |    /* size for holding buffer manager context */
 1299|    797|    size = sizeof(buf_mgr_t);
 1300|    797|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1301|    797|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1302|    797|    memset(pv_buf, 0, size);
 1303|    797|    ps_codec->pv_pic_buf_mgr = pv_buf;
 1304|       |
 1305|       |    /* size for holding mv buffer manager context */
 1306|    797|    size = sizeof(buf_mgr_t);
 1307|    797|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1308|    797|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1309|    797|    memset(pv_buf, 0, size);
 1310|    797|    ps_codec->pv_mv_buf_mgr = pv_buf;
 1311|       |
 1312|    797|    size = MAX_VPS_CNT * sizeof(vps_t);
  ------------------
  |  |  289|    797|#define MAX_VPS_CNT         16
  ------------------
 1313|    797|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1314|    797|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1315|    797|    memset(pv_buf, 0, size);
 1316|    797|    ps_codec->ps_vps_base = pv_buf;
 1317|    797|    ps_codec->s_parse.ps_vps_base = ps_codec->ps_vps_base;
 1318|       |
 1319|    797|    size = MAX_SPS_CNT * sizeof(sps_t);
  ------------------
  |  |  317|    797|#define MAX_SPS_CNT         (16 + 1)
  ------------------
 1320|    797|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1321|    797|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1322|    797|    memset(pv_buf, 0, size);
 1323|    797|    ps_codec->ps_sps_base = pv_buf;
 1324|    797|    ps_codec->s_parse.ps_sps_base = ps_codec->ps_sps_base;
 1325|       |
 1326|    797|    size = MAX_PPS_CNT * sizeof(pps_t);
  ------------------
  |  |  334|    797|#define MAX_PPS_CNT         (64 + 1)
  ------------------
 1327|    797|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1328|    797|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1329|    797|    memset(pv_buf, 0, size);
 1330|    797|    ps_codec->ps_pps_base = pv_buf;
 1331|    797|    ps_codec->s_parse.ps_pps_base = ps_codec->ps_pps_base;
 1332|       |
 1333|    797|    size = MAX_SLICE_HDR_CNT * sizeof(slice_header_t);
  ------------------
  |  |  153|    797|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|    797|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 1334|    797|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1335|    797|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1336|    797|    memset(pv_buf, 0, size);
 1337|    797|    ps_codec->ps_slice_hdr_base = (slice_header_t *)pv_buf;
 1338|    797|    ps_codec->s_parse.ps_slice_hdr_base = ps_codec->ps_slice_hdr_base;
 1339|       |
 1340|       |
 1341|    797|    SCALING_MAT_SIZE(size)
  ------------------
  |  |  194|    797|#define SCALING_MAT_SIZE(m_scaling_mat_size)                                 \
  |  |  195|    797|{                                                                            \
  |  |  196|    797|    m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  419|    797|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |                   m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  419|    797|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |  197|    797|    m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  420|    797|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  420|    797|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |  198|    797|    m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  421|    797|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  421|    797|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |  199|    797|    m_scaling_mat_size += 2 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  422|    797|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |                   m_scaling_mat_size += 2 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  422|    797|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |  200|    797|}
  ------------------
 1342|    797|    size = (MAX_SPS_CNT + MAX_PPS_CNT) * size * sizeof(WORD16);
  ------------------
  |  |  317|    797|#define MAX_SPS_CNT         (16 + 1)
  ------------------
                  size = (MAX_SPS_CNT + MAX_PPS_CNT) * size * sizeof(WORD16);
  ------------------
  |  |  334|    797|#define MAX_PPS_CNT         (64 + 1)
  ------------------
 1343|    797|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1344|    797|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1345|    797|    memset(pv_buf, 0, size);
 1346|    797|    ps_codec->pi2_scaling_mat = (WORD16 *)pv_buf;
 1347|       |
 1348|       |
 1349|       |    /* Size for holding pic_buf_t for each reference picture
 1350|       |     * Since this is only a structure allocation and not actual buffer allocation,
 1351|       |     * it is allocated for BUF_MGR_MAX_CNT entries
 1352|       |     */
 1353|    797|    size = BUF_MGR_MAX_CNT * sizeof(pic_buf_t);
  ------------------
  |  |   37|    797|#define BUF_MGR_MAX_CNT 64
  ------------------
 1354|    797|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1355|    797|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1356|    797|    memset(pv_buf, 0, size);
 1357|    797|    ps_codec->pv_pic_buf_base = (UWORD8 *)pv_buf;
 1358|       |
 1359|       |    /* TO hold scratch buffers needed for each SAO context */
 1360|    797|    size = 4 * MAX_CTB_SIZE * MAX_CTB_SIZE;
  ------------------
  |  |  341|    797|#define MAX_CTB_SIZE        64
  ------------------
                  size = 4 * MAX_CTB_SIZE * MAX_CTB_SIZE;
  ------------------
  |  |  341|    797|#define MAX_CTB_SIZE        64
  ------------------
 1361|       |
 1362|       |    /* 2 temporary buffers*/
 1363|    797|    size *= 2;
 1364|    797|    size *= MAX_PROCESS_THREADS;
  ------------------
  |  |  121|    797|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|    797|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
 1365|       |
 1366|    797|    pu1_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1367|    797|    RETURN_IF((NULL == pu1_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1368|    797|    memset(pu1_buf, 0, size);
 1369|       |
 1370|  7.17k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  7.17k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  7.17k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1370:16): [True: 6.37k, False: 797]
  ------------------
 1371|  6.37k|    {
 1372|  6.37k|        ps_codec->as_process[i].s_sao_ctxt.pu1_tmp_buf_luma = (UWORD8 *)pu1_buf;
 1373|  6.37k|        pu1_buf += 4 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8);
  ------------------
  |  |  341|  6.37k|#define MAX_CTB_SIZE        64
  ------------------
                      pu1_buf += 4 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8);
  ------------------
  |  |  341|  6.37k|#define MAX_CTB_SIZE        64
  ------------------
 1374|       |
 1375|  6.37k|        ps_codec->as_process[i].s_sao_ctxt.pu1_tmp_buf_chroma = (UWORD8 *)pu1_buf;
 1376|  6.37k|        pu1_buf += 4 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8);
  ------------------
  |  |  341|  6.37k|#define MAX_CTB_SIZE        64
  ------------------
                      pu1_buf += 4 * MAX_CTB_SIZE * MAX_CTB_SIZE * sizeof(UWORD8);
  ------------------
  |  |  341|  6.37k|#define MAX_CTB_SIZE        64
  ------------------
 1377|  6.37k|    }
 1378|       |
 1379|       |    /* Allocate intra pred modes buffer */
 1380|       |    /* 8 bits per 4x4 */
 1381|       |    /* 16 bytes each for top and left 64 pixels and 16 bytes for default mode */
 1382|    797|    size =  3 * 16 * sizeof(UWORD8);
 1383|    797|    pu1_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1384|    797|    RETURN_IF((NULL == pu1_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1385|    797|    memset(pu1_buf, 0, size);
 1386|    797|    ps_codec->s_parse.pu1_luma_intra_pred_mode_left = pu1_buf;
 1387|    797|    ps_codec->s_parse.pu1_luma_intra_pred_mode_top  = pu1_buf + 16;
 1388|       |
 1389|    797|    {
 1390|    797|        WORD32 inter_pred_tmp_buf_size, ntaps_luma;
 1391|    797|        WORD32 pic_pu_idx_map_size;
 1392|       |
 1393|       |        /* Max inter pred size */
 1394|    797|        ntaps_luma = 8;
 1395|    797|        inter_pred_tmp_buf_size = sizeof(WORD16) * (MAX_CTB_SIZE + ntaps_luma) * MAX_CTB_SIZE;
  ------------------
  |  |  341|    797|#define MAX_CTB_SIZE        64
  ------------------
                      inter_pred_tmp_buf_size = sizeof(WORD16) * (MAX_CTB_SIZE + ntaps_luma) * MAX_CTB_SIZE;
  ------------------
  |  |  341|    797|#define MAX_CTB_SIZE        64
  ------------------
 1396|       |
 1397|    797|        inter_pred_tmp_buf_size = ALIGN64(inter_pred_tmp_buf_size);
  ------------------
  |  |   50|    797|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1398|       |
 1399|       |        /* To hold pu_index w.r.t. frame level pu_t array for a CTB */
 1400|    797|        pic_pu_idx_map_size = sizeof(WORD32) * (18 * 18);
 1401|    797|        pic_pu_idx_map_size = ALIGN64(pic_pu_idx_map_size);
  ------------------
  |  |   50|    797|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1402|       |
 1403|    797|        size =  inter_pred_tmp_buf_size * 2;
 1404|    797|        size += pic_pu_idx_map_size;
 1405|    797|        size *= MAX_PROCESS_THREADS;
  ------------------
  |  |  121|    797|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|    797|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
 1406|       |
 1407|    797|        pu1_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1408|    797|        RETURN_IF((NULL == pu1_buf), IV_FAIL);
  ------------------
  |  |   37|    797|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 797]
  |  |  ------------------
  ------------------
 1409|    797|        memset(pu1_buf, 0, size);
 1410|       |
 1411|  7.17k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  7.17k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  7.17k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1411:20): [True: 6.37k, False: 797]
  ------------------
 1412|  6.37k|        {
 1413|  6.37k|            ps_codec->as_process[i].pi2_inter_pred_tmp_buf1 = (WORD16 *)pu1_buf;
 1414|  6.37k|            pu1_buf += inter_pred_tmp_buf_size;
 1415|       |
 1416|  6.37k|            ps_codec->as_process[i].pi2_inter_pred_tmp_buf2 = (WORD16 *)pu1_buf;
 1417|  6.37k|            pu1_buf += inter_pred_tmp_buf_size;
 1418|       |
 1419|       |            /* Inverse transform intermediate and inverse scan output buffers reuse inter pred scratch buffers */
 1420|  6.37k|            ps_codec->as_process[i].pi2_itrans_intrmd_buf =
 1421|  6.37k|                            ps_codec->as_process[i].pi2_inter_pred_tmp_buf2;
 1422|  6.37k|            ps_codec->as_process[i].pi2_invscan_out =
 1423|  6.37k|                            ps_codec->as_process[i].pi2_inter_pred_tmp_buf1;
 1424|       |
 1425|  6.37k|            ps_codec->as_process[i].pu4_pic_pu_idx_map = (UWORD32 *)pu1_buf;
 1426|  6.37k|            ps_codec->as_process[i].s_bs_ctxt.pu4_pic_pu_idx_map =
 1427|  6.37k|                            (UWORD32 *)pu1_buf;
 1428|  6.37k|            pu1_buf += pic_pu_idx_map_size;
 1429|       |
 1430|       |            //   ps_codec->as_process[i].pi2_inter_pred_tmp_buf3 = (WORD16 *)pu1_buf;
 1431|       |            //   pu1_buf += inter_pred_tmp_buf_size;
 1432|       |
 1433|  6.37k|            ps_codec->as_process[i].i4_inter_pred_tmp_buf_strd = MAX_CTB_SIZE;
  ------------------
  |  |  341|  6.37k|#define MAX_CTB_SIZE        64
  ------------------
 1434|       |
 1435|  6.37k|        }
 1436|    797|    }
 1437|       |    /* Initialize pointers in PPS structures */
 1438|      0|    {
 1439|    797|        sps_t *ps_sps = ps_codec->ps_sps_base;
 1440|    797|        pps_t *ps_pps = ps_codec->ps_pps_base;
 1441|    797|        WORD16 *pi2_scaling_mat =  ps_codec->pi2_scaling_mat;
 1442|    797|        WORD32 scaling_mat_size;
 1443|       |
 1444|    797|        SCALING_MAT_SIZE(scaling_mat_size);
  ------------------
  |  |  194|    797|#define SCALING_MAT_SIZE(m_scaling_mat_size)                                 \
  |  |  195|    797|{                                                                            \
  |  |  196|    797|    m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  419|    797|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |                   m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  419|    797|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |  197|    797|    m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  420|    797|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  420|    797|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |  198|    797|    m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  421|    797|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  421|    797|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |  199|    797|    m_scaling_mat_size += 2 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  422|    797|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |                   m_scaling_mat_size += 2 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  422|    797|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |  200|    797|}
  ------------------
 1445|       |
 1446|  14.3k|        for(i = 0; i < MAX_SPS_CNT; i++)
  ------------------
  |  |  317|  14.3k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  |  Branch (1446:20): [True: 13.5k, False: 797]
  ------------------
 1447|  13.5k|        {
 1448|  13.5k|            ps_sps->pi2_scaling_mat  = pi2_scaling_mat;
 1449|  13.5k|            pi2_scaling_mat += scaling_mat_size;
 1450|  13.5k|            ps_sps++;
 1451|  13.5k|        }
 1452|       |
 1453|  52.6k|        for(i = 0; i < MAX_PPS_CNT; i++)
  ------------------
  |  |  334|  52.6k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (1453:20): [True: 51.8k, False: 797]
  ------------------
 1454|  51.8k|        {
 1455|  51.8k|            ps_pps->pi2_scaling_mat  = pi2_scaling_mat;
 1456|  51.8k|            pi2_scaling_mat += scaling_mat_size;
 1457|  51.8k|            ps_pps++;
 1458|  51.8k|        }
 1459|    797|    }
 1460|       |
 1461|    797|    return (status);
 1462|    797|}
ihevcd_join_threads:
 1465|  1.62k|{
 1466|  1.62k|    if(ps_codec->i4_threads_active)
  ------------------
  |  Branch (1466:8): [True: 1.62k, False: 0]
  ------------------
 1467|  1.62k|    {
 1468|  1.62k|        int i;
 1469|       |        /* Wait for threads */
 1470|  1.62k|        ps_codec->i4_break_threads = 1;
 1471|       |
 1472|  14.6k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.6k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.6k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1472:20): [True: 12.9k, False: 1.62k]
  ------------------
 1473|  12.9k|        {
 1474|  12.9k|            WORD32 ret;
 1475|  12.9k|            if(ps_codec->ai4_process_thread_created[i])
  ------------------
  |  Branch (1475:16): [True: 903, False: 12.0k]
  ------------------
 1476|    903|            {
 1477|    903|                ret = ithread_mutex_lock(ps_codec->apv_proc_start_mutex[i]);
 1478|    903|                RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|    903|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 903]
  |  |  ------------------
  ------------------
 1479|       |
 1480|    903|                ps_codec->ai4_process_start[i] = 1;
 1481|    903|                ret = ithread_cond_signal(ps_codec->apv_proc_start_condition[i]);
 1482|    903|                RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|    903|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 903]
  |  |  ------------------
  ------------------
 1483|       |
 1484|    903|                ret = ithread_mutex_unlock(ps_codec->apv_proc_start_mutex[i]);
 1485|    903|                RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|    903|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 903]
  |  |  ------------------
  ------------------
 1486|       |
 1487|    903|                ithread_join(ps_codec->apv_process_thread_handle[i], NULL);
 1488|       |
 1489|    903|                ps_codec->ai4_process_thread_created[i] = 0;
 1490|    903|            }
 1491|  12.9k|        }
 1492|  1.62k|    }
 1493|  1.62k|    return IV_SUCCESS;
 1494|  1.62k|}
ihevcd_free_static_bufs:
 1515|    797|{
 1516|    797|    codec_t *ps_codec;
 1517|       |
 1518|    797|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1519|    797|    void *pv_mem_ctxt;
 1520|       |
 1521|    797|    ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle;
 1522|    797|    pf_aligned_free = ps_codec->pf_aligned_free;
 1523|    797|    pv_mem_ctxt = ps_codec->pv_mem_ctxt;
 1524|       |
 1525|    797|    if(ps_codec->i4_threads_active)
  ------------------
  |  Branch (1525:8): [True: 797, False: 0]
  ------------------
 1526|    797|    {
 1527|       |        /* Wait for threads */
 1528|    797|        ihevcd_join_threads(ps_codec);
 1529|       |
 1530|  7.17k|        for(int i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  7.17k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  7.17k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1530:24): [True: 6.37k, False: 797]
  ------------------
 1531|  6.37k|        {
 1532|  6.37k|            WORD32 ret;
 1533|  6.37k|            ret = ithread_cond_destroy(ps_codec->apv_proc_start_condition[i]);
 1534|  6.37k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  6.37k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 6.37k]
  |  |  ------------------
  ------------------
 1535|       |
 1536|  6.37k|            ret = ithread_cond_destroy(ps_codec->apv_proc_done_condition[i]);
 1537|  6.37k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  6.37k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 6.37k]
  |  |  ------------------
  ------------------
 1538|       |
 1539|  6.37k|            ret = ithread_mutex_destroy(ps_codec->apv_proc_start_mutex[i]);
 1540|  6.37k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  6.37k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 6.37k]
  |  |  ------------------
  ------------------
 1541|       |
 1542|  6.37k|            ret = ithread_mutex_destroy(ps_codec->apv_proc_done_mutex[i]);
 1543|  6.37k|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  6.37k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 6.37k]
  |  |  ------------------
  ------------------
 1544|  6.37k|        }
 1545|    797|        ALIGNED_FREE(ps_codec, ps_codec->apv_proc_start_mutex[0]);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1546|    797|        ALIGNED_FREE(ps_codec, ps_codec->apv_proc_start_condition[0]);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1547|    797|    }
 1548|       |
 1549|    797|    ALIGNED_FREE(ps_codec, ps_codec->apv_process_thread_handle[0]);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1550|    797|    ALIGNED_FREE(ps_codec, ps_codec->pu1_bitsbuf_static);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1551|       |
 1552|    797|    ALIGNED_FREE(ps_codec, ps_codec->pv_disp_buf_mgr);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1553|    797|    ALIGNED_FREE(ps_codec, ps_codec->pv_dpb_mgr);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1554|    797|    ALIGNED_FREE(ps_codec, ps_codec->pv_pic_buf_mgr);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1555|    797|    ALIGNED_FREE(ps_codec, ps_codec->pv_mv_buf_mgr);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1556|    797|    ALIGNED_FREE(ps_codec, ps_codec->ps_vps_base);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1557|    797|    ALIGNED_FREE(ps_codec, ps_codec->ps_sps_base);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1558|    797|    ALIGNED_FREE(ps_codec, ps_codec->ps_pps_base);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1559|    797|    ALIGNED_FREE(ps_codec, ps_codec->ps_slice_hdr_base);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1560|    797|    ALIGNED_FREE(ps_codec, ps_codec->pi2_scaling_mat);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1561|    797|    ALIGNED_FREE(ps_codec, ps_codec->pv_pic_buf_base);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1562|    797|    ALIGNED_FREE(ps_codec, ps_codec->s_parse.pu1_luma_intra_pred_mode_left);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1563|    797|    ALIGNED_FREE(ps_codec, ps_codec->as_process[0].s_sao_ctxt.pu1_tmp_buf_luma);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1564|    797|    ALIGNED_FREE(ps_codec, ps_codec->as_process[0].pi2_inter_pred_tmp_buf1);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1565|    797|    ALIGNED_FREE(ps_codec, ps_codec_obj->pv_codec_handle);
  ------------------
  |  |   96|    797|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|    797|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 797, False: 0]
  |  |  ------------------
  ------------------
 1566|       |
 1567|    797|    if(ps_codec_obj)
  ------------------
  |  Branch (1567:8): [True: 797, False: 0]
  ------------------
 1568|    797|    {
 1569|    797|        pf_aligned_free(pv_mem_ctxt, ps_codec_obj);
 1570|    797|    }
 1571|       |
 1572|    797|    return IV_SUCCESS;
 1573|       |
 1574|    797|}
ihevcd_allocate_dynamic_bufs:
 1597|  1.56k|{
 1598|  1.56k|    WORD32 max_tile_cols, max_tile_rows;
 1599|  1.56k|    WORD32 max_ctb_rows, max_ctb_cols;
 1600|  1.56k|    WORD32 max_num_cu_cols;
 1601|  1.56k|    WORD32 max_num_cu_rows;
 1602|  1.56k|    WORD32 max_num_4x4_cols;
 1603|  1.56k|    WORD32 max_ctb_cnt;
 1604|  1.56k|    WORD32 wd;
 1605|  1.56k|    WORD32 ht;
 1606|  1.56k|    WORD32 i;
 1607|  1.56k|    WORD32 max_dpb_size;
 1608|  1.56k|    void *pv_mem_ctxt = ps_codec->pv_mem_ctxt;
 1609|  1.56k|    void *pv_buf;
 1610|  1.56k|    UWORD8 *pu1_buf;
 1611|  1.56k|    WORD32 size;
 1612|       |
 1613|  1.56k|    wd = ALIGN64(ps_codec->i4_wd);
  ------------------
  |  |   50|  1.56k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1614|  1.56k|    ht = ALIGN64(ps_codec->i4_ht);
  ------------------
  |  |   50|  1.56k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1615|       |
 1616|  1.56k|    max_tile_cols = (wd + MIN_TILE_WD - 1) / MIN_TILE_WD;
  ------------------
  |  |  305|  1.56k|#define MIN_TILE_WD  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  341|  1.56k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
                  max_tile_cols = (wd + MIN_TILE_WD - 1) / MIN_TILE_WD;
  ------------------
  |  |  305|  1.56k|#define MIN_TILE_WD  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  341|  1.56k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
 1617|  1.56k|    max_tile_rows = (ht + MIN_TILE_HT - 1) / MIN_TILE_HT;
  ------------------
  |  |  308|  1.56k|#define MIN_TILE_HT  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  341|  1.56k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
                  max_tile_rows = (ht + MIN_TILE_HT - 1) / MIN_TILE_HT;
  ------------------
  |  |  308|  1.56k|#define MIN_TILE_HT  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  341|  1.56k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
 1618|  1.56k|    max_ctb_rows  = ht / MIN_CTB_SIZE;
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 1619|  1.56k|    max_ctb_cols  = wd / MIN_CTB_SIZE;
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 1620|  1.56k|    max_ctb_cnt   = max_ctb_rows * max_ctb_cols;
 1621|  1.56k|    max_num_cu_cols = wd / MIN_CU_SIZE;
  ------------------
  |  |  363|  1.56k|#define MIN_CU_SIZE         8
  ------------------
 1622|  1.56k|    max_num_cu_rows = ht / MIN_CU_SIZE;
  ------------------
  |  |  363|  1.56k|#define MIN_CU_SIZE         8
  ------------------
 1623|  1.56k|    max_num_4x4_cols = wd / 4;
 1624|       |
 1625|       |    /* Allocate tile structures */
 1626|  1.56k|    size = max_tile_cols * max_tile_rows;
 1627|  1.56k|    size *= sizeof(tile_t);
 1628|  1.56k|    size *= MAX_PPS_CNT;
  ------------------
  |  |  334|  1.56k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
 1629|       |
 1630|  1.56k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1631|  1.56k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 1632|  1.56k|    memset(pv_buf, 0, size);
 1633|  1.56k|    ps_codec->ps_tile = (tile_t *)pv_buf;
 1634|       |
 1635|       |
 1636|       |    /* Allocate memory to hold entry point offsets */
 1637|       |    /* One entry point per tile */
 1638|  1.56k|    size = max_tile_cols * max_tile_rows;
 1639|       |
 1640|       |    /* One entry point per row of CTBs */
 1641|       |    /*********************************************************************/
 1642|       |    /* Only tiles or entropy sync is enabled at a time in main           */
 1643|       |    /* profile, but since memory required does not increase too much,    */
 1644|       |    /* this allocation is done to handle both cases                      */
 1645|       |    /*********************************************************************/
 1646|  1.56k|    size  += max_ctb_rows;
 1647|  1.56k|    size *= sizeof(WORD32);
 1648|       |
 1649|  1.56k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1650|  1.56k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 1651|  1.56k|    memset(pv_buf, 0, size);
 1652|  1.56k|    ps_codec->pi4_entry_ofst = (WORD32 *)pv_buf;
 1653|       |
 1654|       |    /* Allocate parse skip flag buffer */
 1655|       |    /* 1 bit per 8x8 */
 1656|  1.56k|    size = max_num_cu_cols / 8;
 1657|  1.56k|    size = ALIGN4(size);
  ------------------
  |  |   54|  1.56k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1658|  1.56k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1659|  1.56k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 1660|  1.56k|    memset(pv_buf, 0, size);
 1661|  1.56k|    ps_codec->s_parse.pu4_skip_cu_top = (UWORD32 *)pv_buf;
 1662|       |
 1663|       |    /* Allocate parse coding tree depth buffer */
 1664|       |    /* 2 bits per 8x8 */
 1665|  1.56k|    size =  max_num_cu_cols / 4;
 1666|  1.56k|    size = ALIGN4(size);
  ------------------
  |  |   54|  1.56k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1667|  1.56k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1668|  1.56k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 1669|  1.56k|    memset(pv_buf, 0, size);
 1670|  1.56k|    ps_codec->s_parse.pu4_ct_depth_top = (UWORD32 *)pv_buf;
 1671|       |
 1672|       |    /* Allocate intra flag buffer */
 1673|       |    /* 1 bit per 8x8 */
 1674|  1.56k|    size =  max_num_cu_cols * max_num_cu_rows / 8;
 1675|  1.56k|    size = ALIGN4(size);
  ------------------
  |  |   54|  1.56k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1676|  1.56k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1677|  1.56k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 1678|  1.56k|    memset(pv_buf, 0, size);
 1679|  1.56k|    ps_codec->pu1_pic_intra_flag = (UWORD8 *)pv_buf;
 1680|  1.56k|    ps_codec->s_parse.pu1_pic_intra_flag = ps_codec->pu1_pic_intra_flag;
 1681|       |
 1682|       |    /* Allocate transquant bypass flag buffer */
 1683|       |    /* 1 bit per 8x8 */
 1684|       |    /* Extra row and column are allocated for easy processing of top and left blocks while loop filtering */
 1685|  1.56k|    size =  ((max_num_cu_cols + 8) * (max_num_cu_rows + 8)) / 8;
 1686|  1.56k|    size = ALIGN4(size);
  ------------------
  |  |   54|  1.56k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1687|  1.56k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1688|  1.56k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 1689|  1.56k|    memset(pv_buf, 1, size);
 1690|  1.56k|    {
 1691|  1.56k|        WORD32 loop_filter_strd = (wd + 63) >> 6;
 1692|  1.56k|        ps_codec->pu1_pic_no_loop_filter_flag_base = pv_buf;
 1693|       |        /* The offset is added for easy processing of top and left blocks while loop filtering */
 1694|  1.56k|        ps_codec->pu1_pic_no_loop_filter_flag = (UWORD8 *)pv_buf + loop_filter_strd + 1;
 1695|  1.56k|        ps_codec->s_parse.pu1_pic_no_loop_filter_flag = ps_codec->pu1_pic_no_loop_filter_flag;
 1696|  1.56k|        ps_codec->s_parse.s_deblk_ctxt.pu1_pic_no_loop_filter_flag = ps_codec->pu1_pic_no_loop_filter_flag;
 1697|  1.56k|        ps_codec->s_parse.s_sao_ctxt.pu1_pic_no_loop_filter_flag = ps_codec->pu1_pic_no_loop_filter_flag;
 1698|  1.56k|    }
 1699|       |
 1700|       |    /* Initialize pointers in PPS structures */
 1701|  1.56k|    {
 1702|  1.56k|        pps_t *ps_pps = ps_codec->ps_pps_base;
 1703|  1.56k|        tile_t *ps_tile =  ps_codec->ps_tile;
 1704|       |
 1705|   102k|        for(i = 0; i < MAX_PPS_CNT; i++)
  ------------------
  |  |  334|   102k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (1705:20): [True: 101k, False: 1.56k]
  ------------------
 1706|   101k|        {
 1707|   101k|            ps_pps->ps_tile = ps_tile;
 1708|   101k|            ps_tile += (max_tile_cols * max_tile_rows);
 1709|   101k|            ps_pps++;
 1710|   101k|        }
 1711|       |
 1712|  1.56k|    }
 1713|       |
 1714|       |    /* Allocate memory for job queue */
 1715|       |
 1716|       |    /* One job per row of CTBs */
 1717|  1.56k|    size  = max_ctb_rows;
 1718|       |
 1719|       |    /* One each tile a row of CTBs, num_jobs has to incremented */
 1720|  1.56k|    size  *= max_tile_cols;
 1721|       |
 1722|       |    /* One format convert/frame copy job per row of CTBs for non-shared mode*/
 1723|  1.56k|    size  += max_ctb_rows;
 1724|       |
 1725|  1.56k|    size *= sizeof(proc_job_t);
 1726|       |
 1727|  1.56k|    size += ihevcd_jobq_ctxt_size();
 1728|  1.56k|    size = ALIGN4(size);
  ------------------
  |  |   54|  1.56k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1729|       |
 1730|  1.56k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1731|  1.56k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 1732|  1.56k|    memset(pv_buf, 0, size);
 1733|  1.56k|    ps_codec->pv_proc_jobq_buf = pv_buf;
 1734|  1.56k|    ps_codec->i4_proc_jobq_buf_size = size;
 1735|       |
 1736|  1.56k|    size =  max_ctb_cnt;
 1737|  1.56k|    size = ALIGN4(size);
  ------------------
  |  |   54|  1.56k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1738|  1.56k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1739|  1.56k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 1740|  1.56k|    memset(pv_buf, 0, size);
 1741|  1.56k|    ps_codec->pu1_parse_map = (UWORD8 *)pv_buf;
 1742|       |
 1743|  1.56k|    size =  max_ctb_cnt;
 1744|  1.56k|    size = ALIGN4(size);
  ------------------
  |  |   54|  1.56k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1745|  1.56k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1746|  1.56k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 1747|  1.56k|    memset(pv_buf, 0, size);
 1748|  1.56k|    ps_codec->pu1_proc_map = (UWORD8 *)pv_buf;
 1749|       |
 1750|       |    /** Holds top and left neighbor's pu idx into picture level pu array */
 1751|       |    /* Only one top row is enough but left has to be replicated for each process context */
 1752|  1.56k|    size =  (max_num_4x4_cols  /* left */ + MAX_PROCESS_THREADS * (MAX_CTB_SIZE / 4)/* top */ + 1/* top right */) * sizeof(WORD32);
  ------------------
  |  |  121|  1.56k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  1.56k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
                  size =  (max_num_4x4_cols  /* left */ + MAX_PROCESS_THREADS * (MAX_CTB_SIZE / 4)/* top */ + 1/* top right */) * sizeof(WORD32);
  ------------------
  |  |  341|  1.56k|#define MAX_CTB_SIZE        64
  ------------------
 1753|  1.56k|    size = ALIGN4(size);
  ------------------
  |  |   54|  1.56k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1754|  1.56k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1755|  1.56k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 1756|  1.56k|    memset(pv_buf, 0, size);
 1757|       |
 1758|  14.0k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1758:16): [True: 12.4k, False: 1.56k]
  ------------------
 1759|  12.4k|    {
 1760|  12.4k|        UWORD32 *pu4_buf = (UWORD32 *)pv_buf;
 1761|  12.4k|        ps_codec->as_process[i].pu4_pic_pu_idx_left = pu4_buf + i * (MAX_CTB_SIZE / 4);
  ------------------
  |  |  341|  12.4k|#define MAX_CTB_SIZE        64
  ------------------
 1762|  12.4k|        memset(ps_codec->as_process[i].pu4_pic_pu_idx_left, 0, sizeof(UWORD32) * MAX_CTB_SIZE / 4);
  ------------------
  |  |  341|  12.4k|#define MAX_CTB_SIZE        64
  ------------------
 1763|  12.4k|        ps_codec->as_process[i].pu4_pic_pu_idx_top = pu4_buf + MAX_PROCESS_THREADS * (MAX_CTB_SIZE / 4);
  ------------------
  |  |  121|  12.4k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  12.4k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
                      ps_codec->as_process[i].pu4_pic_pu_idx_top = pu4_buf + MAX_PROCESS_THREADS * (MAX_CTB_SIZE / 4);
  ------------------
  |  |  341|  12.4k|#define MAX_CTB_SIZE        64
  ------------------
 1764|  12.4k|    }
 1765|  1.56k|    memset(ps_codec->as_process[0].pu4_pic_pu_idx_top, 0, sizeof(UWORD32) * (wd / 4 + 1));
 1766|       |
 1767|  1.56k|    {
 1768|       |        /* To hold SAO left buffer for luma */
 1769|  1.56k|        size  = sizeof(UWORD8) * (MAX(ht, wd));
  ------------------
  |  |   42|  1.56k|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 119, False: 1.44k]
  |  |  ------------------
  ------------------
 1770|       |
 1771|       |        /* To hold SAO left buffer for chroma */
 1772|  1.56k|        size += sizeof(UWORD8) * (MAX(ht, wd));
  ------------------
  |  |   42|  1.56k|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 119, False: 1.44k]
  |  |  ------------------
  ------------------
 1773|       |
 1774|       |        /* To hold SAO top buffer for luma */
 1775|  1.56k|        size += sizeof(UWORD8) * wd;
 1776|       |
 1777|       |        /* To hold SAO top buffer for chroma */
 1778|  1.56k|        size += sizeof(UWORD8) * wd;
 1779|       |
 1780|       |        /* To hold SAO top left luma pixel value for last output ctb in a row*/
 1781|  1.56k|        size += sizeof(UWORD8) * max_ctb_rows;
 1782|       |
 1783|       |        /* To hold SAO top left chroma pixel value last output ctb in a row*/
 1784|  1.56k|        size += sizeof(UWORD8) * max_ctb_rows * 2;
 1785|       |
 1786|       |        /* To hold SAO top left pixel luma for current ctb - column array*/
 1787|  1.56k|        size += sizeof(UWORD8) * max_ctb_rows;
 1788|       |
 1789|       |        /* To hold SAO top left pixel chroma for current ctb-column array*/
 1790|  1.56k|        size += sizeof(UWORD8) * max_ctb_rows * 2;
 1791|       |
 1792|       |        /* To hold SAO top right pixel luma pixel value last output ctb in a row*/
 1793|  1.56k|        size += sizeof(UWORD8) * max_ctb_cols;
 1794|       |
 1795|       |        /* To hold SAO top right pixel chroma pixel value last output ctb in a row*/
 1796|  1.56k|        size += sizeof(UWORD8) * max_ctb_cols * 2;
 1797|       |
 1798|       |        /*To hold SAO botton bottom left pixels for luma*/
 1799|  1.56k|        size += sizeof(UWORD8) * max_ctb_rows;
 1800|       |
 1801|       |        /*To hold SAO botton bottom left pixels for luma*/
 1802|  1.56k|        size += sizeof(UWORD8) * max_ctb_rows * 2;
 1803|  1.56k|        size = ALIGN64(size);
  ------------------
  |  |   50|  1.56k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1804|       |
 1805|  1.56k|        pu1_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1806|  1.56k|        RETURN_IF((NULL == pu1_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 1807|  1.56k|        memset(pu1_buf, 0, size);
 1808|       |
 1809|  14.0k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1809:20): [True: 12.4k, False: 1.56k]
  ------------------
 1810|  12.4k|        {
 1811|  12.4k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_left_luma = (UWORD8 *)pu1_buf;
 1812|  12.4k|        }
 1813|  1.56k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_left_luma = (UWORD8 *)pu1_buf;
 1814|  1.56k|        pu1_buf += MAX(ht, wd);
  ------------------
  |  |   42|  1.56k|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 119, False: 1.44k]
  |  |  ------------------
  ------------------
 1815|       |
 1816|  14.0k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1816:20): [True: 12.4k, False: 1.56k]
  ------------------
 1817|  12.4k|        {
 1818|  12.4k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_left_chroma = (UWORD8 *)pu1_buf;
 1819|  12.4k|        }
 1820|  1.56k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_left_chroma = (UWORD8 *)pu1_buf;
 1821|  1.56k|        pu1_buf += MAX(ht, wd);
  ------------------
  |  |   42|  1.56k|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 119, False: 1.44k]
  |  |  ------------------
  ------------------
 1822|  14.0k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1822:20): [True: 12.4k, False: 1.56k]
  ------------------
 1823|  12.4k|        {
 1824|  12.4k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_luma = (UWORD8 *)pu1_buf;
 1825|  12.4k|        }
 1826|  1.56k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_luma = (UWORD8 *)pu1_buf;
 1827|  1.56k|        pu1_buf += wd;
 1828|       |
 1829|  14.0k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1829:20): [True: 12.4k, False: 1.56k]
  ------------------
 1830|  12.4k|        {
 1831|  12.4k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_chroma = (UWORD8 *)pu1_buf;
 1832|  12.4k|        }
 1833|  1.56k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_chroma = (UWORD8 *)pu1_buf;
 1834|  1.56k|        pu1_buf += wd;
 1835|  14.0k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1835:20): [True: 12.4k, False: 1.56k]
  ------------------
 1836|  12.4k|        {
 1837|  12.4k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_luma_top_left_ctb = (UWORD8 *)pu1_buf;
 1838|  12.4k|        }
 1839|  1.56k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_luma_top_left_ctb = (UWORD8 *)pu1_buf;
 1840|  1.56k|        pu1_buf += ht / MIN_CTB_SIZE;
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 1841|       |
 1842|  14.0k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1842:20): [True: 12.4k, False: 1.56k]
  ------------------
 1843|  12.4k|        {
 1844|  12.4k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_chroma_top_left_ctb = (UWORD8 *)pu1_buf;
 1845|  12.4k|        }
 1846|  1.56k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_chroma_top_left_ctb = (UWORD8 *)pu1_buf;
 1847|  1.56k|        pu1_buf += (ht / MIN_CTB_SIZE) * 2;
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 1848|       |
 1849|  14.0k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1849:20): [True: 12.4k, False: 1.56k]
  ------------------
 1850|  12.4k|        {
 1851|  12.4k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_luma_curr_ctb = (UWORD8 *)pu1_buf;
 1852|  12.4k|        }
 1853|  1.56k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_luma_curr_ctb = (UWORD8 *)pu1_buf;
 1854|  1.56k|        pu1_buf += ht / MIN_CTB_SIZE;
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 1855|       |
 1856|  14.0k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1856:20): [True: 12.4k, False: 1.56k]
  ------------------
 1857|  12.4k|        {
 1858|  12.4k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_chroma_curr_ctb = (UWORD8 *)pu1_buf;
 1859|  12.4k|        }
 1860|  1.56k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_chroma_curr_ctb = (UWORD8 *)pu1_buf;
 1861|       |
 1862|  1.56k|        pu1_buf += (ht / MIN_CTB_SIZE) * 2;
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 1863|  14.0k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1863:20): [True: 12.4k, False: 1.56k]
  ------------------
 1864|  12.4k|        {
 1865|  12.4k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_luma_top_right = (UWORD8 *)pu1_buf;
 1866|  12.4k|        }
 1867|  1.56k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_luma_top_right = (UWORD8 *)pu1_buf;
 1868|       |
 1869|  1.56k|        pu1_buf += wd / MIN_CTB_SIZE;
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 1870|  14.0k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1870:20): [True: 12.4k, False: 1.56k]
  ------------------
 1871|  12.4k|        {
 1872|  12.4k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_chroma_top_right = (UWORD8 *)pu1_buf;
 1873|  12.4k|        }
 1874|  1.56k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_chroma_top_right = (UWORD8 *)pu1_buf;
 1875|       |
 1876|  1.56k|        pu1_buf += (wd / MIN_CTB_SIZE) * 2;
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 1877|       |
 1878|       |        /*Per CTB, Store 1 value for luma , 2 values for chroma*/
 1879|  14.0k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1879:20): [True: 12.4k, False: 1.56k]
  ------------------
 1880|  12.4k|        {
 1881|  12.4k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_luma_bot_left = (UWORD8 *)pu1_buf;
 1882|  12.4k|        }
 1883|  1.56k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_luma_bot_left = (UWORD8 *)pu1_buf;
 1884|       |
 1885|  1.56k|        pu1_buf += (ht / MIN_CTB_SIZE);
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 1886|       |
 1887|  14.0k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1887:20): [True: 12.4k, False: 1.56k]
  ------------------
 1888|  12.4k|        {
 1889|  12.4k|            ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_chroma_bot_left = (UWORD8 *)pu1_buf;
 1890|  12.4k|        }
 1891|  1.56k|        ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_chroma_bot_left = (UWORD8 *)pu1_buf;
 1892|       |
 1893|  1.56k|        pu1_buf += (ht / MIN_CTB_SIZE) * 2;
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 1894|  1.56k|    }
 1895|       |
 1896|       |
 1897|      0|    {
 1898|  1.56k|        UWORD8 *pu1_buf = (UWORD8 *)pv_buf;
 1899|  1.56k|        WORD32 vert_bs_size, horz_bs_size;
 1900|  1.56k|        WORD32 qp_const_flag_size;
 1901|  1.56k|        WORD32 qp_size;
 1902|  1.56k|        WORD32 num_8x8;
 1903|       |
 1904|       |        /* Max Number of vertical edges */
 1905|  1.56k|        vert_bs_size = wd / 8 + 2 * MAX_CTB_SIZE / 8;
  ------------------
  |  |  341|  1.56k|#define MAX_CTB_SIZE        64
  ------------------
 1906|       |
 1907|       |        /* Max Number of horizontal edges - extra MAX_CTB_SIZE / 8 to handle the last 4 rows separately(shifted CTB processing) */
 1908|  1.56k|        vert_bs_size *= (ht + MAX_CTB_SIZE) / MIN_TU_SIZE;
  ------------------
  |  |  341|  1.56k|#define MAX_CTB_SIZE        64
  ------------------
                      vert_bs_size *= (ht + MAX_CTB_SIZE) / MIN_TU_SIZE;
  ------------------
  |  |  348|  1.56k|#define MIN_TU_SIZE         4
  ------------------
 1909|       |
 1910|       |        /* Number of bytes */
 1911|  1.56k|        vert_bs_size /= 8;
 1912|       |
 1913|       |        /* Two bits per edge */
 1914|  1.56k|        vert_bs_size *= 2;
 1915|       |
 1916|       |        /* Max Number of horizontal edges */
 1917|  1.56k|        horz_bs_size = ht / 8 + MAX_CTB_SIZE / 8;
  ------------------
  |  |  341|  1.56k|#define MAX_CTB_SIZE        64
  ------------------
 1918|       |
 1919|       |        /* Max Number of vertical edges - extra MAX_CTB_SIZE / 8 to handle the last 4 columns separately(shifted CTB processing) */
 1920|  1.56k|        horz_bs_size *= (wd + MAX_CTB_SIZE) / MIN_TU_SIZE;
  ------------------
  |  |  341|  1.56k|#define MAX_CTB_SIZE        64
  ------------------
                      horz_bs_size *= (wd + MAX_CTB_SIZE) / MIN_TU_SIZE;
  ------------------
  |  |  348|  1.56k|#define MIN_TU_SIZE         4
  ------------------
 1921|       |
 1922|       |        /* Number of bytes */
 1923|  1.56k|        horz_bs_size /= 8;
 1924|       |
 1925|       |        /* Two bits per edge */
 1926|  1.56k|        horz_bs_size *= 2;
 1927|       |
 1928|       |        /* Max CTBs in a row */
 1929|  1.56k|        qp_const_flag_size = wd / MIN_CTB_SIZE + 1 /* The last ctb row deblk is done in last ctb + 1 row.*/;
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 1930|       |
 1931|       |        /* Max CTBs in a column */
 1932|  1.56k|        qp_const_flag_size *= ht / MIN_CTB_SIZE;
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 1933|       |
 1934|       |        /* Number of bytes */
 1935|  1.56k|        qp_const_flag_size /= 8;
 1936|       |
 1937|       |        /* QP changes at CU level - So store at 8x8 level */
 1938|  1.56k|        num_8x8 = (wd * ht) / (MIN_CU_SIZE * MIN_CU_SIZE);
  ------------------
  |  |  363|  1.56k|#define MIN_CU_SIZE         8
  ------------------
                      num_8x8 = (wd * ht) / (MIN_CU_SIZE * MIN_CU_SIZE);
  ------------------
  |  |  363|  1.56k|#define MIN_CU_SIZE         8
  ------------------
 1939|  1.56k|        qp_size = num_8x8;
 1940|       |
 1941|       |        /* To hold vertical boundary strength */
 1942|  1.56k|        size += vert_bs_size;
 1943|       |
 1944|       |        /* To hold horizontal boundary strength */
 1945|  1.56k|        size += horz_bs_size;
 1946|       |
 1947|       |        /* To hold QP */
 1948|  1.56k|        size += qp_size;
 1949|       |
 1950|       |        /* To hold QP const in CTB flags */
 1951|  1.56k|        size += qp_const_flag_size;
 1952|       |
 1953|  1.56k|        pu1_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1954|  1.56k|        RETURN_IF((NULL == pu1_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 1955|       |
 1956|  1.56k|        memset(pu1_buf, 0, size);
 1957|       |
 1958|  14.0k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1958:20): [True: 12.4k, False: 1.56k]
  ------------------
 1959|  12.4k|        {
 1960|  12.4k|            ps_codec->as_process[i].s_bs_ctxt.pu4_pic_vert_bs = (UWORD32 *)pu1_buf;
 1961|  12.4k|            ps_codec->as_process[i].s_deblk_ctxt.s_bs_ctxt.pu4_pic_vert_bs = (UWORD32 *)pu1_buf;
 1962|  12.4k|            ps_codec->s_parse.s_deblk_ctxt.s_bs_ctxt.pu4_pic_vert_bs = (UWORD32 *)pu1_buf;
 1963|  12.4k|            pu1_buf += vert_bs_size;
 1964|       |
 1965|  12.4k|            ps_codec->as_process[i].s_bs_ctxt.pu4_pic_horz_bs = (UWORD32 *)pu1_buf;
 1966|  12.4k|            ps_codec->as_process[i].s_deblk_ctxt.s_bs_ctxt.pu4_pic_horz_bs = (UWORD32 *)pu1_buf;
 1967|  12.4k|            ps_codec->s_parse.s_deblk_ctxt.s_bs_ctxt.pu4_pic_horz_bs = (UWORD32 *)pu1_buf;
 1968|  12.4k|            pu1_buf += horz_bs_size;
 1969|       |
 1970|  12.4k|            ps_codec->as_process[i].s_bs_ctxt.pu1_pic_qp = (UWORD8 *)pu1_buf;
 1971|  12.4k|            ps_codec->as_process[i].s_deblk_ctxt.s_bs_ctxt.pu1_pic_qp = (UWORD8 *)pu1_buf;
 1972|  12.4k|            ps_codec->s_parse.s_deblk_ctxt.s_bs_ctxt.pu1_pic_qp = (UWORD8 *)pu1_buf;
 1973|  12.4k|            pu1_buf += qp_size;
 1974|       |
 1975|  12.4k|            ps_codec->as_process[i].s_bs_ctxt.pu1_pic_qp_const_in_ctb = (UWORD8 *)pu1_buf;
 1976|  12.4k|            ps_codec->as_process[i].s_deblk_ctxt.s_bs_ctxt.pu1_pic_qp_const_in_ctb = (UWORD8 *)pu1_buf;
 1977|  12.4k|            ps_codec->s_parse.s_deblk_ctxt.s_bs_ctxt.pu1_pic_qp_const_in_ctb = (UWORD8 *)pu1_buf;
 1978|  12.4k|            pu1_buf += qp_const_flag_size;
 1979|       |
 1980|  12.4k|            pu1_buf -= (vert_bs_size + horz_bs_size + qp_size + qp_const_flag_size);
 1981|  12.4k|        }
 1982|  1.56k|        ps_codec->s_parse.s_bs_ctxt.pu4_pic_vert_bs = (UWORD32 *)pu1_buf;
 1983|  1.56k|        pu1_buf += vert_bs_size;
 1984|       |
 1985|  1.56k|        ps_codec->s_parse.s_bs_ctxt.pu4_pic_horz_bs = (UWORD32 *)pu1_buf;
 1986|  1.56k|        pu1_buf += horz_bs_size;
 1987|       |
 1988|  1.56k|        ps_codec->s_parse.s_bs_ctxt.pu1_pic_qp = (UWORD8 *)pu1_buf;
 1989|  1.56k|        pu1_buf += qp_size;
 1990|       |
 1991|  1.56k|        ps_codec->s_parse.s_bs_ctxt.pu1_pic_qp_const_in_ctb = (UWORD8 *)pu1_buf;
 1992|  1.56k|        pu1_buf += qp_const_flag_size;
 1993|       |
 1994|  1.56k|    }
 1995|       |
 1996|       |    /* Max CTBs in a row */
 1997|  1.56k|    size  = wd / MIN_CTB_SIZE;
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 1998|       |    /* Max CTBs in a column */
 1999|  1.56k|    size *= (ht / MIN_CTB_SIZE + 2) /* Top row and bottom row extra. This ensures accessing left,top in first row
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 2000|  1.56k|                                              and right in last row will not result in invalid access*/;
 2001|       |
 2002|  1.56k|    size *= sizeof(UWORD16);
 2003|  1.56k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2004|  1.56k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 2005|  1.56k|    memset(pv_buf, 0, size);
 2006|       |
 2007|  1.56k|    ps_codec->pu1_tile_idx_base = pv_buf;
 2008|  14.0k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2008:16): [True: 12.4k, False: 1.56k]
  ------------------
 2009|  12.4k|    {
 2010|  12.4k|        ps_codec->as_process[i].pu1_tile_idx = (UWORD16 *)pv_buf + wd / MIN_CTB_SIZE /* Offset 1 row */;
  ------------------
  |  |  342|  12.4k|#define MIN_CTB_SIZE        16
  ------------------
 2011|  12.4k|    }
 2012|       |
 2013|       |    /* 4 bytes per color component per CTB */
 2014|  1.56k|    size = 3 * 4;
 2015|       |
 2016|       |    /* MAX number of CTBs in a row */
 2017|  1.56k|    size *= wd / MIN_CTB_SIZE;
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 2018|       |
 2019|       |    /* MAX number of CTBs in a column */
 2020|  1.56k|    size *= ht / MIN_CTB_SIZE;
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
 2021|  1.56k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2022|  1.56k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 2023|  1.56k|    memset(pv_buf, 0, size);
 2024|       |
 2025|  1.56k|    ps_codec->s_parse.ps_pic_sao = (sao_t *)pv_buf;
 2026|  1.56k|    ps_codec->s_parse.s_sao_ctxt.ps_pic_sao = (sao_t *)pv_buf;
 2027|  14.0k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2027:16): [True: 12.4k, False: 1.56k]
  ------------------
 2028|  12.4k|    {
 2029|  12.4k|        ps_codec->as_process[i].s_sao_ctxt.ps_pic_sao = ps_codec->s_parse.ps_pic_sao;
 2030|  12.4k|    }
 2031|       |
 2032|       |    /* Only if width * height * 3 / 2 is greater than MIN_BITSBUF_SIZE,
 2033|       |    then allocate dynamic bistream buffer */
 2034|  1.56k|    ps_codec->pu1_bitsbuf_dynamic = NULL;
 2035|  1.56k|    size = wd * ht;
 2036|  1.56k|    if(size > MIN_BITSBUF_SIZE)
  ------------------
  |  |  188|  1.56k|#define MIN_BITSBUF_SIZE (1024 * 1024)
  ------------------
  |  Branch (2036:8): [True: 518, False: 1.04k]
  ------------------
 2037|    518|    {
 2038|    518|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size + 16); //Alloc extra for parse optimization
 2039|    518|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|    518|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 518]
  |  |  ------------------
  ------------------
 2040|    518|        memset(pv_buf, 0, size + 16);
 2041|    518|        ps_codec->pu1_bitsbuf_dynamic = pv_buf;
 2042|    518|        ps_codec->u4_bitsbuf_size_dynamic = size;
 2043|    518|    }
 2044|       |
 2045|  1.56k|    size = ihevcd_get_tu_data_size(wd * ht);
 2046|  1.56k|    pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2047|  1.56k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 2048|  1.56k|    memset(pv_buf, 0, size);
 2049|  1.56k|    ps_codec->pv_tu_data = pv_buf;
 2050|       |
 2051|       |    /* CU info map to store qp and CU type at 8x8 level */
 2052|  1.56k|    if(ps_codec->u1_enable_cu_info)
  ------------------
  |  Branch (2052:8): [True: 0, False: 1.56k]
  ------------------
 2053|      0|    {
 2054|      0|        size = ((wd * ht) / (MIN_CU_SIZE * MIN_CU_SIZE)) * BUF_MGR_MAX_CNT;
  ------------------
  |  |  363|      0|#define MIN_CU_SIZE         8
  ------------------
                      size = ((wd * ht) / (MIN_CU_SIZE * MIN_CU_SIZE)) * BUF_MGR_MAX_CNT;
  ------------------
  |  |  363|      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
  ------------------
 2055|       |
 2056|      0|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2057|      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]
  |  |  ------------------
  ------------------
 2058|      0|        memset(pv_buf, 0, size);
 2059|      0|        ps_codec->pu1_qp_map_base = pv_buf;
 2060|       |
 2061|      0|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2062|      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]
  |  |  ------------------
  ------------------
 2063|      0|        memset(pv_buf, 0, size);
 2064|      0|        ps_codec->pu1_cu_type_map_base = pv_buf;
 2065|      0|    }
 2066|       |
 2067|  1.56k|    {
 2068|  1.56k|        sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id);
 2069|       |
 2070|       |
 2071|       |        /* Allocate for pu_map, pu_t and pic_pu_idx for each MV bank */
 2072|       |        /* Note: Number of luma samples is not max_wd * max_ht here, instead it is
 2073|       |         * set to maximum number of luma samples allowed at the given level.
 2074|       |         * This is done to ensure that any stream with width and height lesser
 2075|       |         * than max_wd and max_ht is supported. Number of buffers required can be greater
 2076|       |         * for lower width and heights at a given level and this increased number of buffers
 2077|       |         * might require more memory than what max_wd and max_ht buffer would have required
 2078|       |         * Also note one extra buffer is allocted to store current pictures MV bank
 2079|       |         * In case of asynchronous parsing and processing, number of buffers should increase here
 2080|       |         * based on when parsing and processing threads are synchronized
 2081|       |         */
 2082|  1.56k|        max_dpb_size = ps_sps->ai1_sps_max_dec_pic_buffering[ps_sps->i1_sps_max_sub_layers - 1];
 2083|       |        /* Size for holding mv_buf_t for each MV Bank
 2084|       |         * One extra MV Bank is needed to hold current pics MV bank.
 2085|       |         */
 2086|  1.56k|        size = (max_dpb_size + 1) * sizeof(mv_buf_t);
 2087|       |
 2088|  1.56k|        size += (max_dpb_size + 1) *
 2089|  1.56k|                        ihevcd_get_pic_mv_bank_size(wd * ht);
 2090|       |
 2091|  1.56k|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2092|  1.56k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 2093|  1.56k|        memset(pv_buf, 0, size);
 2094|       |
 2095|  1.56k|        ps_codec->pv_mv_bank_buf_base = pv_buf;
 2096|  1.56k|        ps_codec->i4_total_mv_bank_size = size;
 2097|       |
 2098|  1.56k|    }
 2099|       |
 2100|       |    /* In case of non-shared mode allocate for reference picture buffers */
 2101|       |    /* In case of shared and 420p output, allocate for chroma samples */
 2102|  1.56k|    if(0 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (2102:8): [True: 1.56k, False: 0]
  ------------------
 2103|  1.56k|    {
 2104|       |        /* Number of buffers is doubled in order to return one frame at a time instead of sending
 2105|       |         * multiple outputs during dpb full case.
 2106|       |         * Also note one extra buffer is allocted to store current picture
 2107|       |         * In case of asynchronous parsing and processing, number of buffers should increase here
 2108|       |         * based on when parsing and processing threads are synchronized
 2109|       |         */
 2110|  1.56k|        size = ihevcd_get_total_pic_buf_size(ps_codec, wd, ht);
 2111|  1.56k|        pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2112|  1.56k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 2113|  1.56k|        memset(pv_buf, 0, size);
 2114|       |
 2115|  1.56k|        ps_codec->i4_total_pic_buf_size = size;
 2116|  1.56k|        ps_codec->pu1_ref_pic_buf_base = (UWORD8 *)pv_buf;
 2117|  1.56k|    }
 2118|       |
 2119|  1.56k|    ps_codec->pv_proc_jobq = ihevcd_jobq_init(ps_codec->pv_proc_jobq_buf, ps_codec->i4_proc_jobq_buf_size);
 2120|  1.56k|    RETURN_IF((ps_codec->pv_proc_jobq == NULL), IV_FAIL);
  ------------------
  |  |   37|  1.56k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.56k]
  |  |  ------------------
  ------------------
 2121|       |
 2122|       |    /* Update the jobq context to all the threads */
 2123|  1.56k|    ps_codec->s_parse.pv_proc_jobq = ps_codec->pv_proc_jobq;
 2124|  14.0k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  14.0k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  14.0k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (2124:16): [True: 12.4k, False: 1.56k]
  ------------------
 2125|  12.4k|    {
 2126|  12.4k|        ps_codec->as_process[i].pv_proc_jobq = ps_codec->pv_proc_jobq;
 2127|  12.4k|        ps_codec->as_process[i].i4_id = i;
 2128|  12.4k|        ps_codec->as_process[i].ps_codec = ps_codec;
 2129|       |
 2130|       |        /* Set the following to zero assuming it is a single core solution
 2131|       |         * When threads are launched these will be set appropriately
 2132|       |         */
 2133|  12.4k|        ps_codec->as_process[i].i4_check_parse_status = 0;
 2134|  12.4k|        ps_codec->as_process[i].i4_check_proc_status = 0;
 2135|  12.4k|    }
 2136|       |
 2137|  1.56k|    ps_codec->u4_allocate_dynamic_done = 1;
 2138|       |
 2139|  1.56k|    return IV_SUCCESS;
 2140|  1.56k|}
ihevcd_free_dynamic_bufs:
 2162|  2.42k|{
 2163|       |
 2164|  2.42k|    if(ps_codec->pv_proc_jobq)
  ------------------
  |  Branch (2164:8): [True: 1.56k, False: 860]
  ------------------
 2165|  1.56k|    {
 2166|  1.56k|        ihevcd_jobq_deinit(ps_codec->pv_proc_jobq);
 2167|  1.56k|        ps_codec->pv_proc_jobq = NULL;
 2168|  1.56k|    }
 2169|       |
 2170|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->ps_tile);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2171|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->pi4_entry_ofst);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2172|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->s_parse.pu4_skip_cu_top);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2173|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->s_parse.pu4_ct_depth_top);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2174|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_pic_intra_flag);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2175|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_pic_no_loop_filter_flag_base);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2176|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->pv_proc_jobq_buf);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2177|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_parse_map);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2178|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_proc_map);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2179|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->as_process[0].pu4_pic_pu_idx_left);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2180|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->as_process[0].s_sao_ctxt.pu1_sao_src_left_luma);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2181|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->as_process[0].s_bs_ctxt.pu4_pic_vert_bs);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2182|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_tile_idx_base);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2183|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->s_parse.ps_pic_sao);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2184|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_bitsbuf_dynamic);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 518, False: 1.90k]
  |  |  ------------------
  ------------------
 2185|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->pv_tu_data);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2186|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->pv_mv_bank_buf_base);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2187|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_ref_pic_buf_base);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 1.56k, False: 860]
  |  |  ------------------
  ------------------
 2188|  2.42k|    ALIGNED_FREE(ps_codec, ps_codec->pu1_cur_chroma_ref_buf);
  ------------------
  |  |   96|  2.42k|#define ALIGNED_FREE(ps_codec, y) \
  |  |   97|  2.42k|if(y) {ps_codec->pf_aligned_free(ps_codec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (97:4): [True: 0, False: 2.42k]
  |  |  ------------------
  ------------------
 2189|  2.42k|    if(ps_codec->u1_enable_cu_info)
  ------------------
  |  Branch (2189:8): [True: 0, False: 2.42k]
  ------------------
 2190|      0|    {
 2191|      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]
  |  |  ------------------
  ------------------
 2192|      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]
  |  |  ------------------
  ------------------
 2193|      0|    }
 2194|       |
 2195|  2.42k|    ps_codec->u4_allocate_dynamic_done = 0;
 2196|  2.42k|    return IV_SUCCESS;
 2197|  2.42k|}
ihevcd_create:
 2228|    797|{
 2229|    797|    ihevcd_cxa_create_ip_t *ps_create_ip;
 2230|    797|    ihevcd_cxa_create_op_t *ps_create_op;
 2231|       |
 2232|    797|    WORD32 ret;
 2233|    797|    codec_t *ps_codec;
 2234|    797|    ps_create_ip = (ihevcd_cxa_create_ip_t *)pv_api_ip;
 2235|    797|    ps_create_op = (ihevcd_cxa_create_op_t *)pv_api_op;
 2236|       |
 2237|    797|    ps_create_op->s_ivd_create_op_t.u4_error_code = 0;
 2238|    797|    ps_codec_obj = NULL;
 2239|    797|    ret = ihevcd_allocate_static_bufs(&ps_codec_obj, pv_api_ip, pv_api_op);
 2240|       |
 2241|       |    /* If allocation of some buffer fails, then free buffers allocated till then */
 2242|    797|    if(IV_FAIL == ret)
  ------------------
  |  Branch (2242:8): [True: 0, False: 797]
  ------------------
 2243|      0|    {
 2244|      0|        if(NULL != ps_codec_obj)
  ------------------
  |  Branch (2244:12): [True: 0, False: 0]
  ------------------
 2245|      0|        {
 2246|      0|            if(ps_codec_obj->pv_codec_handle)
  ------------------
  |  Branch (2246:16): [True: 0, False: 0]
  ------------------
 2247|      0|            {
 2248|      0|                ihevcd_free_static_bufs(ps_codec_obj);
 2249|      0|            }
 2250|      0|            else
 2251|      0|            {
 2252|      0|                void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 2253|      0|                void *pv_mem_ctxt;
 2254|       |
 2255|      0|                pf_aligned_free = ps_create_ip->s_ivd_create_ip_t.pf_aligned_free;
 2256|      0|                pv_mem_ctxt  = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 2257|      0|                pf_aligned_free(pv_mem_ctxt, ps_codec_obj);
 2258|      0|            }
 2259|      0|        }
 2260|      0|        ps_create_op->s_ivd_create_op_t.u4_error_code = IVD_MEM_ALLOC_FAILED;
 2261|      0|        ps_create_op->s_ivd_create_op_t.u4_error_code |= 1 << IVD_FATALERROR;
 2262|       |
 2263|      0|        return IV_FAIL;
 2264|      0|    }
 2265|    797|    ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle;
 2266|    797|    ret = ihevcd_init(ps_codec);
 2267|       |
 2268|    797|    TRACE_INIT(NULL);
 2269|    797|    STATS_INIT();
  ------------------
  |  |  137|    797|#define STATS_INIT()  ;
  ------------------
 2270|       |
 2271|    797|    return ret;
 2272|    797|}
ihevcd_delete:
 2299|    797|{
 2300|    797|    codec_t *ps_dec;
 2301|    797|    ihevcd_cxa_delete_ip_t *ps_ip = (ihevcd_cxa_delete_ip_t *)pv_api_ip;
 2302|    797|    ihevcd_cxa_delete_op_t *ps_op = (ihevcd_cxa_delete_op_t *)pv_api_op;
 2303|       |
 2304|    797|    ps_dec = (codec_t *)(ps_codec_obj->pv_codec_handle);
 2305|    797|    UNUSED(ps_ip);
  ------------------
  |  |   38|    797|#define UNUSED(x) ((void)(x))
  ------------------
 2306|    797|    ps_op->s_ivd_delete_op_t.u4_error_code = 0;
 2307|    797|    ihevcd_free_dynamic_bufs(ps_dec);
 2308|    797|    ihevcd_free_static_bufs(ps_codec_obj);
 2309|    797|    return IV_SUCCESS;
 2310|    797|}
ihevcd_set_params:
 2837|  1.59k|{
 2838|       |
 2839|  1.59k|    codec_t *ps_codec;
 2840|  1.59k|    WORD32 ret = IV_SUCCESS;
 2841|  1.59k|    WORD32 strd;
 2842|  1.59k|    ivd_ctl_set_config_ip_t *s_ctl_dynparams_ip =
 2843|  1.59k|                    (ivd_ctl_set_config_ip_t *)pv_api_ip;
 2844|  1.59k|    ivd_ctl_set_config_op_t *s_ctl_dynparams_op =
 2845|  1.59k|                    (ivd_ctl_set_config_op_t *)pv_api_op;
 2846|       |
 2847|  1.59k|    ps_codec = (codec_t *)(ps_codec_obj->pv_codec_handle);
 2848|       |
 2849|  1.59k|    s_ctl_dynparams_op->u4_error_code = 0;
 2850|       |
 2851|  1.59k|    ps_codec->e_pic_skip_mode = s_ctl_dynparams_ip->e_frm_skip_mode;
 2852|       |
 2853|  1.59k|    if(s_ctl_dynparams_ip->e_frm_skip_mode != IVD_SKIP_NONE)
  ------------------
  |  Branch (2853:8): [True: 0, False: 1.59k]
  ------------------
 2854|      0|    {
 2855|       |
 2856|      0|        if((s_ctl_dynparams_ip->e_frm_skip_mode != IVD_SKIP_P) &&
  ------------------
  |  Branch (2856:12): [True: 0, False: 0]
  ------------------
 2857|      0|           (s_ctl_dynparams_ip->e_frm_skip_mode != IVD_SKIP_B) &&
  ------------------
  |  Branch (2857:12): [True: 0, False: 0]
  ------------------
 2858|      0|           (s_ctl_dynparams_ip->e_frm_skip_mode != IVD_SKIP_PB))
  ------------------
  |  Branch (2858:12): [True: 0, False: 0]
  ------------------
 2859|      0|        {
 2860|      0|            s_ctl_dynparams_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 2861|      0|            ret = IV_FAIL;
 2862|      0|        }
 2863|      0|    }
 2864|       |
 2865|  1.59k|    strd = ps_codec->i4_disp_strd;
 2866|  1.59k|    if(1 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (2866:8): [True: 0, False: 1.59k]
  ------------------
 2867|      0|    {
 2868|      0|        strd = ps_codec->i4_strd;
 2869|      0|    }
 2870|       |
 2871|       |
 2872|  1.59k|    {
 2873|  1.59k|        if((WORD32)s_ctl_dynparams_ip->u4_disp_wd >= ps_codec->i4_disp_wd)
  ------------------
  |  Branch (2873:12): [True: 929, False: 665]
  ------------------
 2874|    929|        {
 2875|    929|            strd = s_ctl_dynparams_ip->u4_disp_wd;
 2876|    929|        }
 2877|    665|        else if(0 == ps_codec->i4_sps_done)
  ------------------
  |  Branch (2877:17): [True: 0, False: 665]
  ------------------
 2878|      0|        {
 2879|      0|            strd = s_ctl_dynparams_ip->u4_disp_wd;
 2880|      0|        }
 2881|    665|        else if(s_ctl_dynparams_ip->u4_disp_wd == 0)
  ------------------
  |  Branch (2881:17): [True: 665, False: 0]
  ------------------
 2882|    665|        {
 2883|    665|            strd = ps_codec->i4_disp_strd;
 2884|    665|        }
 2885|      0|        else
 2886|      0|        {
 2887|      0|            strd = 0;
 2888|      0|            s_ctl_dynparams_op->u4_error_code |= (1 << IVD_UNSUPPORTEDPARAM);
 2889|      0|            s_ctl_dynparams_op->u4_error_code |= IHEVCD_INVALID_DISP_STRD;
 2890|      0|            ret = IV_FAIL;
 2891|      0|        }
 2892|  1.59k|    }
 2893|       |
 2894|  1.59k|    ps_codec->i4_disp_strd = strd;
 2895|  1.59k|    if(1 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (2895:8): [True: 0, False: 1.59k]
  ------------------
 2896|      0|    {
 2897|      0|        ps_codec->i4_strd = strd;
 2898|      0|    }
 2899|       |
 2900|  1.59k|    if(s_ctl_dynparams_ip->e_vid_dec_mode == IVD_DECODE_FRAME)
  ------------------
  |  Branch (2900:8): [True: 797, False: 797]
  ------------------
 2901|    797|        ps_codec->i4_header_mode = 0;
 2902|    797|    else if(s_ctl_dynparams_ip->e_vid_dec_mode == IVD_DECODE_HEADER)
  ------------------
  |  Branch (2902:13): [True: 797, False: 0]
  ------------------
 2903|    797|        ps_codec->i4_header_mode = 1;
 2904|      0|    else
 2905|      0|    {
 2906|       |
 2907|      0|        s_ctl_dynparams_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 2908|      0|        ps_codec->i4_header_mode = 1;
 2909|      0|        ret = IV_FAIL;
 2910|      0|    }
 2911|       |
 2912|  1.59k|    ps_codec->e_frm_out_mode = IVD_DISPLAY_FRAME_OUT;
 2913|       |
 2914|  1.59k|    if((s_ctl_dynparams_ip->e_frm_out_mode != IVD_DECODE_FRAME_OUT) &&
  ------------------
  |  Branch (2914:8): [True: 1.59k, False: 0]
  ------------------
 2915|  1.59k|       (s_ctl_dynparams_ip->e_frm_out_mode != IVD_DISPLAY_FRAME_OUT))
  ------------------
  |  Branch (2915:8): [True: 0, False: 1.59k]
  ------------------
 2916|      0|    {
 2917|      0|        s_ctl_dynparams_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 2918|      0|        ret = IV_FAIL;
 2919|      0|    }
 2920|  1.59k|    ps_codec->e_frm_out_mode = s_ctl_dynparams_ip->e_frm_out_mode;
 2921|       |
 2922|  1.59k|    return ret;
 2923|       |
 2924|  1.59k|}
ihevcd_reset:
 2951|    826|{
 2952|    826|    codec_t *ps_codec;
 2953|    826|    ivd_ctl_reset_op_t *s_ctl_reset_op = (ivd_ctl_reset_op_t *)pv_api_op;
 2954|    826|    UNUSED(pv_api_ip);
  ------------------
  |  |   38|    826|#define UNUSED(x) ((void)(x))
  ------------------
 2955|    826|    ps_codec = (codec_t *)(ps_codec_obj->pv_codec_handle);
 2956|       |
 2957|    826|    if(ps_codec != NULL)
  ------------------
  |  Branch (2957:8): [True: 826, False: 0]
  ------------------
 2958|    826|    {
 2959|    826|        DEBUG("\nReset called \n");
  ------------------
  |  |   49|    826|#define DEBUG(...) {}
  ------------------
 2960|    826|        ihevcd_join_threads(ps_codec);
 2961|       |
 2962|    826|        ihevcd_init(ps_codec);
 2963|    826|    }
 2964|      0|    else
 2965|      0|    {
 2966|      0|        DEBUG("\nReset called without Initializing the decoder\n");
  ------------------
  |  |   49|      0|#define DEBUG(...) {}
  ------------------
 2967|      0|        s_ctl_reset_op->u4_error_code = IHEVCD_INIT_NOT_DONE;
 2968|      0|    }
 2969|       |
 2970|    826|    return IV_SUCCESS;
 2971|    826|}
ihevcd_set_processor:
 3445|    797|{
 3446|    797|    ihevcd_cxa_ctl_set_processor_ip_t *ps_ip;
 3447|    797|    ihevcd_cxa_ctl_set_processor_op_t *ps_op;
 3448|    797|    codec_t *ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle;
 3449|       |
 3450|    797|    ps_ip = (ihevcd_cxa_ctl_set_processor_ip_t *)pv_api_ip;
 3451|    797|    ps_op = (ihevcd_cxa_ctl_set_processor_op_t *)pv_api_op;
 3452|       |
 3453|    797|    ps_codec->e_processor_arch = (IVD_ARCH_T)ps_ip->u4_arch;
 3454|    797|    ps_codec->e_processor_soc = (IVD_SOC_T)ps_ip->u4_soc;
 3455|       |
 3456|    797|    ihevcd_init_function_ptr(ps_codec);
 3457|       |
 3458|    797|    ihevcd_update_function_ptr(ps_codec);
 3459|       |
 3460|    797|    if(ps_codec->e_processor_soc && (ps_codec->e_processor_soc <= SOC_HISI_37X))
  ------------------
  |  Branch (3460:8): [True: 0, False: 797]
  |  Branch (3460:37): [True: 0, False: 0]
  ------------------
 3461|      0|    {
 3462|       |        /* 8th bit indicates if format conversion is to be done ahead */
 3463|      0|        if(ps_codec->e_processor_soc & 0x80)
  ------------------
  |  Branch (3463:12): [True: 0, False: 0]
  ------------------
 3464|      0|            ps_codec->u4_enable_fmt_conv_ahead = 1;
 3465|       |
 3466|       |        /* Lower 7 bit indicate NCTB - if non-zero */
 3467|      0|        ps_codec->e_processor_soc &= 0x7F;
 3468|       |
 3469|      0|        if(ps_codec->e_processor_soc)
  ------------------
  |  Branch (3469:12): [True: 0, False: 0]
  ------------------
 3470|      0|            ps_codec->u4_nctb = ps_codec->e_processor_soc;
 3471|       |
 3472|       |
 3473|      0|    }
 3474|       |
 3475|    797|    if((ps_codec->e_processor_soc == SOC_HISI_37X) && (ps_codec->i4_num_cores == 2))
  ------------------
  |  Branch (3475:8): [True: 0, False: 797]
  |  Branch (3475:55): [True: 0, False: 0]
  ------------------
 3476|      0|    {
 3477|      0|        ps_codec->u4_nctb = 2;
 3478|      0|    }
 3479|       |
 3480|       |
 3481|    797|    ps_op->u4_error_code = 0;
 3482|    797|    return IV_SUCCESS;
 3483|    797|}
ihevcd_set_num_cores:
 3515|    797|{
 3516|    797|    ihevcd_cxa_ctl_set_num_cores_ip_t *ps_ip;
 3517|    797|    ihevcd_cxa_ctl_set_num_cores_op_t *ps_op;
 3518|    797|    codec_t *ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle;
 3519|       |
 3520|    797|    ps_ip = (ihevcd_cxa_ctl_set_num_cores_ip_t *)pv_api_ip;
 3521|    797|    ps_op = (ihevcd_cxa_ctl_set_num_cores_op_t *)pv_api_op;
 3522|       |
 3523|    797|    ps_codec->i4_num_cores = ps_ip->u4_num_cores;
 3524|    797|    ps_op->u4_error_code = 0;
 3525|    797|    return IV_SUCCESS;
 3526|    797|}
ihevcd_ctl:
 3555|  4.01k|{
 3556|  4.01k|    ivd_ctl_set_config_ip_t *ps_ctl_ip;
 3557|  4.01k|    ivd_ctl_set_config_op_t *ps_ctl_op;
 3558|  4.01k|    WORD32 ret = 0;
 3559|  4.01k|    WORD32 subcommand;
 3560|  4.01k|    codec_t *ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle;
 3561|       |
 3562|  4.01k|    ps_ctl_ip = (ivd_ctl_set_config_ip_t *)pv_api_ip;
 3563|  4.01k|    ps_ctl_op = (ivd_ctl_set_config_op_t *)pv_api_op;
 3564|       |
 3565|  4.01k|    if(ps_codec->i4_init_done != 1)
  ------------------
  |  Branch (3565:8): [True: 0, False: 4.01k]
  ------------------
 3566|      0|    {
 3567|      0|        ps_ctl_op->u4_error_code |= 1 << IVD_FATALERROR;
 3568|      0|        ps_ctl_op->u4_error_code |= IHEVCD_INIT_NOT_DONE;
 3569|      0|        return IV_FAIL;
 3570|      0|    }
 3571|  4.01k|    subcommand = ps_ctl_ip->e_sub_cmd;
 3572|       |
 3573|  4.01k|    switch(subcommand)
 3574|  4.01k|    {
 3575|      0|        case IVD_CMD_CTL_GETPARAMS:
  ------------------
  |  Branch (3575:9): [True: 0, False: 4.01k]
  ------------------
 3576|      0|            ret = ihevcd_get_status(ps_codec_obj, (void *)pv_api_ip,
 3577|      0|                                    (void *)pv_api_op);
 3578|      0|            break;
 3579|  1.59k|        case IVD_CMD_CTL_SETPARAMS:
  ------------------
  |  Branch (3579:9): [True: 1.59k, False: 2.42k]
  ------------------
 3580|  1.59k|            ret = ihevcd_set_params(ps_codec_obj, (void *)pv_api_ip,
 3581|  1.59k|                                    (void *)pv_api_op);
 3582|  1.59k|            break;
 3583|    826|        case IVD_CMD_CTL_RESET:
  ------------------
  |  Branch (3583:9): [True: 826, False: 3.18k]
  ------------------
 3584|    826|            ret = ihevcd_reset(ps_codec_obj, (void *)pv_api_ip,
 3585|    826|                               (void *)pv_api_op);
 3586|    826|            break;
 3587|      0|        case IVD_CMD_CTL_SETDEFAULT:
  ------------------
  |  Branch (3587:9): [True: 0, False: 4.01k]
  ------------------
 3588|      0|        {
 3589|      0|            ivd_ctl_set_config_op_t *s_ctl_dynparams_op =
 3590|      0|                            (ivd_ctl_set_config_op_t *)pv_api_op;
 3591|       |
 3592|      0|            ret = ihevcd_set_default_params(ps_codec);
 3593|      0|            if(IV_SUCCESS == ret)
  ------------------
  |  Branch (3593:16): [True: 0, False: 0]
  ------------------
 3594|      0|                s_ctl_dynparams_op->u4_error_code = 0;
 3595|      0|            break;
 3596|      0|        }
 3597|      0|        case IVD_CMD_CTL_FLUSH:
  ------------------
  |  Branch (3597:9): [True: 0, False: 4.01k]
  ------------------
 3598|      0|            ret = ihevcd_set_flush_mode(ps_codec_obj, (void *)pv_api_ip,
 3599|      0|                                        (void *)pv_api_op);
 3600|      0|            break;
 3601|      0|        case IVD_CMD_CTL_GETBUFINFO:
  ------------------
  |  Branch (3601:9): [True: 0, False: 4.01k]
  ------------------
 3602|      0|            ret = ihevcd_get_buf_info(ps_codec_obj, (void *)pv_api_ip,
 3603|      0|                                      (void *)pv_api_op);
 3604|      0|            break;
 3605|      0|        case IVD_CMD_CTL_GETVERSION:
  ------------------
  |  Branch (3605:9): [True: 0, False: 4.01k]
  ------------------
 3606|      0|        {
 3607|      0|            ivd_ctl_getversioninfo_ip_t *ps_ip;
 3608|      0|            ivd_ctl_getversioninfo_op_t *ps_op;
 3609|      0|            IV_API_CALL_STATUS_T ret;
 3610|      0|            ps_ip = (ivd_ctl_getversioninfo_ip_t *)pv_api_ip;
 3611|      0|            ps_op = (ivd_ctl_getversioninfo_op_t *)pv_api_op;
 3612|       |
 3613|      0|            ps_op->u4_error_code = IV_SUCCESS;
 3614|       |
 3615|      0|            if((WORD32)ps_ip->u4_version_buffer_size <= 0)
  ------------------
  |  Branch (3615:16): [True: 0, False: 0]
  ------------------
 3616|      0|            {
 3617|      0|                ps_op->u4_error_code = IHEVCD_CXA_VERS_BUF_INSUFFICIENT;
 3618|      0|                ret = IV_FAIL;
 3619|      0|            }
 3620|      0|            else
 3621|      0|            {
 3622|      0|                ret = ihevcd_get_version((CHAR *)ps_ip->pv_version_buffer,
 3623|      0|                                         ps_ip->u4_version_buffer_size);
 3624|      0|                if(ret != IV_SUCCESS)
  ------------------
  |  Branch (3624:20): [True: 0, False: 0]
  ------------------
 3625|      0|                {
 3626|      0|                    ps_op->u4_error_code = IHEVCD_CXA_VERS_BUF_INSUFFICIENT;
 3627|      0|                    ret = IV_FAIL;
 3628|      0|                }
 3629|      0|            }
 3630|      0|        }
 3631|      0|            break;
 3632|      0|        case IHEVCD_CXA_CMD_CTL_DEGRADE:
  ------------------
  |  Branch (3632:9): [True: 0, False: 4.01k]
  ------------------
 3633|      0|            ret = ihevcd_set_degrade(ps_codec_obj, (void *)pv_api_ip,
 3634|      0|                            (void *)pv_api_op);
 3635|      0|            break;
 3636|    797|        case IHEVCD_CXA_CMD_CTL_SET_NUM_CORES:
  ------------------
  |  Branch (3636:9): [True: 797, False: 3.21k]
  ------------------
 3637|    797|            ret = ihevcd_set_num_cores(ps_codec_obj, (void *)pv_api_ip,
 3638|    797|                                       (void *)pv_api_op);
 3639|    797|            break;
 3640|      0|        case IHEVCD_CXA_CMD_CTL_GET_BUFFER_DIMENSIONS:
  ------------------
  |  Branch (3640:9): [True: 0, False: 4.01k]
  ------------------
 3641|      0|            ret = ihevcd_get_frame_dimensions(ps_codec_obj, (void *)pv_api_ip,
 3642|      0|                                              (void *)pv_api_op);
 3643|      0|            break;
 3644|      0|        case IHEVCD_CXA_CMD_CTL_GET_VUI_PARAMS:
  ------------------
  |  Branch (3644:9): [True: 0, False: 4.01k]
  ------------------
 3645|      0|            ret = ihevcd_get_vui_params(ps_codec_obj, (void *)pv_api_ip,
 3646|      0|                                        (void *)pv_api_op);
 3647|      0|            break;
 3648|      0|        case IHEVCD_CXA_CMD_CTL_GET_SEI_MASTERING_PARAMS:
  ------------------
  |  Branch (3648:9): [True: 0, False: 4.01k]
  ------------------
 3649|      0|            ret = ihevcd_get_sei_mastering_params(ps_codec_obj, (void *)pv_api_ip,
 3650|      0|                                        (void *)pv_api_op);
 3651|      0|            break;
 3652|    797|        case IHEVCD_CXA_CMD_CTL_SET_PROCESSOR:
  ------------------
  |  Branch (3652:9): [True: 797, False: 3.21k]
  ------------------
 3653|    797|            ret = ihevcd_set_processor(ps_codec_obj, (void *)pv_api_ip,
 3654|    797|                            (void *)pv_api_op);
 3655|    797|            break;
 3656|      0|        default:
  ------------------
  |  Branch (3656:9): [True: 0, False: 4.01k]
  ------------------
 3657|      0|            DEBUG("\nDo nothing\n");
  ------------------
  |  |   49|      0|#define DEBUG(...) {}
  ------------------
 3658|      0|            break;
 3659|  4.01k|    }
 3660|       |
 3661|  4.01k|    return ret;
 3662|  4.01k|}
ihevcd_cxa_api_function:
 3694|  55.4k|{
 3695|  55.4k|    WORD32 command;
 3696|  55.4k|    UWORD32 *pu4_ptr_cmd;
 3697|  55.4k|    WORD32 ret = 0;
 3698|  55.4k|    IV_API_CALL_STATUS_T e_status;
 3699|  55.4k|    e_status = api_check_struct_sanity(ps_handle, pv_api_ip, pv_api_op);
 3700|       |
 3701|  55.4k|    if(e_status != IV_SUCCESS)
  ------------------
  |  Branch (3701:8): [True: 0, False: 55.4k]
  ------------------
 3702|      0|    {
 3703|      0|        DEBUG("error code = %d\n", *((UWORD32 *)pv_api_op + 1));
  ------------------
  |  |   49|      0|#define DEBUG(...) {}
  ------------------
 3704|      0|        return IV_FAIL;
 3705|      0|    }
 3706|       |
 3707|  55.4k|    pu4_ptr_cmd = (UWORD32 *)pv_api_ip;
 3708|  55.4k|    pu4_ptr_cmd++;
 3709|       |
 3710|  55.4k|    command = *pu4_ptr_cmd;
 3711|       |
 3712|  55.4k|    switch(command)
 3713|  55.4k|    {
 3714|    797|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (3714:9): [True: 797, False: 54.6k]
  ------------------
 3715|    797|            ret = ihevcd_create(ps_handle, (void *)pv_api_ip, (void *)pv_api_op);
 3716|    797|            break;
 3717|    797|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (3717:9): [True: 797, False: 54.6k]
  ------------------
 3718|    797|            ret = ihevcd_delete(ps_handle, (void *)pv_api_ip, (void *)pv_api_op);
 3719|    797|            break;
 3720|       |
 3721|  49.8k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (3721:9): [True: 49.8k, False: 5.60k]
  ------------------
 3722|  49.8k|            ret = ihevcd_decode(ps_handle, (void *)pv_api_ip, (void *)pv_api_op);
 3723|  49.8k|            break;
 3724|       |
 3725|      0|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (3725:9): [True: 0, False: 55.4k]
  ------------------
 3726|       |            //ret = ihevcd_get_display_frame(ps_handle,(void *)pv_api_ip,(void *)pv_api_op);
 3727|      0|            break;
 3728|       |
 3729|      0|        case IVD_CMD_SET_DISPLAY_FRAME:
  ------------------
  |  Branch (3729:9): [True: 0, False: 55.4k]
  ------------------
 3730|      0|            ret = ihevcd_set_display_frame(ps_handle, (void *)pv_api_ip,
 3731|      0|                                           (void *)pv_api_op);
 3732|       |
 3733|      0|            break;
 3734|       |
 3735|      0|        case IVD_CMD_REL_DISPLAY_FRAME:
  ------------------
  |  Branch (3735:9): [True: 0, False: 55.4k]
  ------------------
 3736|      0|            ret = ihevcd_rel_display_frame(ps_handle, (void *)pv_api_ip,
 3737|      0|                                           (void *)pv_api_op);
 3738|      0|            break;
 3739|       |
 3740|  4.01k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (3740:9): [True: 4.01k, False: 51.4k]
  ------------------
 3741|  4.01k|            ret = ihevcd_ctl(ps_handle, (void *)pv_api_ip, (void *)pv_api_op);
 3742|  4.01k|            break;
 3743|      0|        default:
  ------------------
  |  Branch (3743:9): [True: 0, False: 55.4k]
  ------------------
 3744|      0|            ret = IV_FAIL;
 3745|      0|            break;
 3746|  55.4k|    }
 3747|       |
 3748|  55.4k|    return (IV_API_CALL_STATUS_T)ret;
 3749|  55.4k|}
ihevcd_api.c:api_check_struct_sanity:
  136|  55.4k|{
  137|  55.4k|    IVD_API_COMMAND_TYPE_T e_cmd;
  138|  55.4k|    UWORD32 *pu4_api_ip;
  139|  55.4k|    UWORD32 *pu4_api_op;
  140|  55.4k|    WORD32 i;
  141|       |
  142|  55.4k|    if(NULL == pv_api_op)
  ------------------
  |  Branch (142:8): [True: 0, False: 55.4k]
  ------------------
  143|      0|        return (IV_FAIL);
  144|       |
  145|  55.4k|    if(NULL == pv_api_ip)
  ------------------
  |  Branch (145:8): [True: 0, False: 55.4k]
  ------------------
  146|      0|        return (IV_FAIL);
  147|       |
  148|  55.4k|    pu4_api_ip = (UWORD32 *)pv_api_ip;
  149|  55.4k|    pu4_api_op = (UWORD32 *)pv_api_op;
  150|  55.4k|    e_cmd = (IVD_API_COMMAND_TYPE_T)*(pu4_api_ip + 1);
  151|       |
  152|  55.4k|    *(pu4_api_op + 1) = 0;
  153|       |    /* error checks on handle */
  154|  55.4k|    switch((WORD32)e_cmd)
  155|  55.4k|    {
  156|    797|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (156:9): [True: 797, False: 54.6k]
  ------------------
  157|    797|            break;
  158|       |
  159|      0|        case IVD_CMD_REL_DISPLAY_FRAME:
  ------------------
  |  Branch (159:9): [True: 0, False: 55.4k]
  ------------------
  160|      0|        case IVD_CMD_SET_DISPLAY_FRAME:
  ------------------
  |  Branch (160:9): [True: 0, False: 55.4k]
  ------------------
  161|      0|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (161:9): [True: 0, False: 55.4k]
  ------------------
  162|  49.8k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (162:9): [True: 49.8k, False: 5.60k]
  ------------------
  163|  50.6k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (163:9): [True: 797, False: 54.6k]
  ------------------
  164|  54.6k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (164:9): [True: 4.01k, False: 51.4k]
  ------------------
  165|  54.6k|            if(ps_handle == NULL)
  ------------------
  |  Branch (165:16): [True: 0, False: 54.6k]
  ------------------
  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|  54.6k|            if(ps_handle->u4_size != sizeof(iv_obj_t))
  ------------------
  |  Branch (172:16): [True: 0, False: 54.6k]
  ------------------
  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|  54.6k|            if(ps_handle->pv_codec_handle == NULL)
  ------------------
  |  Branch (180:16): [True: 0, False: 54.6k]
  ------------------
  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|  54.6k|            break;
  187|  54.6k|        default:
  ------------------
  |  Branch (187:9): [True: 0, False: 55.4k]
  ------------------
  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|  55.4k|    }
  192|       |
  193|  55.4k|    switch((WORD32)e_cmd)
  194|  55.4k|    {
  195|    797|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (195:9): [True: 797, False: 54.6k]
  ------------------
  196|    797|        {
  197|    797|            ihevcd_cxa_create_ip_t *ps_ip = (ihevcd_cxa_create_ip_t *)pv_api_ip;
  198|    797|            ihevcd_cxa_create_op_t *ps_op = (ihevcd_cxa_create_op_t *)pv_api_op;
  199|       |
  200|       |
  201|    797|            ps_op->s_ivd_create_op_t.u4_error_code = 0;
  202|       |
  203|    797|            if((ps_ip->s_ivd_create_ip_t.u4_size > sizeof(ihevcd_cxa_create_ip_t))
  ------------------
  |  Branch (203:16): [True: 0, False: 797]
  ------------------
  204|    797|                            || (ps_ip->s_ivd_create_ip_t.u4_size
  ------------------
  |  Branch (204:32): [True: 0, False: 797]
  ------------------
  205|    797|                                            < 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|    797|            if((ps_op->s_ivd_create_op_t.u4_size != sizeof(ihevcd_cxa_create_op_t))
  ------------------
  |  Branch (215:16): [True: 0, False: 797]
  ------------------
  216|    797|                            && (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|    797|            if((ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420P)
  ------------------
  |  Branch (228:16): [True: 516, False: 281]
  ------------------
  229|    797|                            && (ps_ip->s_ivd_create_ip_t.e_output_format
  ------------------
  |  Branch (229:32): [True: 438, False: 78]
  ------------------
  230|    516|                                            != IV_YUV_422ILE)
  231|    797|                            && (ps_ip->s_ivd_create_ip_t.e_output_format
  ------------------
  |  Branch (231:32): [True: 393, False: 45]
  ------------------
  232|    438|                                            != IV_RGB_565)
  233|    797|                            && (ps_ip->s_ivd_create_ip_t.e_output_format
  ------------------
  |  Branch (233:32): [True: 301, False: 92]
  ------------------
  234|    393|                                            != IV_YUV_420SP_UV)
  235|    797|                            && (ps_ip->s_ivd_create_ip_t.e_output_format
  ------------------
  |  Branch (235:32): [True: 0, False: 301]
  ------------------
  236|    301|                                            != IV_YUV_420SP_VU))
  237|      0|            {
  238|      0|                ps_op->s_ivd_create_op_t.u4_error_code |= 1
  239|      0|                                << IVD_UNSUPPORTEDPARAM;
  240|      0|                ps_op->s_ivd_create_op_t.u4_error_code |=
  241|      0|                                IVD_INIT_DEC_COL_FMT_NOT_SUPPORTED;
  242|       |
  243|      0|                return (IV_FAIL);
  244|      0|            }
  245|       |
  246|    797|        }
  247|    797|            break;
  248|       |
  249|    797|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (249:9): [True: 0, False: 55.4k]
  ------------------
  250|      0|        {
  251|      0|            ihevcd_cxa_get_display_frame_ip_t *ps_ip =
  252|      0|                            (ihevcd_cxa_get_display_frame_ip_t *)pv_api_ip;
  253|      0|            ihevcd_cxa_get_display_frame_op_t *ps_op =
  254|      0|                            (ihevcd_cxa_get_display_frame_op_t *)pv_api_op;
  255|       |
  256|      0|            ps_op->s_ivd_get_display_frame_op_t.u4_error_code = 0;
  257|       |
  258|      0|            if((ps_ip->s_ivd_get_display_frame_ip_t.u4_size
  ------------------
  |  Branch (258:16): [True: 0, False: 0]
  ------------------
  259|      0|                            != sizeof(ihevcd_cxa_get_display_frame_ip_t))
  260|      0|                            && (ps_ip->s_ivd_get_display_frame_ip_t.u4_size
  ------------------
  |  Branch (260:32): [True: 0, False: 0]
  ------------------
  261|      0|                                            != sizeof(ivd_get_display_frame_ip_t)))
  262|      0|            {
  263|      0|                ps_op->s_ivd_get_display_frame_op_t.u4_error_code |= 1
  264|      0|                                << IVD_UNSUPPORTEDPARAM;
  265|      0|                ps_op->s_ivd_get_display_frame_op_t.u4_error_code |=
  266|      0|                                IVD_IP_API_STRUCT_SIZE_INCORRECT;
  267|      0|                return (IV_FAIL);
  268|      0|            }
  269|       |
  270|      0|            if((ps_op->s_ivd_get_display_frame_op_t.u4_size
  ------------------
  |  Branch (270:16): [True: 0, False: 0]
  ------------------
  271|      0|                            != sizeof(ihevcd_cxa_get_display_frame_op_t))
  272|      0|                            && (ps_op->s_ivd_get_display_frame_op_t.u4_size
  ------------------
  |  Branch (272:32): [True: 0, False: 0]
  ------------------
  273|      0|                                            != sizeof(ivd_get_display_frame_op_t)))
  274|      0|            {
  275|      0|                ps_op->s_ivd_get_display_frame_op_t.u4_error_code |= 1
  276|      0|                                << IVD_UNSUPPORTEDPARAM;
  277|      0|                ps_op->s_ivd_get_display_frame_op_t.u4_error_code |=
  278|      0|                                IVD_OP_API_STRUCT_SIZE_INCORRECT;
  279|      0|                return (IV_FAIL);
  280|      0|            }
  281|       |
  282|      0|        }
  283|      0|            break;
  284|       |
  285|      0|        case IVD_CMD_REL_DISPLAY_FRAME:
  ------------------
  |  Branch (285:9): [True: 0, False: 55.4k]
  ------------------
  286|      0|        {
  287|      0|            ihevcd_cxa_rel_display_frame_ip_t *ps_ip =
  288|      0|                            (ihevcd_cxa_rel_display_frame_ip_t *)pv_api_ip;
  289|      0|            ihevcd_cxa_rel_display_frame_op_t *ps_op =
  290|      0|                            (ihevcd_cxa_rel_display_frame_op_t *)pv_api_op;
  291|       |
  292|      0|            ps_op->s_ivd_rel_display_frame_op_t.u4_error_code = 0;
  293|       |
  294|      0|            if((ps_ip->s_ivd_rel_display_frame_ip_t.u4_size
  ------------------
  |  Branch (294:16): [True: 0, False: 0]
  ------------------
  295|      0|                            != sizeof(ihevcd_cxa_rel_display_frame_ip_t))
  296|      0|                            && (ps_ip->s_ivd_rel_display_frame_ip_t.u4_size
  ------------------
  |  Branch (296:32): [True: 0, False: 0]
  ------------------
  297|      0|                                            != sizeof(ivd_rel_display_frame_ip_t)))
  298|      0|            {
  299|      0|                ps_op->s_ivd_rel_display_frame_op_t.u4_error_code |= 1
  300|      0|                                << IVD_UNSUPPORTEDPARAM;
  301|      0|                ps_op->s_ivd_rel_display_frame_op_t.u4_error_code |=
  302|      0|                                IVD_IP_API_STRUCT_SIZE_INCORRECT;
  303|      0|                return (IV_FAIL);
  304|      0|            }
  305|       |
  306|      0|            if((ps_op->s_ivd_rel_display_frame_op_t.u4_size
  ------------------
  |  Branch (306:16): [True: 0, False: 0]
  ------------------
  307|      0|                            != sizeof(ihevcd_cxa_rel_display_frame_op_t))
  308|      0|                            && (ps_op->s_ivd_rel_display_frame_op_t.u4_size
  ------------------
  |  Branch (308:32): [True: 0, False: 0]
  ------------------
  309|      0|                                            != sizeof(ivd_rel_display_frame_op_t)))
  310|      0|            {
  311|      0|                ps_op->s_ivd_rel_display_frame_op_t.u4_error_code |= 1
  312|      0|                                << IVD_UNSUPPORTEDPARAM;
  313|      0|                ps_op->s_ivd_rel_display_frame_op_t.u4_error_code |=
  314|      0|                                IVD_OP_API_STRUCT_SIZE_INCORRECT;
  315|      0|                return (IV_FAIL);
  316|      0|            }
  317|       |
  318|      0|        }
  319|      0|            break;
  320|       |
  321|      0|        case IVD_CMD_SET_DISPLAY_FRAME:
  ------------------
  |  Branch (321:9): [True: 0, False: 55.4k]
  ------------------
  322|      0|        {
  323|      0|            ihevcd_cxa_set_display_frame_ip_t *ps_ip =
  324|      0|                            (ihevcd_cxa_set_display_frame_ip_t *)pv_api_ip;
  325|      0|            ihevcd_cxa_set_display_frame_op_t *ps_op =
  326|      0|                            (ihevcd_cxa_set_display_frame_op_t *)pv_api_op;
  327|      0|            UWORD32 j;
  328|       |
  329|      0|            ps_op->s_ivd_set_display_frame_op_t.u4_error_code = 0;
  330|       |
  331|      0|            if((ps_ip->s_ivd_set_display_frame_ip_t.u4_size
  ------------------
  |  Branch (331:16): [True: 0, False: 0]
  ------------------
  332|      0|                            != sizeof(ihevcd_cxa_set_display_frame_ip_t))
  333|      0|                            && (ps_ip->s_ivd_set_display_frame_ip_t.u4_size
  ------------------
  |  Branch (333:32): [True: 0, False: 0]
  ------------------
  334|      0|                                            != sizeof(ivd_set_display_frame_ip_t)))
  335|      0|            {
  336|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= 1
  337|      0|                                << IVD_UNSUPPORTEDPARAM;
  338|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  339|      0|                                IVD_IP_API_STRUCT_SIZE_INCORRECT;
  340|      0|                return (IV_FAIL);
  341|      0|            }
  342|       |
  343|      0|            if((ps_op->s_ivd_set_display_frame_op_t.u4_size
  ------------------
  |  Branch (343:16): [True: 0, False: 0]
  ------------------
  344|      0|                            != sizeof(ihevcd_cxa_set_display_frame_op_t))
  345|      0|                            && (ps_op->s_ivd_set_display_frame_op_t.u4_size
  ------------------
  |  Branch (345:32): [True: 0, False: 0]
  ------------------
  346|      0|                                            != sizeof(ivd_set_display_frame_op_t)))
  347|      0|            {
  348|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= 1
  349|      0|                                << IVD_UNSUPPORTEDPARAM;
  350|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  351|      0|                                IVD_OP_API_STRUCT_SIZE_INCORRECT;
  352|      0|                return (IV_FAIL);
  353|      0|            }
  354|       |
  355|      0|            if(ps_ip->s_ivd_set_display_frame_ip_t.num_disp_bufs == 0)
  ------------------
  |  Branch (355:16): [True: 0, False: 0]
  ------------------
  356|      0|            {
  357|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= 1
  358|      0|                                << IVD_UNSUPPORTEDPARAM;
  359|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  360|      0|                                IVD_DISP_FRM_ZERO_OP_BUFS;
  361|      0|                return IV_FAIL;
  362|      0|            }
  363|       |
  364|      0|            for(j = 0; j < ps_ip->s_ivd_set_display_frame_ip_t.num_disp_bufs;
  ------------------
  |  Branch (364:24): [True: 0, False: 0]
  ------------------
  365|      0|                            j++)
  366|      0|            {
  367|      0|                if(ps_ip->s_ivd_set_display_frame_ip_t.s_disp_buffer[j].u4_num_bufs
  ------------------
  |  Branch (367:20): [True: 0, False: 0]
  ------------------
  368|      0|                                == 0)
  369|      0|                {
  370|      0|                    ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= 1
  371|      0|                                    << IVD_UNSUPPORTEDPARAM;
  372|      0|                    ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  373|      0|                                    IVD_DISP_FRM_ZERO_OP_BUFS;
  374|      0|                    return IV_FAIL;
  375|      0|                }
  376|       |
  377|      0|                for(i = 0;
  378|      0|                                i
  ------------------
  |  Branch (378:33): [True: 0, False: 0]
  ------------------
  379|      0|                                                < (WORD32)ps_ip->s_ivd_set_display_frame_ip_t.s_disp_buffer[j].u4_num_bufs;
  380|      0|                                i++)
  381|      0|                {
  382|      0|                    if(ps_ip->s_ivd_set_display_frame_ip_t.s_disp_buffer[j].pu1_bufs[i]
  ------------------
  |  Branch (382:24): [True: 0, False: 0]
  ------------------
  383|      0|                                    == NULL)
  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_OP_BUF_NULL;
  389|      0|                        return IV_FAIL;
  390|      0|                    }
  391|       |
  392|      0|                    if(ps_ip->s_ivd_set_display_frame_ip_t.s_disp_buffer[j].u4_min_out_buf_size[i]
  ------------------
  |  Branch (392:24): [True: 0, False: 0]
  ------------------
  393|      0|                                    == 0)
  394|      0|                    {
  395|      0|                        ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= 1
  396|      0|                                        << IVD_UNSUPPORTEDPARAM;
  397|      0|                        ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  398|      0|                                        IVD_DISP_FRM_ZERO_OP_BUF_SIZE;
  399|      0|                        return IV_FAIL;
  400|      0|                    }
  401|      0|                }
  402|      0|            }
  403|      0|        }
  404|      0|            break;
  405|       |
  406|  49.8k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (406:9): [True: 49.8k, False: 5.60k]
  ------------------
  407|  49.8k|        {
  408|  49.8k|            ihevcd_cxa_video_decode_ip_t *ps_ip =
  409|  49.8k|                            (ihevcd_cxa_video_decode_ip_t *)pv_api_ip;
  410|  49.8k|            ihevcd_cxa_video_decode_op_t *ps_op =
  411|  49.8k|                            (ihevcd_cxa_video_decode_op_t *)pv_api_op;
  412|       |
  413|  49.8k|            DEBUG("The input bytes is: %d",
  ------------------
  |  |   49|  49.8k|#define DEBUG(...) {}
  ------------------
  414|  49.8k|                            ps_ip->s_ivd_video_decode_ip_t.u4_num_Bytes);
  415|  49.8k|            ps_op->s_ivd_video_decode_op_t.u4_error_code = 0;
  416|       |
  417|  49.8k|            if(ps_ip->s_ivd_video_decode_ip_t.u4_size
  ------------------
  |  Branch (417:16): [True: 49.8k, False: 0]
  ------------------
  418|  49.8k|                            != sizeof(ihevcd_cxa_video_decode_ip_t)
  419|  49.8k|                            && ps_ip->s_ivd_video_decode_ip_t.u4_size
  ------------------
  |  Branch (419:32): [True: 0, False: 49.8k]
  ------------------
  420|  49.8k|                                            != sizeof(ivd_video_decode_ip_t))
  421|      0|            {
  422|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |= 1
  423|      0|                                << IVD_UNSUPPORTEDPARAM;
  424|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |=
  425|      0|                                IVD_IP_API_STRUCT_SIZE_INCORRECT;
  426|      0|                return (IV_FAIL);
  427|      0|            }
  428|       |
  429|  49.8k|            if(ps_op->s_ivd_video_decode_op_t.u4_size
  ------------------
  |  Branch (429:16): [True: 49.8k, False: 0]
  ------------------
  430|  49.8k|                            != sizeof(ihevcd_cxa_video_decode_op_t)
  431|  49.8k|                            && ps_op->s_ivd_video_decode_op_t.u4_size
  ------------------
  |  Branch (431:32): [True: 0, False: 49.8k]
  ------------------
  432|  49.8k|                                            != sizeof(ivd_video_decode_op_t))
  433|      0|            {
  434|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |= 1
  435|      0|                                << IVD_UNSUPPORTEDPARAM;
  436|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |=
  437|      0|                                IVD_OP_API_STRUCT_SIZE_INCORRECT;
  438|      0|                return (IV_FAIL);
  439|      0|            }
  440|       |
  441|  49.8k|            if(((codec_t *)(ps_handle->pv_codec_handle))->u1_enable_cu_info
  ------------------
  |  Branch (441:16): [True: 0, False: 49.8k]
  ------------------
  442|  49.8k|                            && !ps_ip->pu1_8x8_blk_qp_map && !ps_ip->pu1_8x8_blk_type_map)
  ------------------
  |  Branch (442:32): [True: 0, False: 0]
  |  Branch (442:62): [True: 0, False: 0]
  ------------------
  443|      0|            {
  444|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |= 1
  445|      0|                                << IVD_UNSUPPORTEDPARAM;
  446|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |=
  447|      0|                                IHEVCD_FRAME_INFO_OP_BUF_NULL;
  448|      0|                return (IV_FAIL);
  449|      0|            }
  450|       |
  451|  49.8k|        }
  452|  49.8k|            break;
  453|       |
  454|  49.8k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (454:9): [True: 797, False: 54.6k]
  ------------------
  455|    797|        {
  456|    797|            ihevcd_cxa_delete_ip_t *ps_ip =
  457|    797|                            (ihevcd_cxa_delete_ip_t *)pv_api_ip;
  458|    797|            ihevcd_cxa_delete_op_t *ps_op =
  459|    797|                            (ihevcd_cxa_delete_op_t *)pv_api_op;
  460|       |
  461|    797|            ps_op->s_ivd_delete_op_t.u4_error_code = 0;
  462|       |
  463|    797|            if(ps_ip->s_ivd_delete_ip_t.u4_size
  ------------------
  |  Branch (463:16): [True: 0, False: 797]
  ------------------
  464|    797|                            != sizeof(ihevcd_cxa_delete_ip_t))
  465|      0|            {
  466|      0|                ps_op->s_ivd_delete_op_t.u4_error_code |= 1
  467|      0|                                << IVD_UNSUPPORTEDPARAM;
  468|      0|                ps_op->s_ivd_delete_op_t.u4_error_code |=
  469|      0|                                IVD_IP_API_STRUCT_SIZE_INCORRECT;
  470|      0|                return (IV_FAIL);
  471|      0|            }
  472|       |
  473|    797|            if(ps_op->s_ivd_delete_op_t.u4_size
  ------------------
  |  Branch (473:16): [True: 0, False: 797]
  ------------------
  474|    797|                            != sizeof(ihevcd_cxa_delete_op_t))
  475|      0|            {
  476|      0|                ps_op->s_ivd_delete_op_t.u4_error_code |= 1
  477|      0|                                << IVD_UNSUPPORTEDPARAM;
  478|      0|                ps_op->s_ivd_delete_op_t.u4_error_code |=
  479|      0|                                IVD_OP_API_STRUCT_SIZE_INCORRECT;
  480|      0|                return (IV_FAIL);
  481|      0|            }
  482|       |
  483|    797|        }
  484|    797|            break;
  485|       |
  486|  4.01k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (486:9): [True: 4.01k, False: 51.4k]
  ------------------
  487|  4.01k|        {
  488|  4.01k|            UWORD32 *pu4_ptr_cmd;
  489|  4.01k|            UWORD32 sub_command;
  490|       |
  491|  4.01k|            pu4_ptr_cmd = (UWORD32 *)pv_api_ip;
  492|  4.01k|            pu4_ptr_cmd += 2;
  493|  4.01k|            sub_command = *pu4_ptr_cmd;
  494|       |
  495|  4.01k|            switch(sub_command)
  496|  4.01k|            {
  497|  1.59k|                case IVD_CMD_CTL_SETPARAMS:
  ------------------
  |  Branch (497:17): [True: 1.59k, False: 2.42k]
  ------------------
  498|  1.59k|                {
  499|  1.59k|                    ihevcd_cxa_ctl_set_config_ip_t *ps_ip;
  500|  1.59k|                    ihevcd_cxa_ctl_set_config_op_t *ps_op;
  501|  1.59k|                    ps_ip = (ihevcd_cxa_ctl_set_config_ip_t *)pv_api_ip;
  502|  1.59k|                    ps_op = (ihevcd_cxa_ctl_set_config_op_t *)pv_api_op;
  503|       |
  504|  1.59k|                    if(ps_ip->s_ivd_ctl_set_config_ip_t.u4_size
  ------------------
  |  Branch (504:24): [True: 0, False: 1.59k]
  ------------------
  505|  1.59k|                                    != sizeof(ihevcd_cxa_ctl_set_config_ip_t) &&
  506|  1.59k|                                    ps_ip->s_ivd_ctl_set_config_ip_t.u4_size
  ------------------
  |  Branch (506:37): [True: 0, False: 0]
  ------------------
  507|      0|                                                != sizeof(ivd_ctl_set_config_ip_t))
  508|      0|                    {
  509|      0|                        ps_op->s_ivd_ctl_set_config_op_t.u4_error_code |= 1
  510|      0|                                        << IVD_UNSUPPORTEDPARAM;
  511|      0|                        ps_op->s_ivd_ctl_set_config_op_t.u4_error_code |=
  512|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  513|      0|                        return IV_FAIL;
  514|      0|                    }
  515|  1.59k|                }
  516|       |                    //no break; is needed here
  517|  1.59k|                case IVD_CMD_CTL_SETDEFAULT:
  ------------------
  |  Branch (517:17): [True: 0, False: 4.01k]
  ------------------
  518|  1.59k|                {
  519|  1.59k|                    ihevcd_cxa_ctl_set_config_op_t *ps_op;
  520|  1.59k|                    ps_op = (ihevcd_cxa_ctl_set_config_op_t *)pv_api_op;
  521|  1.59k|                    if(ps_op->s_ivd_ctl_set_config_op_t.u4_size
  ------------------
  |  Branch (521:24): [True: 0, False: 1.59k]
  ------------------
  522|  1.59k|                                    != sizeof(ihevcd_cxa_ctl_set_config_op_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_OP_API_STRUCT_SIZE_INCORRECT;
  528|      0|                        return IV_FAIL;
  529|      0|                    }
  530|  1.59k|                }
  531|  1.59k|                    break;
  532|       |
  533|  1.59k|                case IVD_CMD_CTL_GETPARAMS:
  ------------------
  |  Branch (533:17): [True: 0, False: 4.01k]
  ------------------
  534|      0|                {
  535|      0|                    ihevcd_cxa_ctl_getstatus_ip_t *ps_ip;
  536|      0|                    ihevcd_cxa_ctl_getstatus_op_t *ps_op;
  537|       |
  538|      0|                    ps_ip = (ihevcd_cxa_ctl_getstatus_ip_t *)pv_api_ip;
  539|      0|                    ps_op = (ihevcd_cxa_ctl_getstatus_op_t *)pv_api_op;
  540|      0|                    if(ps_ip->s_ivd_ctl_getstatus_ip_t.u4_size
  ------------------
  |  Branch (540:24): [True: 0, False: 0]
  ------------------
  541|      0|                                    != sizeof(ihevcd_cxa_ctl_getstatus_ip_t))
  542|      0|                    {
  543|      0|                        ps_op->s_ivd_ctl_getstatus_op_t.u4_error_code |= 1
  544|      0|                                        << IVD_UNSUPPORTEDPARAM;
  545|      0|                        ps_op->s_ivd_ctl_getstatus_op_t.u4_error_code |=
  546|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  547|      0|                        return IV_FAIL;
  548|      0|                    }
  549|      0|                    if((ps_op->s_ivd_ctl_getstatus_op_t.u4_size
  ------------------
  |  Branch (549:24): [True: 0, False: 0]
  ------------------
  550|      0|                                    != sizeof(ihevcd_cxa_ctl_getstatus_op_t)) &&
  551|      0|                       (ps_op->s_ivd_ctl_getstatus_op_t.u4_size
  ------------------
  |  Branch (551:24): [True: 0, False: 0]
  ------------------
  552|      0|                                    != sizeof(ivd_ctl_getstatus_op_t)))
  553|      0|                    {
  554|      0|                        ps_op->s_ivd_ctl_getstatus_op_t.u4_error_code |= 1
  555|      0|                                        << IVD_UNSUPPORTEDPARAM;
  556|      0|                        ps_op->s_ivd_ctl_getstatus_op_t.u4_error_code |=
  557|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  558|      0|                        return IV_FAIL;
  559|      0|                    }
  560|      0|                }
  561|      0|                    break;
  562|       |
  563|      0|                case IVD_CMD_CTL_GETBUFINFO:
  ------------------
  |  Branch (563:17): [True: 0, False: 4.01k]
  ------------------
  564|      0|                {
  565|      0|                    ihevcd_cxa_ctl_getbufinfo_ip_t *ps_ip;
  566|      0|                    ihevcd_cxa_ctl_getbufinfo_op_t *ps_op;
  567|      0|                    ps_ip = (ihevcd_cxa_ctl_getbufinfo_ip_t *)pv_api_ip;
  568|      0|                    ps_op = (ihevcd_cxa_ctl_getbufinfo_op_t *)pv_api_op;
  569|       |
  570|      0|                    if(ps_ip->s_ivd_ctl_getbufinfo_ip_t.u4_size
  ------------------
  |  Branch (570:24): [True: 0, False: 0]
  ------------------
  571|      0|                                    != sizeof(ihevcd_cxa_ctl_getbufinfo_ip_t))
  572|      0|                    {
  573|      0|                        ps_op->s_ivd_ctl_getbufinfo_op_t.u4_error_code |= 1
  574|      0|                                        << IVD_UNSUPPORTEDPARAM;
  575|      0|                        ps_op->s_ivd_ctl_getbufinfo_op_t.u4_error_code |=
  576|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  577|      0|                        return IV_FAIL;
  578|      0|                    }
  579|      0|                    if(ps_op->s_ivd_ctl_getbufinfo_op_t.u4_size
  ------------------
  |  Branch (579:24): [True: 0, False: 0]
  ------------------
  580|      0|                                    != sizeof(ihevcd_cxa_ctl_getbufinfo_op_t))
  581|      0|                    {
  582|      0|                        ps_op->s_ivd_ctl_getbufinfo_op_t.u4_error_code |= 1
  583|      0|                                        << IVD_UNSUPPORTEDPARAM;
  584|      0|                        ps_op->s_ivd_ctl_getbufinfo_op_t.u4_error_code |=
  585|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  586|      0|                        return IV_FAIL;
  587|      0|                    }
  588|      0|                }
  589|      0|                    break;
  590|       |
  591|      0|                case IVD_CMD_CTL_GETVERSION:
  ------------------
  |  Branch (591:17): [True: 0, False: 4.01k]
  ------------------
  592|      0|                {
  593|      0|                    ihevcd_cxa_ctl_getversioninfo_ip_t *ps_ip;
  594|      0|                    ihevcd_cxa_ctl_getversioninfo_op_t *ps_op;
  595|      0|                    ps_ip = (ihevcd_cxa_ctl_getversioninfo_ip_t *)pv_api_ip;
  596|      0|                    ps_op = (ihevcd_cxa_ctl_getversioninfo_op_t *)pv_api_op;
  597|      0|                    if(ps_ip->s_ivd_ctl_getversioninfo_ip_t.u4_size
  ------------------
  |  Branch (597:24): [True: 0, False: 0]
  ------------------
  598|      0|                                    != sizeof(ihevcd_cxa_ctl_getversioninfo_ip_t))
  599|      0|                    {
  600|      0|                        ps_op->s_ivd_ctl_getversioninfo_op_t.u4_error_code |= 1
  601|      0|                                        << IVD_UNSUPPORTEDPARAM;
  602|      0|                        ps_op->s_ivd_ctl_getversioninfo_op_t.u4_error_code |=
  603|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  604|      0|                        return IV_FAIL;
  605|      0|                    }
  606|      0|                    if(ps_op->s_ivd_ctl_getversioninfo_op_t.u4_size
  ------------------
  |  Branch (606:24): [True: 0, False: 0]
  ------------------
  607|      0|                                    != sizeof(ihevcd_cxa_ctl_getversioninfo_op_t))
  608|      0|                    {
  609|      0|                        ps_op->s_ivd_ctl_getversioninfo_op_t.u4_error_code |= 1
  610|      0|                                        << IVD_UNSUPPORTEDPARAM;
  611|      0|                        ps_op->s_ivd_ctl_getversioninfo_op_t.u4_error_code |=
  612|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  613|      0|                        return IV_FAIL;
  614|      0|                    }
  615|      0|                }
  616|      0|                    break;
  617|       |
  618|      0|                case IVD_CMD_CTL_FLUSH:
  ------------------
  |  Branch (618:17): [True: 0, False: 4.01k]
  ------------------
  619|      0|                {
  620|      0|                    ihevcd_cxa_ctl_flush_ip_t *ps_ip;
  621|      0|                    ihevcd_cxa_ctl_flush_op_t *ps_op;
  622|      0|                    ps_ip = (ihevcd_cxa_ctl_flush_ip_t *)pv_api_ip;
  623|      0|                    ps_op = (ihevcd_cxa_ctl_flush_op_t *)pv_api_op;
  624|      0|                    if(ps_ip->s_ivd_ctl_flush_ip_t.u4_size
  ------------------
  |  Branch (624:24): [True: 0, False: 0]
  ------------------
  625|      0|                                    != sizeof(ihevcd_cxa_ctl_flush_ip_t))
  626|      0|                    {
  627|      0|                        ps_op->s_ivd_ctl_flush_op_t.u4_error_code |= 1
  628|      0|                                        << IVD_UNSUPPORTEDPARAM;
  629|      0|                        ps_op->s_ivd_ctl_flush_op_t.u4_error_code |=
  630|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  631|      0|                        return IV_FAIL;
  632|      0|                    }
  633|      0|                    if(ps_op->s_ivd_ctl_flush_op_t.u4_size
  ------------------
  |  Branch (633:24): [True: 0, False: 0]
  ------------------
  634|      0|                                    != sizeof(ihevcd_cxa_ctl_flush_op_t))
  635|      0|                    {
  636|      0|                        ps_op->s_ivd_ctl_flush_op_t.u4_error_code |= 1
  637|      0|                                        << IVD_UNSUPPORTEDPARAM;
  638|      0|                        ps_op->s_ivd_ctl_flush_op_t.u4_error_code |=
  639|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  640|      0|                        return IV_FAIL;
  641|      0|                    }
  642|      0|                }
  643|      0|                    break;
  644|       |
  645|    826|                case IVD_CMD_CTL_RESET:
  ------------------
  |  Branch (645:17): [True: 826, False: 3.18k]
  ------------------
  646|    826|                {
  647|    826|                    ihevcd_cxa_ctl_reset_ip_t *ps_ip;
  648|    826|                    ihevcd_cxa_ctl_reset_op_t *ps_op;
  649|    826|                    ps_ip = (ihevcd_cxa_ctl_reset_ip_t *)pv_api_ip;
  650|    826|                    ps_op = (ihevcd_cxa_ctl_reset_op_t *)pv_api_op;
  651|    826|                    if(ps_ip->s_ivd_ctl_reset_ip_t.u4_size
  ------------------
  |  Branch (651:24): [True: 0, False: 826]
  ------------------
  652|    826|                                    != sizeof(ihevcd_cxa_ctl_reset_ip_t))
  653|      0|                    {
  654|      0|                        ps_op->s_ivd_ctl_reset_op_t.u4_error_code |= 1
  655|      0|                                        << IVD_UNSUPPORTEDPARAM;
  656|      0|                        ps_op->s_ivd_ctl_reset_op_t.u4_error_code |=
  657|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  658|      0|                        return IV_FAIL;
  659|      0|                    }
  660|    826|                    if(ps_op->s_ivd_ctl_reset_op_t.u4_size
  ------------------
  |  Branch (660:24): [True: 0, False: 826]
  ------------------
  661|    826|                                    != sizeof(ihevcd_cxa_ctl_reset_op_t))
  662|      0|                    {
  663|      0|                        ps_op->s_ivd_ctl_reset_op_t.u4_error_code |= 1
  664|      0|                                        << IVD_UNSUPPORTEDPARAM;
  665|      0|                        ps_op->s_ivd_ctl_reset_op_t.u4_error_code |=
  666|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  667|      0|                        return IV_FAIL;
  668|      0|                    }
  669|    826|                }
  670|    826|                    break;
  671|    826|                case IHEVCD_CXA_CMD_CTL_DEGRADE:
  ------------------
  |  Branch (671:17): [True: 0, False: 4.01k]
  ------------------
  672|      0|                {
  673|      0|                    ihevcd_cxa_ctl_degrade_ip_t *ps_ip;
  674|      0|                    ihevcd_cxa_ctl_degrade_op_t *ps_op;
  675|       |
  676|      0|                    ps_ip = (ihevcd_cxa_ctl_degrade_ip_t *)pv_api_ip;
  677|      0|                    ps_op = (ihevcd_cxa_ctl_degrade_op_t *)pv_api_op;
  678|       |
  679|      0|                    if(ps_ip->u4_size
  ------------------
  |  Branch (679:24): [True: 0, False: 0]
  ------------------
  680|      0|                                    != sizeof(ihevcd_cxa_ctl_degrade_ip_t))
  681|      0|                    {
  682|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  683|      0|                        ps_op->u4_error_code |=
  684|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  685|      0|                        return IV_FAIL;
  686|      0|                    }
  687|       |
  688|      0|                    if(ps_op->u4_size
  ------------------
  |  Branch (688:24): [True: 0, False: 0]
  ------------------
  689|      0|                                    != sizeof(ihevcd_cxa_ctl_degrade_op_t))
  690|      0|                    {
  691|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  692|      0|                        ps_op->u4_error_code |=
  693|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  694|      0|                        return IV_FAIL;
  695|      0|                    }
  696|       |
  697|      0|                    if((ps_ip->i4_degrade_pics < 0) ||
  ------------------
  |  Branch (697:24): [True: 0, False: 0]
  ------------------
  698|      0|                       (ps_ip->i4_degrade_pics > 4) ||
  ------------------
  |  Branch (698:24): [True: 0, False: 0]
  ------------------
  699|      0|                       (ps_ip->i4_nondegrade_interval < 0) ||
  ------------------
  |  Branch (699:24): [True: 0, False: 0]
  ------------------
  700|      0|                       (ps_ip->i4_degrade_type < 0) ||
  ------------------
  |  Branch (700:24): [True: 0, False: 0]
  ------------------
  701|      0|                       (ps_ip->i4_degrade_type > 15))
  ------------------
  |  Branch (701:24): [True: 0, False: 0]
  ------------------
  702|      0|                    {
  703|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  704|      0|                        return IV_FAIL;
  705|      0|                    }
  706|       |
  707|      0|                    break;
  708|      0|                }
  709|       |
  710|      0|                case IHEVCD_CXA_CMD_CTL_GET_BUFFER_DIMENSIONS:
  ------------------
  |  Branch (710:17): [True: 0, False: 4.01k]
  ------------------
  711|      0|                {
  712|      0|                    ihevcd_cxa_ctl_get_frame_dimensions_ip_t *ps_ip;
  713|      0|                    ihevcd_cxa_ctl_get_frame_dimensions_op_t *ps_op;
  714|       |
  715|      0|                    ps_ip =
  716|      0|                                    (ihevcd_cxa_ctl_get_frame_dimensions_ip_t *)pv_api_ip;
  717|      0|                    ps_op =
  718|      0|                                    (ihevcd_cxa_ctl_get_frame_dimensions_op_t *)pv_api_op;
  719|       |
  720|      0|                    if(ps_ip->u4_size
  ------------------
  |  Branch (720:24): [True: 0, False: 0]
  ------------------
  721|      0|                                    != sizeof(ihevcd_cxa_ctl_get_frame_dimensions_ip_t))
  722|      0|                    {
  723|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  724|      0|                        ps_op->u4_error_code |=
  725|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  726|      0|                        return IV_FAIL;
  727|      0|                    }
  728|       |
  729|      0|                    if(ps_op->u4_size
  ------------------
  |  Branch (729:24): [True: 0, False: 0]
  ------------------
  730|      0|                                    != sizeof(ihevcd_cxa_ctl_get_frame_dimensions_op_t))
  731|      0|                    {
  732|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  733|      0|                        ps_op->u4_error_code |=
  734|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  735|      0|                        return IV_FAIL;
  736|      0|                    }
  737|       |
  738|      0|                    break;
  739|      0|                }
  740|       |
  741|      0|                case IHEVCD_CXA_CMD_CTL_GET_VUI_PARAMS:
  ------------------
  |  Branch (741:17): [True: 0, False: 4.01k]
  ------------------
  742|      0|                {
  743|      0|                    ihevcd_cxa_ctl_get_vui_params_ip_t *ps_ip;
  744|      0|                    ihevcd_cxa_ctl_get_vui_params_op_t *ps_op;
  745|       |
  746|      0|                    ps_ip =
  747|      0|                                    (ihevcd_cxa_ctl_get_vui_params_ip_t *)pv_api_ip;
  748|      0|                    ps_op =
  749|      0|                                    (ihevcd_cxa_ctl_get_vui_params_op_t *)pv_api_op;
  750|       |
  751|      0|                    if(ps_ip->u4_size
  ------------------
  |  Branch (751:24): [True: 0, False: 0]
  ------------------
  752|      0|                                    != sizeof(ihevcd_cxa_ctl_get_vui_params_ip_t))
  753|      0|                    {
  754|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  755|      0|                        ps_op->u4_error_code |=
  756|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  757|      0|                        return IV_FAIL;
  758|      0|                    }
  759|       |
  760|      0|                    if(ps_op->u4_size
  ------------------
  |  Branch (760:24): [True: 0, False: 0]
  ------------------
  761|      0|                                    != sizeof(ihevcd_cxa_ctl_get_vui_params_op_t))
  762|      0|                    {
  763|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  764|      0|                        ps_op->u4_error_code |=
  765|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  766|      0|                        return IV_FAIL;
  767|      0|                    }
  768|       |
  769|      0|                    break;
  770|      0|                }
  771|      0|                case IHEVCD_CXA_CMD_CTL_GET_SEI_MASTERING_PARAMS:
  ------------------
  |  Branch (771:17): [True: 0, False: 4.01k]
  ------------------
  772|      0|                {
  773|      0|                    ihevcd_cxa_ctl_get_sei_mastering_params_ip_t *ps_ip;
  774|      0|                    ihevcd_cxa_ctl_get_sei_mastering_params_op_t *ps_op;
  775|       |
  776|      0|                    ps_ip = (ihevcd_cxa_ctl_get_sei_mastering_params_ip_t *)pv_api_ip;
  777|      0|                    ps_op = (ihevcd_cxa_ctl_get_sei_mastering_params_op_t *)pv_api_op;
  778|       |
  779|      0|                    if(ps_ip->u4_size
  ------------------
  |  Branch (779:24): [True: 0, False: 0]
  ------------------
  780|      0|                                    != sizeof(ihevcd_cxa_ctl_get_sei_mastering_params_ip_t))
  781|      0|                    {
  782|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  783|      0|                        ps_op->u4_error_code |=
  784|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  785|      0|                        return IV_FAIL;
  786|      0|                    }
  787|       |
  788|      0|                    if(ps_op->u4_size
  ------------------
  |  Branch (788:24): [True: 0, False: 0]
  ------------------
  789|      0|                                    != sizeof(ihevcd_cxa_ctl_get_sei_mastering_params_op_t))
  790|      0|                    {
  791|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  792|      0|                        ps_op->u4_error_code |=
  793|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  794|      0|                        return IV_FAIL;
  795|      0|                    }
  796|       |
  797|      0|                    break;
  798|      0|                }
  799|    797|                case IHEVCD_CXA_CMD_CTL_SET_NUM_CORES:
  ------------------
  |  Branch (799:17): [True: 797, False: 3.21k]
  ------------------
  800|    797|                {
  801|    797|                    ihevcd_cxa_ctl_set_num_cores_ip_t *ps_ip;
  802|    797|                    ihevcd_cxa_ctl_set_num_cores_op_t *ps_op;
  803|       |
  804|    797|                    ps_ip = (ihevcd_cxa_ctl_set_num_cores_ip_t *)pv_api_ip;
  805|    797|                    ps_op = (ihevcd_cxa_ctl_set_num_cores_op_t *)pv_api_op;
  806|       |
  807|    797|                    if(ps_ip->u4_size
  ------------------
  |  Branch (807:24): [True: 0, False: 797]
  ------------------
  808|    797|                                    != sizeof(ihevcd_cxa_ctl_set_num_cores_ip_t))
  809|      0|                    {
  810|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  811|      0|                        ps_op->u4_error_code |=
  812|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  813|      0|                        return IV_FAIL;
  814|      0|                    }
  815|       |
  816|    797|                    if(ps_op->u4_size
  ------------------
  |  Branch (816:24): [True: 0, False: 797]
  ------------------
  817|    797|                                    != sizeof(ihevcd_cxa_ctl_set_num_cores_op_t))
  818|      0|                    {
  819|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  820|      0|                        ps_op->u4_error_code |=
  821|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  822|      0|                        return IV_FAIL;
  823|      0|                    }
  824|       |
  825|    797|                    if((ps_ip->u4_num_cores < 1) || (ps_ip->u4_num_cores > MAX_NUM_CORES))
  ------------------
  |  |  116|    797|#define MAX_NUM_CORES       8
  ------------------
  |  Branch (825:24): [True: 0, False: 797]
  |  Branch (825:53): [True: 0, False: 797]
  ------------------
  826|      0|                    {
  827|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  828|      0|                        return IV_FAIL;
  829|      0|                    }
  830|    797|                    break;
  831|    797|                }
  832|    797|                case IHEVCD_CXA_CMD_CTL_SET_PROCESSOR:
  ------------------
  |  Branch (832:17): [True: 797, False: 3.21k]
  ------------------
  833|    797|                {
  834|    797|                    ihevcd_cxa_ctl_set_processor_ip_t *ps_ip;
  835|    797|                    ihevcd_cxa_ctl_set_processor_op_t *ps_op;
  836|       |
  837|    797|                    ps_ip = (ihevcd_cxa_ctl_set_processor_ip_t *)pv_api_ip;
  838|    797|                    ps_op = (ihevcd_cxa_ctl_set_processor_op_t *)pv_api_op;
  839|       |
  840|    797|                    if(ps_ip->u4_size
  ------------------
  |  Branch (840:24): [True: 0, False: 797]
  ------------------
  841|    797|                                    != sizeof(ihevcd_cxa_ctl_set_processor_ip_t))
  842|      0|                    {
  843|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  844|      0|                        ps_op->u4_error_code |=
  845|      0|                                        IVD_IP_API_STRUCT_SIZE_INCORRECT;
  846|      0|                        return IV_FAIL;
  847|      0|                    }
  848|       |
  849|    797|                    if(ps_op->u4_size
  ------------------
  |  Branch (849:24): [True: 0, False: 797]
  ------------------
  850|    797|                                    != sizeof(ihevcd_cxa_ctl_set_processor_op_t))
  851|      0|                    {
  852|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  853|      0|                        ps_op->u4_error_code |=
  854|      0|                                        IVD_OP_API_STRUCT_SIZE_INCORRECT;
  855|      0|                        return IV_FAIL;
  856|      0|                    }
  857|       |
  858|    797|                    break;
  859|    797|                }
  860|    797|                default:
  ------------------
  |  Branch (860:17): [True: 0, False: 4.01k]
  ------------------
  861|      0|                    *(pu4_api_op + 1) |= 1 << IVD_UNSUPPORTEDPARAM;
  862|      0|                    *(pu4_api_op + 1) |= IVD_UNSUPPORTED_API_CMD;
  863|      0|                    return IV_FAIL;
  864|  4.01k|            }
  865|  4.01k|        }
  866|  4.01k|            break;
  867|  4.01k|        default:
  ------------------
  |  Branch (867:9): [True: 0, False: 55.4k]
  ------------------
  868|      0|            *(pu4_api_op + 1) |= 1 << IVD_UNSUPPORTEDPARAM;
  869|      0|            *(pu4_api_op + 1) |= IVD_UNSUPPORTED_API_CMD;
  870|      0|            return IV_FAIL;
  871|  55.4k|    }
  872|       |
  873|  55.4k|    return IV_SUCCESS;
  874|  55.4k|}

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

ihevcd_pu_boundary_strength:
   87|  12.0M|{
   88|  12.0M|    WORD32 i4_bs;
   89|  12.0M|    UWORD32 l0_ref_pic_buf_id, l1_ref_pic_buf_id;
   90|  12.0M|    UWORD32 ngbr_l0_ref_pic_buf_id, ngbr_l1_ref_pic_buf_id;
   91|       |
   92|  12.0M|    WORD16 i2_mv_x0, i2_mv_y0, i2_mv_x1, i2_mv_y1;
   93|  12.0M|    WORD16 i2_ngbr_mv_x0, i2_ngbr_mv_y0, i2_ngbr_mv_x1, i2_ngbr_mv_y1;
   94|       |
   95|  12.0M|    WORD32 num_mv, ngbr_num_mv;
   96|       |
   97|  12.0M|    num_mv = (PRED_BI == ps_pu->b2_pred_mode) ? 2 : 1;
  ------------------
  |  Branch (97:14): [True: 7.65M, False: 4.38M]
  ------------------
   98|  12.0M|    ngbr_num_mv = (PRED_BI == ps_ngbr_pu->b2_pred_mode) ? 2 : 1;
  ------------------
  |  Branch (98:19): [True: 7.67M, False: 4.36M]
  ------------------
   99|       |
  100|  12.0M|    l0_ref_pic_buf_id = ps_pu->mv.i1_l0_ref_pic_buf_id;
  101|  12.0M|    l1_ref_pic_buf_id = ps_pu->mv.i1_l1_ref_pic_buf_id;
  102|  12.0M|    ngbr_l0_ref_pic_buf_id = ps_ngbr_pu->mv.i1_l0_ref_pic_buf_id;
  103|  12.0M|    ngbr_l1_ref_pic_buf_id = ps_ngbr_pu->mv.i1_l1_ref_pic_buf_id;
  104|       |
  105|       |
  106|  12.0M|    i2_mv_x0 = ps_pu->mv.s_l0_mv.i2_mvx;
  107|  12.0M|    i2_mv_y0 = ps_pu->mv.s_l0_mv.i2_mvy;
  108|  12.0M|    i2_mv_x1 = ps_pu->mv.s_l1_mv.i2_mvx;
  109|  12.0M|    i2_mv_y1 = ps_pu->mv.s_l1_mv.i2_mvy;
  110|       |
  111|  12.0M|    i2_ngbr_mv_x0 = ps_ngbr_pu->mv.s_l0_mv.i2_mvx;
  112|  12.0M|    i2_ngbr_mv_y0 = ps_ngbr_pu->mv.s_l0_mv.i2_mvy;
  113|  12.0M|    i2_ngbr_mv_x1 = ps_ngbr_pu->mv.s_l1_mv.i2_mvx;
  114|  12.0M|    i2_ngbr_mv_y1 = ps_ngbr_pu->mv.s_l1_mv.i2_mvy;
  115|       |
  116|       |
  117|       |    /* If two motion vectors are used */
  118|  12.0M|    if((2 == num_mv) &&
  ------------------
  |  Branch (118:8): [True: 7.65M, False: 4.37M]
  ------------------
  119|  12.0M|            (2 == ngbr_num_mv))
  ------------------
  |  Branch (119:13): [True: 7.46M, False: 193k]
  ------------------
  120|  7.46M|    {
  121|  7.46M|        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: 7.45M, False: 11.2k]
  |  Branch (121:60): [True: 7.46M, False: 18.4E]
  ------------------
  122|  7.46M|                (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: 6.48k, False: 8.00k]
  |  Branch (122:65): [True: 351, False: 6.13k]
  ------------------
  123|  7.45M|        {
  124|  7.45M|            if(l0_ref_pic_buf_id != l1_ref_pic_buf_id) /* Different L0 and L1 */
  ------------------
  |  Branch (124:16): [True: 1.14M, False: 6.31M]
  ------------------
  125|  1.14M|            {
  126|  1.14M|                if(l0_ref_pic_buf_id == ngbr_l0_ref_pic_buf_id)
  ------------------
  |  Branch (126:20): [True: 1.14M, False: 405]
  ------------------
  127|  1.14M|                {
  128|  1.14M|                    i4_bs = (ABS(i2_mv_x0 - i2_ngbr_mv_x0) < 4) &&
  ------------------
  |  |   45|  1.14M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 9.74k, False: 1.13M]
  |  |  ------------------
  ------------------
  |  Branch (128:29): [True: 1.14M, False: 3.48k]
  ------------------
  129|  1.14M|                            (ABS(i2_mv_y0 - i2_ngbr_mv_y0) < 4) &&
  ------------------
  |  |   45|  1.14M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 7.86k, False: 1.13M]
  |  |  ------------------
  ------------------
  |  Branch (129:29): [True: 1.13M, False: 1.47k]
  ------------------
  130|  1.14M|                            (ABS(i2_mv_x1 - i2_ngbr_mv_x1) < 4) &&
  ------------------
  |  |   45|  1.13M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 6.09k, False: 1.13M]
  |  |  ------------------
  ------------------
  |  Branch (130:29): [True: 1.13M, False: 1.02k]
  ------------------
  131|  1.14M|                            (ABS(i2_mv_y1 - i2_ngbr_mv_y1) < 4) ? 0 : 1;
  ------------------
  |  |   45|  1.13M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 5.46k, False: 1.13M]
  |  |  ------------------
  ------------------
  |  Branch (131:29): [True: 1.13M, False: 813]
  ------------------
  132|  1.14M|                }
  133|    405|                else
  134|    405|                {
  135|    405|                    i4_bs = (ABS(i2_mv_x0 - i2_ngbr_mv_x1) < 4) &&
  ------------------
  |  |   45|    405|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 139, False: 266]
  |  |  ------------------
  ------------------
  |  Branch (135:29): [True: 265, False: 140]
  ------------------
  136|    405|                            (ABS(i2_mv_y0 - i2_ngbr_mv_y1) < 4) &&
  ------------------
  |  |   45|    265|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 87, False: 178]
  |  |  ------------------
  ------------------
  |  Branch (136:29): [True: 242, False: 23]
  ------------------
  137|    405|                            (ABS(i2_mv_x1 - i2_ngbr_mv_x0) < 4) &&
  ------------------
  |  |   45|    242|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 102, False: 140]
  |  |  ------------------
  ------------------
  |  Branch (137:29): [True: 187, False: 55]
  ------------------
  138|    405|                            (ABS(i2_mv_y1 - i2_ngbr_mv_y0) < 4) ? 0 : 1;
  ------------------
  |  |   45|    187|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 11, False: 176]
  |  |  ------------------
  ------------------
  |  Branch (138:29): [True: 185, False: 2]
  ------------------
  139|    405|                }
  140|  1.14M|            }
  141|  6.31M|            else /* Same L0 and L1 */
  142|  6.31M|            {
  143|  6.31M|                i4_bs = ((ABS(i2_mv_x0 - i2_ngbr_mv_x0) >= 4) ||
  ------------------
  |  |   45|  6.31M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 21.2k, False: 6.29M]
  |  |  ------------------
  ------------------
  |  Branch (143:26): [True: 17.0k, False: 6.29M]
  ------------------
  144|  6.31M|                         (ABS(i2_mv_y0 - i2_ngbr_mv_y0) >= 4) ||
  ------------------
  |  |   45|  6.29M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 13.8k, False: 6.28M]
  |  |  ------------------
  ------------------
  |  Branch (144:26): [True: 8.44k, False: 6.28M]
  ------------------
  145|  6.31M|                         (ABS(i2_mv_x1 - i2_ngbr_mv_x1) >= 4) ||
  ------------------
  |  |   45|  6.29M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 10.8k, False: 6.27M]
  |  |  ------------------
  ------------------
  |  Branch (145:26): [True: 2.92k, False: 6.28M]
  ------------------
  146|  6.31M|                         (ABS(i2_mv_y1 - i2_ngbr_mv_y1) >= 4)) &&
  ------------------
  |  |   45|  6.28M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 8.62k, False: 6.27M]
  |  |  ------------------
  ------------------
  |  Branch (146:26): [True: 1.60k, False: 6.28M]
  ------------------
  147|  6.31M|                                ((ABS(i2_mv_x0 - i2_ngbr_mv_x1) >= 4) ||
  ------------------
  |  |   45|  26.6k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 8.18k, False: 18.4k]
  |  |  ------------------
  ------------------
  |  Branch (147:34): [True: 10.3k, False: 16.3k]
  ------------------
  148|  26.6k|                                 (ABS(i2_mv_y0 - i2_ngbr_mv_y1) >= 4) ||
  ------------------
  |  |   45|  16.3k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 3.79k, False: 12.5k]
  |  |  ------------------
  ------------------
  |  Branch (148:34): [True: 5.32k, False: 10.9k]
  ------------------
  149|  26.6k|                                 (ABS(i2_mv_x1 - i2_ngbr_mv_x0) >= 4) ||
  ------------------
  |  |   45|  10.9k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 6.48k, False: 4.50k]
  |  |  ------------------
  ------------------
  |  Branch (149:34): [True: 6.91k, False: 4.08k]
  ------------------
  150|  6.28M|                                 (ABS(i2_mv_y1 - i2_ngbr_mv_y0) >= 4)) ? 1 : 0;
  ------------------
  |  |   45|  4.08k|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 1.89k, False: 2.19k]
  |  |  ------------------
  ------------------
  |  Branch (150:34): [True: 3.65k, False: 425]
  ------------------
  151|  6.31M|            }
  152|  7.45M|        }
  153|  6.98k|        else /* If the reference pictures used are different */
  154|  6.98k|        {
  155|  6.98k|            i4_bs = 1;
  156|  6.98k|        }
  157|  7.46M|    }
  158|       |
  159|       |    /* If one motion vector is used in both PUs */
  160|  4.57M|    else if((1 == num_mv) &&
  ------------------
  |  Branch (160:13): [True: 4.38M, False: 185k]
  ------------------
  161|  4.57M|            (1 == ngbr_num_mv))
  ------------------
  |  Branch (161:13): [True: 4.17M, False: 214k]
  ------------------
  162|  4.17M|    {
  163|  4.17M|        WORD16 i2_mv_x, i2_mv_y;
  164|  4.17M|        WORD16 i2_ngbr_mv_x, i2_ngbr_mv_y;
  165|  4.17M|        UWORD32 ref_pic_buf_id, ngbr_ref_pic_buf_id;
  166|       |
  167|  4.17M|        if(PRED_L0 == ps_pu->b2_pred_mode)
  ------------------
  |  Branch (167:12): [True: 3.86M, False: 306k]
  ------------------
  168|  3.86M|        {
  169|  3.86M|            i2_mv_x = i2_mv_x0;
  170|  3.86M|            i2_mv_y = i2_mv_y0;
  171|  3.86M|            ref_pic_buf_id = l0_ref_pic_buf_id;
  172|  3.86M|        }
  173|   306k|        else
  174|   306k|        {
  175|   306k|            i2_mv_x = i2_mv_x1;
  176|   306k|            i2_mv_y = i2_mv_y1;
  177|   306k|            ref_pic_buf_id = l1_ref_pic_buf_id;
  178|   306k|        }
  179|       |
  180|  4.17M|        if(PRED_L0 == ps_ngbr_pu->b2_pred_mode)
  ------------------
  |  Branch (180:12): [True: 3.86M, False: 306k]
  ------------------
  181|  3.86M|        {
  182|  3.86M|            i2_ngbr_mv_x = i2_ngbr_mv_x0;
  183|  3.86M|            i2_ngbr_mv_y = i2_ngbr_mv_y0;
  184|  3.86M|            ngbr_ref_pic_buf_id = ngbr_l0_ref_pic_buf_id;
  185|  3.86M|        }
  186|   306k|        else
  187|   306k|        {
  188|   306k|            i2_ngbr_mv_x = i2_ngbr_mv_x1;
  189|   306k|            i2_ngbr_mv_y = i2_ngbr_mv_y1;
  190|   306k|            ngbr_ref_pic_buf_id = ngbr_l1_ref_pic_buf_id;
  191|   306k|        }
  192|       |
  193|  4.17M|        i4_bs = (ref_pic_buf_id == ngbr_ref_pic_buf_id) &&
  ------------------
  |  Branch (193:17): [True: 4.07M, False: 99.2k]
  ------------------
  194|  4.17M|                (ABS(i2_mv_x - i2_ngbr_mv_x) < 4)  &&
  ------------------
  |  |   45|  4.07M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 121k, False: 3.95M]
  |  |  ------------------
  ------------------
  |  Branch (194:17): [True: 4.01M, False: 60.3k]
  ------------------
  195|  4.17M|                (ABS(i2_mv_y - i2_ngbr_mv_y) < 4) ? 0 : 1;
  ------------------
  |  |   45|  4.01M|#define ABS(x)      ((((WORD32)(x)) > 0)           ? (x) : -(x))
  |  |  ------------------
  |  |  |  Branch (45:22): [True: 100k, False: 3.91M]
  |  |  ------------------
  ------------------
  |  Branch (195:17): [True: 3.98M, False: 32.3k]
  ------------------
  196|  4.17M|    }
  197|       |
  198|       |    /* If the no. of motion vectors is not the same */
  199|   399k|    else
  200|   399k|    {
  201|   399k|        i4_bs = 1;
  202|   399k|    }
  203|       |
  204|       |
  205|  12.0M|    return i4_bs;
  206|  12.0M|}
ihevcd_ctb_boundary_strength_islice:
  210|  1.11M|{
  211|  1.11M|    pps_t *ps_pps;
  212|  1.11M|    sps_t *ps_sps;
  213|  1.11M|    tu_t *ps_tu;
  214|  1.11M|    UWORD32 *pu4_vert_bs;
  215|  1.11M|    UWORD32 *pu4_horz_bs;
  216|  1.11M|    WORD32 bs_strd;
  217|  1.11M|    WORD32 vert_bs0_tmp;
  218|  1.11M|    WORD32 horz_bs0_tmp;
  219|  1.11M|    UWORD8 *pu1_qp;
  220|  1.11M|    WORD32 qp_strd;
  221|  1.11M|    UWORD32 u4_qp_const_in_ctb;
  222|  1.11M|    WORD32 ctb_indx;
  223|  1.11M|    WORD32 i4_tu_cnt;
  224|  1.11M|    WORD32 log2_ctb_size;
  225|  1.11M|    WORD32 ctb_size;
  226|       |
  227|  1.11M|    WORD8 i1_loop_filter_across_tiles_enabled_flag;
  228|  1.11M|    WORD8 i1_loop_filter_across_slices_enabled_flag;
  229|       |
  230|  1.11M|    WORD32 i;
  231|       |
  232|  1.11M|    PROFILE_DISABLE_BOUNDARY_STRENGTH();
  ------------------
  |  |   84|  1.11M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  233|       |
  234|  1.11M|    ps_pps = ps_bs_ctxt->ps_pps;
  235|  1.11M|    ps_sps = ps_bs_ctxt->ps_sps;
  236|  1.11M|    i1_loop_filter_across_tiles_enabled_flag = ps_pps->i1_loop_filter_across_tiles_enabled_flag;
  237|  1.11M|    i1_loop_filter_across_slices_enabled_flag = ps_bs_ctxt->ps_slice_hdr->i1_slice_loop_filter_across_slices_enabled_flag;
  238|  1.11M|    i4_tu_cnt = ps_bs_ctxt->i4_ctb_tu_cnt;
  239|       |
  240|  1.11M|    log2_ctb_size = ps_sps->i1_log2_ctb_size;
  241|  1.11M|    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|  1.11M|    bs_strd = (ps_sps->i2_pic_wd_in_ctb + 1) << (2 * log2_ctb_size - 7);
  246|       |
  247|  1.11M|    pu4_vert_bs = (UWORD32 *)((UWORD8 *)ps_bs_ctxt->pu4_pic_vert_bs +
  248|  1.11M|                    (ps_bs_ctxt->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  249|  1.11M|                    ps_bs_ctxt->i4_ctb_y * bs_strd);
  250|  1.11M|    pu4_horz_bs = (UWORD32 *)((UWORD8 *)ps_bs_ctxt->pu4_pic_horz_bs +
  251|  1.11M|                    (ps_bs_ctxt->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  252|  1.11M|                    ps_bs_ctxt->i4_ctb_y * bs_strd);
  253|       |
  254|       |    /* ctb_size/8 elements per CTB */
  255|  1.11M|    qp_strd = ps_sps->i2_pic_wd_in_ctb << (log2_ctb_size - 3);
  256|  1.11M|    pu1_qp = ps_bs_ctxt->pu1_pic_qp + ((ps_bs_ctxt->i4_ctb_x + ps_bs_ctxt->i4_ctb_y * qp_strd) << (log2_ctb_size - 3));
  257|       |
  258|  1.11M|    ctb_indx = ps_bs_ctxt->i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_bs_ctxt->i4_ctb_y;
  259|  1.11M|    u4_qp_const_in_ctb = ps_bs_ctxt->pu1_pic_qp_const_in_ctb[ctb_indx >> 3] & (1 << (ctb_indx & 7));
  260|       |
  261|  1.11M|    vert_bs0_tmp = pu4_vert_bs[0] & (0xFFFFFFFF >> (sizeof(UWORD32) * 8 - ctb_size / 2));
  262|  1.11M|    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|  1.11M|    memset(pu4_vert_bs, 0, (1 << (2 * log2_ctb_size - 7)) + ((ctb_size >> 5) << 1));
  273|  1.11M|    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|  1.11M|    if(0 != ps_bs_ctxt->i4_ctb_x)
  ------------------
  |  Branch (276:8): [True: 1.07M, False: 36.0k]
  ------------------
  277|  1.07M|    {
  278|  1.07M|        pu4_vert_bs[0] |= vert_bs0_tmp;
  279|  1.07M|    }
  280|       |
  281|       |    /* pu4_horz_bs[0] has information about the top CTB which is not required when ctb_y = 0 */
  282|  1.11M|    if(0 != ps_bs_ctxt->i4_ctb_y)
  ------------------
  |  Branch (282:8): [True: 911k, False: 204k]
  ------------------
  283|   911k|    {
  284|   911k|        pu4_horz_bs[0] |= horz_bs0_tmp;
  285|   911k|    }
  286|       |
  287|  1.11M|    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|  1.11M|    if(u4_qp_const_in_ctb)
  ------------------
  |  Branch (290:8): [True: 1.02M, False: 90.8k]
  ------------------
  291|  1.02M|        pu1_qp[0] = ps_tu->b7_qp;
  292|       |
  293|  19.3M|    for(i = 0; i < i4_tu_cnt; i++)
  ------------------
  |  Branch (293:16): [True: 18.2M, False: 1.11M]
  ------------------
  294|  18.2M|    {
  295|  18.2M|        WORD32 start_pos_x;
  296|  18.2M|        WORD32 start_pos_y;
  297|  18.2M|        WORD32 tu_size;
  298|       |
  299|       |
  300|  18.2M|        UWORD32 u4_bs;
  301|  18.2M|        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|  18.2M|        start_pos_x = ps_tu->b4_pos_x;
  305|  18.2M|        start_pos_y = ps_tu->b4_pos_y;
  306|       |
  307|  18.2M|        tu_size = 1 << (ps_tu->b3_size + 2);
  308|  18.2M|        tu_size >>= 2; /* TU size divided by 4 */
  309|       |
  310|  18.2M|        u4_bs = DUP_LSB_10(tu_size);
  ------------------
  |  |   78|  18.2M|#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|  18.2M|        if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (313:12): [True: 17.5M, False: 639k]
  ------------------
  314|  17.5M|        {
  315|  17.5M|            WORD32 shift;
  316|  17.5M|            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|  17.5M|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (321:16): [True: 45.2k, False: 17.5M]
  ------------------
  322|  45.2k|                shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  323|  17.5M|            pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  324|  17.5M|        }
  325|       |        /* Only if the current edge falls on 8 pixel grid set BS */
  326|  18.2M|        if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (326:12): [True: 17.5M, False: 639k]
  ------------------
  327|  17.5M|        {
  328|  17.5M|            WORD32 shift;
  329|  17.5M|            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|  17.5M|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (334:16): [True: 45.2k, False: 17.5M]
  ------------------
  335|  45.2k|                shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  336|  17.5M|            pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  337|  17.5M|        }
  338|       |
  339|       |        /* Populating the QP array */
  340|  18.2M|        if(0 == u4_qp_const_in_ctb)
  ------------------
  |  Branch (340:12): [True: 1.03M, False: 17.2M]
  ------------------
  341|  1.03M|        {
  342|  1.03M|            if(0 == (start_pos_x & 1) && 0 == (start_pos_y & 1))
  ------------------
  |  Branch (342:16): [True: 809k, False: 220k]
  |  Branch (342:42): [True: 699k, False: 110k]
  ------------------
  343|   699k|            {
  344|   699k|                WORD32 row, col;
  345|  2.46M|                for(row = start_pos_y; row < start_pos_y + tu_size; row += 2)
  ------------------
  |  Branch (345:40): [True: 1.76M, False: 699k]
  ------------------
  346|  1.76M|                {
  347|  7.36M|                    for(col = start_pos_x; col < start_pos_x + tu_size; col += 2)
  ------------------
  |  Branch (347:44): [True: 5.60M, False: 1.76M]
  ------------------
  348|  5.60M|                    {
  349|  5.60M|                        pu1_qp[(row >> 1) * qp_strd + (col >> 1)] = ps_tu->b7_qp;
  350|  5.60M|                    }
  351|  1.76M|                }
  352|   699k|            }
  353|  1.03M|        }
  354|       |
  355|  18.2M|    }
  356|  1.11M|    {
  357|       |        /*Determine if the slice is dependent, and is its left neighbor belongs to the same slice, in a different tile*/
  358|  1.11M|        UWORD32 ctb_addr;
  359|  1.11M|        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|  1.11M|        if(!ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (361:12): [True: 1.10M, False: 12.0k]
  ------------------
  362|  1.10M|        {
  363|  1.10M|            if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_x) ||
  ------------------
  |  Branch (363:17): [True: 1.10M, False: 18.4E]
  |  Branch (363:66): [True: 35.6k, False: 1.06M]
  ------------------
  364|  1.10M|                            (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: 640k, False: 428k]
  |  Branch (364:80): [True: 51, False: 640k]
  |  Branch (364:115): [True: 7, False: 44]
  ------------------
  365|  1.10M|                            (0 == ps_bs_ctxt->i4_ctb_x))
  ------------------
  |  Branch (365:29): [True: 18.4E, False: 1.06M]
  ------------------
  366|  35.6k|            {
  367|  35.6k|                pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (367:35): [True: 34.5k, False: 1.12k]
  ------------------
  368|  35.6k|            }
  369|  1.10M|        }
  370|  12.0k|        else
  371|  12.0k|        {
  372|       |            //If across-tiles is disabled
  373|  12.0k|            if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_x))
  ------------------
  |  Branch (373:17): [True: 11.8k, False: 205]
  |  Branch (373:66): [True: 8.80k, False: 3.06k]
  ------------------
  374|  8.80k|            {
  375|  8.80k|                pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (375:35): [True: 8.69k, False: 106]
  ------------------
  376|  8.80k|            }
  377|  3.26k|            else
  378|  3.26k|            {
  379|  3.26k|                ctb_addr = ps_bs_ctxt->i4_ctb_x + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  380|  3.26k|                slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  381|  3.26k|                if(ps_bs_ctxt->i4_ctb_x)
  ------------------
  |  Branch (381:20): [True: 3.18k, False: 79]
  ------------------
  382|  3.18k|                {
  383|  3.18k|                    ctb_addr = (ps_bs_ctxt->i4_ctb_x - 1) + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  384|  3.18k|                    left_slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  385|  3.18k|                }
  386|       |                /*If the 1st slice in a new tile is a dependent slice*/
  387|  3.26k|                if(!((ps_bs_ctxt->ps_slice_hdr->i1_dependent_slice_flag == 1) && (slice_idx == left_slice_idx)))
  ------------------
  |  Branch (387:22): [True: 0, False: 3.26k]
  |  Branch (387:82): [True: 0, False: 0]
  ------------------
  388|  3.24k|                {
  389|       |                    /* Removed reduntant checks */
  390|  3.24k|                    if((0 == i1_loop_filter_across_slices_enabled_flag && (
  ------------------
  |  Branch (390:25): [True: 3.10k, False: 147]
  ------------------
  391|  3.10k|                                    ((slice_idx != left_slice_idx) && 0 == ps_bs_ctxt->i4_ctb_slice_y) ||
  ------------------
  |  Branch (391:38): [True: 47, False: 3.05k]
  |  Branch (391:71): [True: 11, False: 36]
  ------------------
  392|  3.10k|                                    ((0 == ps_bs_ctxt->i4_ctb_tile_x) && (slice_idx != left_slice_idx)))) ||
  ------------------
  |  Branch (392:38): [True: 36, False: 3.05k]
  |  Branch (392:74): [True: 36, False: 0]
  ------------------
  393|  3.24k|                                    (0 == ps_bs_ctxt->i4_ctb_x))
  ------------------
  |  Branch (393:37): [True: 14, False: 3.18k]
  ------------------
  394|     61|                    {
  395|     61|                        pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (395:43): [True: 45, False: 16]
  ------------------
  396|     61|                    }
  397|  3.24k|                }
  398|  3.26k|            }
  399|  12.0k|        }
  400|       |
  401|  1.11M|        ctb_addr = ps_bs_ctxt->i4_ctb_x + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  402|  1.11M|        slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  403|  1.11M|        if(ps_bs_ctxt->i4_ctb_y)
  ------------------
  |  Branch (403:12): [True: 911k, False: 204k]
  ------------------
  404|   911k|        {
  405|   911k|            ctb_addr = (ps_bs_ctxt->i4_ctb_x) + ((ps_bs_ctxt->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb);
  406|   911k|            top_slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  407|   911k|        }
  408|       |
  409|       |        /* If top neighbor is not available, then set BS for entire first row to zero */
  410|       |        /* Removed reduntant checks */
  411|  1.11M|        if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_y)
  ------------------
  |  Branch (411:13): [True: 1.11M, False: 207]
  |  Branch (411:62): [True: 204k, False: 911k]
  ------------------
  412|  1.11M|                        || (0 == i1_loop_filter_across_slices_enabled_flag && ((slice_idx != top_slice_idx)))
  ------------------
  |  Branch (412:29): [True: 528k, False: 383k]
  |  Branch (412:79): [True: 17, False: 528k]
  ------------------
  413|  1.11M|                        || (0 == ps_bs_ctxt->i4_ctb_y))
  ------------------
  |  Branch (413:28): [True: 91, False: 911k]
  ------------------
  414|   204k|        {
  415|   204k|            pu4_horz_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (415:31): [True: 200k, False: 4.37k]
  ------------------
  416|   204k|        }
  417|  1.11M|    }
  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|  1.11M|    {
  424|  1.11M|        WORD32 num_rows_remaining = (ps_sps->i2_pic_height_in_luma_samples - (ps_bs_ctxt->i4_ctb_y << log2_ctb_size)) >> 3;
  425|  1.11M|        WORD32 num_cols_remaining = (ps_sps->i2_pic_width_in_luma_samples - (ps_bs_ctxt->i4_ctb_x << log2_ctb_size)) >> 3;
  426|  1.11M|        if(num_rows_remaining < (ctb_size >> 3))
  ------------------
  |  Branch (426:12): [True: 61.4k, False: 1.05M]
  ------------------
  427|  61.4k|        {
  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|  61.4k|            WORD32 offset;
  433|  61.4k|            offset = (num_rows_remaining >> (6 - log2_ctb_size)) << 2;
  434|  61.4k|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (434:16): [True: 876, False: 60.5k]
  ------------------
  435|    876|                offset += (num_rows_remaining & 1) << (log2_ctb_size - 4);
  436|       |
  437|  61.4k|            memset(((UWORD8 *)pu4_horz_bs) + offset, 0, 1 << (log2_ctb_size - 4));
  438|  61.4k|        }
  439|       |
  440|  1.11M|        if(num_cols_remaining < (ctb_size >> 3))
  ------------------
  |  Branch (440:12): [True: 14.3k, False: 1.10M]
  ------------------
  441|  14.3k|        {
  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|  14.3k|            WORD32 offset;
  448|  14.3k|            offset = (num_cols_remaining >> (6 - log2_ctb_size)) << 2;
  449|  14.3k|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (449:16): [True: 1.01k, False: 13.3k]
  ------------------
  450|  1.01k|                offset += (num_cols_remaining & 1) << (log2_ctb_size - 4);
  451|       |
  452|  14.3k|            memset(((UWORD8 *)pu4_vert_bs) + offset, 0, 1 << (log2_ctb_size - 4));
  453|  14.3k|        }
  454|  1.11M|    }
  455|       |
  456|  1.11M|    return 0;
  457|  1.11M|}
ihevcd_ctb_boundary_strength_pbslice:
  459|   408k|{
  460|   408k|    sps_t *ps_sps;
  461|   408k|    pps_t *ps_pps;
  462|   408k|    WORD32 cur_ctb_idx, next_ctb_idx = 0;
  463|   408k|    WORD32 i4_tu_cnt;
  464|   408k|    WORD32 i4_pu_cnt;
  465|   408k|    tu_t *ps_tu;
  466|       |
  467|   408k|    UWORD32 *pu4_vert_bs;
  468|   408k|    UWORD32 *pu4_horz_bs;
  469|   408k|    WORD32 bs_strd;
  470|   408k|    WORD32 vert_bs0_tmp;
  471|   408k|    WORD32 horz_bs0_tmp;
  472|   408k|    UWORD8 *pu1_qp;
  473|   408k|    WORD32 qp_strd;
  474|   408k|    UWORD32 u4_qp_const_in_ctb;
  475|   408k|    WORD32 ctb_indx;
  476|   408k|    WORD32 log2_ctb_size;
  477|   408k|    WORD32 ctb_size;
  478|       |
  479|   408k|    WORD32 i;
  480|   408k|    WORD8 i1_loop_filter_across_tiles_enabled_flag;
  481|   408k|    WORD8 i1_loop_filter_across_slices_enabled_flag;
  482|       |
  483|   408k|    PROFILE_DISABLE_BOUNDARY_STRENGTH();
  ------------------
  |  |   84|   408k|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  484|       |
  485|   408k|    ps_sps = ps_bs_ctxt->ps_sps;
  486|   408k|    ps_pps = ps_bs_ctxt->ps_pps;
  487|       |
  488|   408k|    log2_ctb_size = ps_sps->i1_log2_ctb_size;
  489|   408k|    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|   408k|    bs_strd = (ps_sps->i2_pic_wd_in_ctb + 1) << (2 * log2_ctb_size - 7);
  494|       |
  495|   408k|    pu4_vert_bs = (UWORD32 *)((UWORD8 *)ps_bs_ctxt->pu4_pic_vert_bs +
  496|   408k|                    (ps_bs_ctxt->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  497|   408k|                    ps_bs_ctxt->i4_ctb_y * bs_strd);
  498|   408k|    pu4_horz_bs = (UWORD32 *)((UWORD8 *)ps_bs_ctxt->pu4_pic_horz_bs +
  499|   408k|                    (ps_bs_ctxt->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  500|   408k|                    ps_bs_ctxt->i4_ctb_y * bs_strd);
  501|       |
  502|   408k|    vert_bs0_tmp = pu4_vert_bs[0] & (0xFFFFFFFF >> (sizeof(UWORD32) * 8 - ctb_size / 2));
  503|   408k|    horz_bs0_tmp = pu4_horz_bs[0] & (0xFFFFFFFF >> (sizeof(UWORD32) * 8 - ctb_size / 2));
  504|       |
  505|   408k|    ps_tu = ps_bs_ctxt->ps_tu;
  506|       |
  507|       |    /* ctb_size/8 elements per CTB */
  508|   408k|    qp_strd = ps_sps->i2_pic_wd_in_ctb << (log2_ctb_size - 3);
  509|   408k|    pu1_qp = ps_bs_ctxt->pu1_pic_qp + ((ps_bs_ctxt->i4_ctb_x + ps_bs_ctxt->i4_ctb_y * qp_strd) << (log2_ctb_size - 3));
  510|       |
  511|   408k|    ctb_indx = ps_bs_ctxt->i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_bs_ctxt->i4_ctb_y;
  512|   408k|    u4_qp_const_in_ctb = ps_bs_ctxt->pu1_pic_qp_const_in_ctb[ctb_indx >> 3] & (1 << (ctb_indx & 7));
  513|       |
  514|   408k|    i1_loop_filter_across_tiles_enabled_flag = ps_pps->i1_loop_filter_across_tiles_enabled_flag;
  515|   408k|    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|   408k|    memset(pu4_vert_bs, 0, (1 << (2 * log2_ctb_size - 7)) + (ctb_size >> 4));
  526|   408k|    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|   408k|    if(0 != ps_bs_ctxt->i4_ctb_x)
  ------------------
  |  Branch (529:8): [True: 344k, False: 64.0k]
  ------------------
  530|   344k|    {
  531|   344k|        pu4_vert_bs[0] |= vert_bs0_tmp;
  532|   344k|    }
  533|       |
  534|       |    /* pu4_horz_bs[0] has information about the top CTB which is not required when ctb_y = 0 */
  535|   408k|    if(0 != ps_bs_ctxt->i4_ctb_y)
  ------------------
  |  Branch (535:8): [True: 393k, False: 15.0k]
  ------------------
  536|   393k|    {
  537|   393k|        pu4_horz_bs[0] |= horz_bs0_tmp;
  538|   393k|    }
  539|       |    /* pu4_horz_bs[bs_strd / 4] corresponds to pu4_horz_bs[0] of the bottom CTB */
  540|   408k|    *(UWORD32 *)((UWORD8 *)pu4_horz_bs + bs_strd) = 0;
  541|       |
  542|   408k|    cur_ctb_idx = ps_bs_ctxt->i4_ctb_x
  543|   408k|                    + ps_bs_ctxt->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  544|   408k|    next_ctb_idx = ps_bs_ctxt->i4_next_tu_ctb_cnt;
  545|   408k|    if(1 == ps_bs_ctxt->ps_codec->i4_num_cores)
  ------------------
  |  Branch (545:8): [True: 14.6k, False: 393k]
  ------------------
  546|  14.6k|    {
  547|  14.6k|        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];
  ------------------
  |  |  179|  14.6k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  170|  14.6k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  14.6k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  14.6k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  14.6k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  14.6k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  548|  14.6k|    }
  549|   393k|    else
  550|   393k|    {
  551|   393k|        i4_tu_cnt = ps_bs_ctxt->pu4_pic_tu_idx[next_ctb_idx] - ps_bs_ctxt->pu4_pic_tu_idx[cur_ctb_idx];
  552|   393k|    }
  553|       |
  554|   408k|    ps_tu = ps_bs_ctxt->ps_tu;
  555|   408k|    if(u4_qp_const_in_ctb)
  ------------------
  |  Branch (555:8): [True: 392k, False: 15.4k]
  ------------------
  556|   392k|        pu1_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|  6.64M|    for(i = 0; i < i4_tu_cnt; i++)
  ------------------
  |  Branch (559:16): [True: 6.23M, False: 408k]
  ------------------
  560|  6.23M|    {
  561|  6.23M|        WORD32 start_pos_x;
  562|  6.23M|        WORD32 start_pos_y;
  563|  6.23M|        WORD32 end_pos_x;
  564|  6.23M|        WORD32 end_pos_y;
  565|  6.23M|        WORD32 tu_size;
  566|  6.23M|        UWORD32 u4_bs;
  567|  6.23M|        WORD32 intra_flag;
  568|  6.23M|        UWORD8 *pu1_pic_intra_flag;
  569|       |
  570|  6.23M|        ps_tu = ps_bs_ctxt->ps_tu + i;
  571|       |
  572|  6.23M|        start_pos_x = ps_tu->b4_pos_x;
  573|  6.23M|        start_pos_y = ps_tu->b4_pos_y;
  574|       |
  575|  6.23M|        tu_size = 1 << (ps_tu->b3_size + 2);
  576|  6.23M|        tu_size >>= 2;
  577|       |
  578|  6.23M|        end_pos_x = start_pos_x + tu_size;
  579|  6.23M|        end_pos_y = start_pos_y + tu_size;
  580|       |
  581|  6.23M|        {
  582|  6.23M|            WORD32 tu_abs_x = (ps_bs_ctxt->i4_ctb_x << log2_ctb_size) + (start_pos_x << 2);
  583|  6.23M|            WORD32 tu_abs_y = (ps_bs_ctxt->i4_ctb_y << log2_ctb_size) + (start_pos_y << 2);
  584|       |
  585|  6.23M|            WORD32 numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
  586|       |
  587|  6.23M|            pu1_pic_intra_flag = ps_bs_ctxt->ps_codec->pu1_pic_intra_flag;
  588|  6.23M|            pu1_pic_intra_flag += (tu_abs_y >> 3) * numbytes_row;
  589|  6.23M|            pu1_pic_intra_flag += (tu_abs_x >> 6);
  590|       |
  591|  6.23M|            intra_flag = *pu1_pic_intra_flag;
  592|  6.23M|            intra_flag &= (1 << ((tu_abs_x >> 3) % 8));
  593|  6.23M|        }
  594|  6.23M|        if(intra_flag)
  ------------------
  |  Branch (594:12): [True: 97.3k, False: 6.13M]
  ------------------
  595|  97.3k|        {
  596|  97.3k|            u4_bs = DUP_LSB_10(tu_size);
  ------------------
  |  |   78|  97.3k|#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|  97.3k|            if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (599:16): [True: 80.2k, False: 17.1k]
  ------------------
  600|  80.2k|            {
  601|  80.2k|                WORD32 shift;
  602|  80.2k|                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|  80.2k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (607:20): [True: 2.09k, False: 78.1k]
  ------------------
  608|  2.09k|                    shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  609|  80.2k|                pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  610|  80.2k|            }
  611|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  612|  97.3k|            if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (612:16): [True: 80.2k, False: 17.1k]
  ------------------
  613|  80.2k|            {
  614|  80.2k|                WORD32 shift;
  615|  80.2k|                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|  80.2k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (620:20): [True: 2.09k, False: 78.1k]
  ------------------
  621|  2.09k|                    shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  622|  80.2k|                pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  623|  80.2k|            }
  624|  97.3k|        }
  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|  6.23M|        if(ps_tu->b1_y_cbf)
  ------------------
  |  Branch (628:12): [True: 94.1k, False: 6.13M]
  ------------------
  629|  94.1k|        {
  630|  94.1k|            u4_bs = DUP_LSB_01(tu_size);
  ------------------
  |  |   75|  94.1k|#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|  94.1k|            if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (633:16): [True: 76.0k, False: 18.0k]
  ------------------
  634|  76.0k|            {
  635|  76.0k|                WORD32 shift;
  636|  76.0k|                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|  76.0k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (641:20): [True: 3.92k, False: 72.1k]
  ------------------
  642|  3.92k|                    shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  643|  76.0k|                pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  644|  76.0k|            }
  645|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  646|  94.1k|            if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (646:16): [True: 75.7k, False: 18.4k]
  ------------------
  647|  75.7k|            {
  648|  75.7k|                WORD32 shift;
  649|  75.7k|                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|  75.7k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (654:20): [True: 3.70k, False: 72.0k]
  ------------------
  655|  3.70k|                    shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  656|  75.7k|                pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  657|  75.7k|            }
  658|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  659|  94.1k|            if(0 == (end_pos_x & 1))
  ------------------
  |  Branch (659:16): [True: 75.7k, False: 18.4k]
  ------------------
  660|  75.7k|            {
  661|  75.7k|                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: 21.0k, False: 54.7k]
  |  Branch (661:58): [True: 671, False: 20.3k]
  ------------------
  662|  75.0k|                {
  663|  75.0k|                    WORD32 shift;
  664|  75.0k|                    shift = start_pos_y * 2;
  665|  75.0k|                    shift += (((end_pos_x >> 1) & ((MAX_CTB_SIZE >> log2_ctb_size) - 1)) << (log2_ctb_size - 1));
  ------------------
  |  |  341|  75.0k|#define MAX_CTB_SIZE        64
  ------------------
  666|  75.0k|                    pu4_vert_bs[end_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  667|  75.0k|                }
  668|  75.7k|            }
  669|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  670|  94.1k|            if(0 == (end_pos_y & 1))
  ------------------
  |  Branch (670:16): [True: 76.0k, False: 18.0k]
  ------------------
  671|  76.0k|            {
  672|       |                /* If end_pos_y corresponds to the bottom of the CTB, write to pu4_horz_bs[0] of the bottom CTB */
  673|  76.0k|                if(ctb_size / 8 == (end_pos_y >> 1))
  ------------------
  |  Branch (673:20): [True: 20.0k, False: 55.9k]
  ------------------
  674|  20.0k|                {
  675|  20.0k|                    *(UWORD32 *)((UWORD8 *)pu4_horz_bs + bs_strd) |= (u4_bs << (start_pos_x * 2));
  676|  20.0k|                }
  677|  55.9k|                else
  678|  55.9k|                {
  679|  55.9k|                    WORD32 shift;
  680|  55.9k|                    shift = start_pos_x * 2;
  681|  55.9k|                    shift += (((end_pos_y >> 1) & ((MAX_CTB_SIZE >> log2_ctb_size) - 1)) << (log2_ctb_size - 1));
  ------------------
  |  |  341|  55.9k|#define MAX_CTB_SIZE        64
  ------------------
  682|  55.9k|                    pu4_horz_bs[end_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  683|  55.9k|                }
  684|  76.0k|            }
  685|  94.1k|        }
  686|       |
  687|  6.23M|        if(0 == u4_qp_const_in_ctb)
  ------------------
  |  Branch (687:12): [True: 195k, False: 6.03M]
  ------------------
  688|   195k|        {
  689|   195k|            if(0 == (start_pos_x & 1) && 0 == (start_pos_y & 1))
  ------------------
  |  Branch (689:16): [True: 163k, False: 32.6k]
  |  Branch (689:42): [True: 146k, False: 16.3k]
  ------------------
  690|   146k|            {
  691|   146k|                WORD32 row, col;
  692|   407k|                for(row = start_pos_y; row < start_pos_y + tu_size; row += 2)
  ------------------
  |  Branch (692:40): [True: 261k, False: 146k]
  ------------------
  693|   261k|                {
  694|   910k|                    for(col = start_pos_x; col < start_pos_x + tu_size; col += 2)
  ------------------
  |  Branch (694:44): [True: 649k, False: 261k]
  ------------------
  695|   649k|                    {
  696|   649k|                        pu1_qp[(row >> 1) * qp_strd + (col >> 1)] = ps_tu->b7_qp;
  697|   649k|                    }
  698|   261k|                }
  699|   146k|            }
  700|   195k|        }
  701|  6.23M|    }
  702|       |
  703|       |    /* For all PUs in the CTB,
  704|       |    For left and top edges, compute BS */
  705|       |
  706|   408k|    cur_ctb_idx = ps_bs_ctxt->i4_ctb_x
  707|   408k|                    + ps_bs_ctxt->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  708|       |
  709|   408k|    {
  710|   408k|        WORD32 next_ctb_idx;
  711|   408k|        next_ctb_idx = ps_bs_ctxt->i4_next_pu_ctb_cnt;
  712|   408k|        i4_pu_cnt = ps_bs_ctxt->pu4_pic_pu_idx[next_ctb_idx] - ps_bs_ctxt->pu4_pic_pu_idx[cur_ctb_idx];
  713|   408k|    }
  714|       |
  715|  6.57M|    for(i = 0; i < i4_pu_cnt; i++)
  ------------------
  |  Branch (715:16): [True: 6.16M, False: 408k]
  ------------------
  716|  6.16M|    {
  717|  6.16M|        WORD32 start_pos_x;
  718|  6.16M|        WORD32 start_pos_y;
  719|  6.16M|        WORD32 end_pos_x;
  720|  6.16M|        WORD32 end_pos_y;
  721|  6.16M|        WORD32 pu_wd, pu_ht;
  722|  6.16M|        UWORD32 u4_bs;
  723|  6.16M|        pu_t *ps_pu = ps_bs_ctxt->ps_pu + i;
  724|  6.16M|        pu_t *ps_ngbr_pu;
  725|  6.16M|        UWORD32 u4_ngbr_pu_indx;
  726|       |
  727|  6.16M|        start_pos_x = ps_pu->b4_pos_x;
  728|  6.16M|        start_pos_y = ps_pu->b4_pos_y;
  729|       |
  730|  6.16M|        pu_wd = (ps_pu->b4_wd + 1);
  731|  6.16M|        pu_ht = (ps_pu->b4_ht + 1);
  732|       |
  733|  6.16M|        end_pos_x = start_pos_x + pu_wd;
  734|  6.16M|        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|  6.16M|        if(ps_pu->b1_intra_flag)
  ------------------
  |  Branch (738:12): [True: 47.0k, False: 6.12M]
  ------------------
  739|  47.0k|        {
  740|  47.0k|            u4_bs = DUP_LSB_10(pu_ht);
  ------------------
  |  |   78|  47.0k|#define DUP_LSB_10(x) ((UWORD32)0xAAAAAAAA >> (32 - ((x) * 2)))
  ------------------
  741|       |
  742|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  743|  47.0k|            if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (743:16): [True: 47.0k, False: 0]
  ------------------
  744|  47.0k|            {
  745|  47.0k|                WORD32 shift;
  746|  47.0k|                shift = start_pos_y * 2;
  747|       |                /* shift += (((start_pos_x >> 1) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 1));
  748|       |                 *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  749|       |                 *  and deblocking is done on 8x8 grid
  750|       |                 */
  751|  47.0k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (751:20): [True: 330, False: 46.6k]
  ------------------
  752|    330|                    shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  753|  47.0k|                pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  754|  47.0k|            }
  755|       |
  756|  47.0k|            u4_bs = DUP_LSB_10(pu_wd);
  ------------------
  |  |   78|  47.0k|#define DUP_LSB_10(x) ((UWORD32)0xAAAAAAAA >> (32 - ((x) * 2)))
  ------------------
  757|       |
  758|       |            /* Only if the current edge falls on 8 pixel grid set BS */
  759|  47.0k|            if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (759:16): [True: 47.0k, False: 18.4E]
  ------------------
  760|  47.0k|            {
  761|  47.0k|                WORD32 shift;
  762|  47.0k|                shift = start_pos_x * 2;
  763|       |                /* shift += (((start_pos_y >> 1) & (MAX_CTB_SIZE / ctb_size - 1)) << (log2_ctb_size - 1));
  764|       |                 *  will reduce to the following assuming ctb size is one of 16, 32 and 64
  765|       |                 *  and deblocking is done on 8x8 grid
  766|       |                 */
  767|  47.0k|                if(6 != log2_ctb_size)
  ------------------
  |  Branch (767:20): [True: 330, False: 46.6k]
  ------------------
  768|    330|                    shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  769|  47.0k|                pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  770|  47.0k|            }
  771|  47.0k|        }
  772|       |
  773|  6.12M|        else
  774|  6.12M|        {
  775|       |            /* Vertical edge */
  776|       |            /* Process only if the edge is not a frame edge */
  777|  6.12M|            if(0 != ps_bs_ctxt->i4_ctb_x + start_pos_x)
  ------------------
  |  Branch (777:16): [True: 5.89M, False: 229k]
  ------------------
  778|  5.89M|            {
  779|  5.89M|                do
  780|  5.98M|                {
  781|  5.98M|                    WORD32 pu_ngbr_ht;
  782|  5.98M|                    WORD32 min_pu_ht;
  783|  5.98M|                    WORD32 ngbr_end_pos_y;
  784|  5.98M|                    UWORD32 ngbr_pu_idx_strd;
  785|  5.98M|                    ngbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  341|  5.98M|#define MAX_CTB_SIZE        64
  ------------------
                                  ngbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  357|  5.98M|#define MIN_PU_SIZE         4
  ------------------
  786|  5.98M|                    u4_ngbr_pu_indx = ps_bs_ctxt->pu4_pic_pu_idx_map[(start_pos_y + 1) * ngbr_pu_idx_strd + (start_pos_x)];
  787|  5.98M|                    ps_ngbr_pu = ps_bs_ctxt->ps_pic_pu + u4_ngbr_pu_indx;
  788|       |
  789|  5.98M|                    pu_ngbr_ht = ps_ngbr_pu->b4_ht + 1;
  790|  5.98M|                    ngbr_end_pos_y = ps_ngbr_pu->b4_pos_y + pu_ngbr_ht;
  791|       |
  792|  5.98M|                    min_pu_ht = MIN(ngbr_end_pos_y, end_pos_y) - start_pos_y;
  ------------------
  |  |   43|  5.98M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 97.1k, False: 5.89M]
  |  |  ------------------
  ------------------
  793|       |
  794|  5.98M|                    if(ps_ngbr_pu->b1_intra_flag)
  ------------------
  |  Branch (794:24): [True: 12.3k, False: 5.97M]
  ------------------
  795|  12.3k|                    {
  796|  12.3k|                        u4_bs = DUP_LSB_10(min_pu_ht);
  ------------------
  |  |   78|  12.3k|#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|  12.3k|                        if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (799:28): [True: 12.3k, False: 0]
  ------------------
  800|  12.3k|                        {
  801|  12.3k|                            WORD32 shift;
  802|  12.3k|                            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|  12.3k|                            if(6 != log2_ctb_size)
  ------------------
  |  Branch (807:32): [True: 342, False: 12.0k]
  ------------------
  808|    342|                                shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  809|  12.3k|                            pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  810|  12.3k|                        }
  811|  12.3k|                    }
  812|  5.97M|                    else
  813|  5.97M|                    {
  814|  5.97M|                        u4_bs = ihevcd_pu_boundary_strength(ps_pu, ps_ngbr_pu);
  815|  5.97M|                        if(u4_bs)
  ------------------
  |  Branch (815:28): [True: 295k, False: 5.67M]
  ------------------
  816|   295k|                        {
  817|   295k|                            u4_bs = DUP_LSB_01(min_pu_ht);
  ------------------
  |  |   75|   295k|#define DUP_LSB_01(x) ((UWORD32)0x55555555 >> (32 - ((x) * 2)))
  ------------------
  818|   295k|                            if(0 == (start_pos_x & 1))
  ------------------
  |  Branch (818:32): [True: 269k, False: 26.0k]
  ------------------
  819|   269k|                            {
  820|   269k|                                WORD32 shift;
  821|   269k|                                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|   269k|                                if(6 != log2_ctb_size)
  ------------------
  |  Branch (826:36): [True: 17.2k, False: 252k]
  ------------------
  827|  17.2k|                                    shift += ((start_pos_x & 2) << (log2_ctb_size - 2));
  828|   269k|                                pu4_vert_bs[start_pos_x >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  829|   269k|                            }
  830|   295k|                        }
  831|  5.97M|                    }
  832|       |
  833|  5.98M|                    pu_ht -= min_pu_ht;
  834|  5.98M|                    start_pos_y += min_pu_ht;
  835|  5.98M|                }while(pu_ht > 0);
  ------------------
  |  Branch (835:24): [True: 97.1k, False: 5.89M]
  ------------------
  836|       |
  837|       |                /* Reinitialising since the values are updated in the previous loop */
  838|  5.89M|                pu_ht = ps_pu->b4_ht + 1;
  839|  5.89M|                start_pos_y = ps_pu->b4_pos_y;
  840|  5.89M|            }
  841|       |
  842|       |            /* Horizontal edge */
  843|       |            /* Process only if the edge is not a frame edge */
  844|  6.12M|            if(0 != ps_bs_ctxt->i4_ctb_y + start_pos_y)
  ------------------
  |  Branch (844:16): [True: 6.08M, False: 37.1k]
  ------------------
  845|  6.08M|            {
  846|  6.08M|                do
  847|  6.18M|                {
  848|  6.18M|                    WORD32 pu_ngbr_wd;
  849|  6.18M|                    WORD32 min_pu_wd;
  850|  6.18M|                    WORD32 ngbr_end_pos_x;
  851|  6.18M|                    UWORD32 ngbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  341|  6.18M|#define MAX_CTB_SIZE        64
  ------------------
                                  UWORD32 ngbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  357|  6.18M|#define MIN_PU_SIZE         4
  ------------------
  852|  6.18M|                    u4_ngbr_pu_indx = ps_bs_ctxt->pu4_pic_pu_idx_map[(start_pos_y)*ngbr_pu_idx_strd + (start_pos_x + 1)];
  853|  6.18M|                    ps_ngbr_pu = ps_bs_ctxt->ps_pic_pu + u4_ngbr_pu_indx;
  854|       |
  855|  6.18M|                    pu_ngbr_wd = ps_ngbr_pu->b4_wd + 1;
  856|  6.18M|                    ngbr_end_pos_x = ps_ngbr_pu->b4_pos_x + pu_ngbr_wd;
  857|       |
  858|  6.18M|                    min_pu_wd = MIN(ngbr_end_pos_x, end_pos_x) - start_pos_x;
  ------------------
  |  |   43|  6.18M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 102k, False: 6.08M]
  |  |  ------------------
  ------------------
  859|       |
  860|  6.18M|                    if(ps_ngbr_pu->b1_intra_flag)
  ------------------
  |  Branch (860:24): [True: 17.1k, False: 6.16M]
  ------------------
  861|  17.1k|                    {
  862|  17.1k|                        u4_bs = DUP_LSB_10(min_pu_wd);
  ------------------
  |  |   78|  17.1k|#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|  17.1k|                        if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (865:28): [True: 17.1k, False: 0]
  ------------------
  866|  17.1k|                        {
  867|  17.1k|                            WORD32 shift;
  868|  17.1k|                            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|  17.1k|                            if(6 != log2_ctb_size)
  ------------------
  |  Branch (873:32): [True: 387, False: 16.7k]
  ------------------
  874|    387|                                shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  875|  17.1k|                            pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  876|  17.1k|                        }
  877|  17.1k|                    }
  878|  6.16M|                    else
  879|  6.16M|                    {
  880|  6.16M|                        u4_bs = ihevcd_pu_boundary_strength(ps_pu, ps_ngbr_pu);
  881|  6.16M|                        if(u4_bs)
  ------------------
  |  Branch (881:28): [True: 357k, False: 5.81M]
  ------------------
  882|   357k|                        {
  883|   357k|                            u4_bs = DUP_LSB_01(min_pu_wd);
  ------------------
  |  |   75|   357k|#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|   357k|                            if(0 == (start_pos_y & 1))
  ------------------
  |  Branch (886:32): [True: 334k, False: 22.9k]
  ------------------
  887|   334k|                            {
  888|   334k|                                WORD32 shift;
  889|   334k|                                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|   334k|                                if(6 != log2_ctb_size)
  ------------------
  |  Branch (894:36): [True: 12.7k, False: 322k]
  ------------------
  895|  12.7k|                                    shift += ((start_pos_y & 2) << (log2_ctb_size - 2));
  896|   334k|                                pu4_horz_bs[start_pos_y >> (7 - log2_ctb_size)] |= (u4_bs << shift);
  897|   334k|                            }
  898|   357k|                        }
  899|  6.16M|                    }
  900|       |
  901|  6.18M|                    pu_wd -= min_pu_wd;
  902|  6.18M|                    start_pos_x += min_pu_wd;
  903|  6.18M|                }while(pu_wd > 0);
  ------------------
  |  Branch (903:24): [True: 102k, False: 6.08M]
  ------------------
  904|       |
  905|       |                /* Reinitialising since the values are updated in the previous loop */
  906|  6.08M|                pu_wd = ps_pu->b4_wd + 1;
  907|  6.08M|                start_pos_x = ps_pu->b4_pos_x;
  908|  6.08M|            }
  909|  6.12M|        }
  910|  6.16M|    }
  911|       |
  912|   408k|    {
  913|       |        /* If left neighbor is not available, then set BS for entire first column to zero */
  914|   408k|        UWORD32 ctb_addr;
  915|   408k|        WORD32 slice_idx, left_slice_idx = -1, top_slice_idx = -1;
  916|       |
  917|   408k|        if(!ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (917:12): [True: 398k, False: 9.48k]
  ------------------
  918|   398k|        {
  919|   398k|            if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_x) ||
  ------------------
  |  Branch (919:17): [True: 398k, False: 18.4E]
  |  Branch (919:66): [True: 61.0k, False: 337k]
  ------------------
  920|   398k|                            (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: 306k, False: 31.1k]
  |  Branch (920:80): [True: 329, False: 306k]
  |  Branch (920:115): [True: 72, False: 257]
  ------------------
  921|   398k|                            (0 == ps_bs_ctxt->i4_ctb_x))
  ------------------
  |  Branch (921:29): [True: 18.4E, False: 337k]
  ------------------
  922|  61.1k|            {
  923|  61.1k|                pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (923:35): [True: 3.62k, False: 57.5k]
  ------------------
  924|  61.1k|            }
  925|   398k|        }
  926|  9.48k|        else
  927|  9.48k|        {
  928|  9.48k|            if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_x))
  ------------------
  |  Branch (928:17): [True: 8.49k, False: 993]
  |  Branch (928:66): [True: 1.15k, False: 7.33k]
  ------------------
  929|  1.15k|            {
  930|  1.15k|                pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (930:35): [True: 769, False: 387]
  ------------------
  931|  1.15k|            }
  932|  8.32k|            else
  933|  8.32k|            {
  934|       |
  935|  8.32k|                ctb_addr = ps_bs_ctxt->i4_ctb_x + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  936|  8.32k|                slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  937|       |
  938|  8.32k|                if(ps_bs_ctxt->i4_ctb_x)
  ------------------
  |  Branch (938:20): [True: 7.79k, False: 531]
  ------------------
  939|  7.79k|                {
  940|  7.79k|                    ctb_addr = (ps_bs_ctxt->i4_ctb_x - 1) + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  941|  7.79k|                    left_slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  942|  7.79k|                }
  943|       |
  944|  8.32k|                if(!((ps_bs_ctxt->ps_slice_hdr->i1_dependent_slice_flag == 1) && (slice_idx == left_slice_idx)))
  ------------------
  |  Branch (944:22): [True: 0, False: 8.32k]
  |  Branch (944:82): [True: 0, False: 0]
  ------------------
  945|  8.48k|                {
  946|       |                    /* Removed reduntant checks */
  947|  8.48k|                    if((0 == i1_loop_filter_across_slices_enabled_flag && (
  ------------------
  |  Branch (947:25): [True: 7.33k, False: 1.14k]
  ------------------
  948|  7.33k|                                    (0 == ps_bs_ctxt->i4_ctb_slice_x && 0 == ps_bs_ctxt->i4_ctb_slice_y) ||
  ------------------
  |  Branch (948:38): [True: 0, False: 7.33k]
  |  Branch (948:73): [True: 0, False: 0]
  ------------------
  949|  8.48k|                                    ((0 == ps_bs_ctxt->i4_ctb_tile_x) && (slice_idx != left_slice_idx)))) || (0 == ps_bs_ctxt->i4_ctb_x))
  ------------------
  |  Branch (949:38): [True: 0, False: 7.33k]
  |  Branch (949:74): [True: 0, False: 0]
  |  Branch (949:110): [True: 687, False: 7.79k]
  ------------------
  950|    687|                    {
  951|    687|                        pu4_vert_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (951:43): [True: 685, False: 2]
  ------------------
  952|    687|                    }
  953|  8.48k|                }
  954|  8.32k|            }
  955|  9.48k|        }
  956|       |
  957|   408k|        ctb_addr = ps_bs_ctxt->i4_ctb_x + (ps_bs_ctxt->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  958|   408k|        slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  959|   408k|        if(ps_bs_ctxt->i4_ctb_y)
  ------------------
  |  Branch (959:12): [True: 396k, False: 11.8k]
  ------------------
  960|   396k|        {
  961|   396k|            ctb_addr = (ps_bs_ctxt->i4_ctb_x) + ((ps_bs_ctxt->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb);
  962|   396k|            top_slice_idx = ps_bs_ctxt->pu1_slice_idx[ctb_addr];
  963|   396k|        }
  964|       |        /* If top neighbor is not available, then set BS for entire first row to zero */
  965|       |        /* Removed reduntant checks */
  966|   408k|        if((0 == i1_loop_filter_across_tiles_enabled_flag && 0 == ps_bs_ctxt->i4_ctb_tile_y)
  ------------------
  |  Branch (966:13): [True: 407k, False: 982]
  |  Branch (966:62): [True: 14.4k, False: 392k]
  ------------------
  967|   408k|                        || (0 == i1_loop_filter_across_slices_enabled_flag && ((slice_idx != top_slice_idx)))
  ------------------
  |  Branch (967:29): [True: 363k, False: 30.0k]
  |  Branch (967:79): [True: 122, False: 363k]
  ------------------
  968|   408k|                        || (0 == ps_bs_ctxt->i4_ctb_y))
  ------------------
  |  Branch (968:28): [True: 190, False: 393k]
  ------------------
  969|  14.7k|        {
  970|  14.7k|            pu4_horz_bs[0] &= (64 == ctb_size) ? 0 : ((UWORD32)0xFFFFFFFF) << (ctb_size / 2);
  ------------------
  |  Branch (970:31): [True: 10.6k, False: 4.07k]
  ------------------
  971|  14.7k|        }
  972|   408k|    }
  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|   408k|    {
  978|   408k|        WORD32 num_rows_remaining = (ps_sps->i2_pic_height_in_luma_samples - (ps_bs_ctxt->i4_ctb_y << log2_ctb_size)) >> 3;
  979|   408k|        WORD32 num_cols_remaining = (ps_sps->i2_pic_width_in_luma_samples - (ps_bs_ctxt->i4_ctb_x << log2_ctb_size)) >> 3;
  980|   408k|        if(num_rows_remaining < (ctb_size >> 3))
  ------------------
  |  Branch (980:12): [True: 9.92k, False: 398k]
  ------------------
  981|  9.92k|        {
  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|  9.92k|            WORD32 offset;
  987|  9.92k|            offset = (num_rows_remaining >> (6 - log2_ctb_size)) << 2;
  988|  9.92k|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (988:16): [True: 2.86k, False: 7.05k]
  ------------------
  989|  2.86k|                offset += (num_rows_remaining & 1) << (log2_ctb_size - 4);
  990|       |
  991|  9.92k|            memset(((UWORD8 *)pu4_horz_bs) + offset, 0, 1 << (log2_ctb_size - 4));
  992|  9.92k|        }
  993|       |
  994|   408k|        if(num_cols_remaining < (ctb_size >> 3))
  ------------------
  |  Branch (994:12): [True: 58.6k, False: 349k]
  ------------------
  995|  58.6k|        {
  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|  58.6k|            WORD32 offset;
 1002|  58.6k|            offset = (num_cols_remaining >> (6 - log2_ctb_size)) << 2;
 1003|  58.6k|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (1003:16): [True: 57.5k, False: 1.10k]
  ------------------
 1004|  57.5k|                offset += (num_cols_remaining & 1) << (log2_ctb_size - 4);
 1005|       |
 1006|  58.6k|            memset(((UWORD8 *)pu4_vert_bs) + offset, 0, 1 << (log2_ctb_size - 4));
 1007|  58.6k|        }
 1008|   408k|    }
 1009|   408k|    return 0;
 1010|   408k|}

ihevcd_cabac_init:
  137|  9.82k|{
  138|       |    /* Sanity checks */
  139|  9.82k|    ASSERT(ps_cabac != NULL);
  ------------------
  |  |   55|  9.82k|#define ASSERT(x) assert((x))
  ------------------
  140|  9.82k|    ASSERT(ps_bitstrm != NULL);
  ------------------
  |  |   55|  9.82k|#define ASSERT(x) assert((x))
  ------------------
  141|  9.82k|    ASSERT((qp >= 0) && (qp < 52));
  ------------------
  |  |   55|  9.82k|#define ASSERT(x) assert((x))
  ------------------
  142|  9.82k|    ASSERT((cabac_init_idc >= 0) && (cabac_init_idc < 3));
  ------------------
  |  |   55|  9.82k|#define ASSERT(x) assert((x))
  ------------------
  143|  9.82k|    UNUSED(qp);
  ------------------
  |  |   38|  9.82k|#define UNUSED(x) ((void)(x))
  ------------------
  144|  9.82k|    UNUSED(cabac_init_idc);
  ------------------
  |  |   38|  9.82k|#define UNUSED(x) ((void)(x))
  ------------------
  145|       |    /* CABAC engine uses 32 bit range instead of 9 bits as specified by
  146|       |     * the spec. This is done to reduce number of renormalizations
  147|       |     */
  148|       |    /* cabac engine initialization */
  149|  9.82k|#if FULLRANGE
  150|  9.82k|    ps_cabac->u4_range = (UWORD32)510 << RANGE_SHIFT;
  ------------------
  |  |   41|  9.82k|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  ------------------
  |  |  |  |   40|  9.82k|#define RANGE_NUMBITS 31
  |  |  ------------------
  ------------------
  151|  9.82k|    BITS_GET(ps_cabac->u4_ofst, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  150|  9.82k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|  9.82k|{                                                               \
  |  |  152|  9.82k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|  9.82k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|  9.82k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|  9.82k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|  9.82k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  19.6k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 6.42k, False: 3.40k]
  |  |  ------------------
  |  |  156|  9.82k|    {                                                           \
  |  |  157|  6.42k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|  6.42k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 6.42k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|  6.42k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|  6.42k|    }                                                           \
  |  |  160|  9.82k|                                                                \
  |  |  161|  9.82k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  19.6k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 6.42k, False: 3.40k]
  |  |  ------------------
  |  |  162|  9.82k|    {                                                           \
  |  |  163|  6.42k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|  6.42k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|  6.42k|        /* Getting the next word */                             \
  |  |  166|  6.42k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|  6.42k|                                                                \
  |  |  168|  6.42k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|  6.42k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|  6.42k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|  6.42k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|  6.42k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  6.42k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  6.42k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  6.42k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|  6.42k|    }                                                           \
  |  |  172|  9.82k|}
  ------------------
  152|  9.82k|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, (9 + RANGE_SHIFT));
  153|       |
  154|       |#else
  155|       |    ps_cabac->u4_range = (UWORD32)510;
  156|       |    BITS_GET(ps_cabac->u4_ofst, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  157|       |                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, 9);
  158|       |
  159|       |#endif
  160|       |
  161|       |    /* cabac context initialization based on init idc and slice qp */
  162|  9.82k|    memcpy(ps_cabac->au1_ctxt_models,
  163|  9.82k|           pu1_init_ctxt,
  164|  9.82k|           IHEVC_CAB_CTXT_END);
  165|  9.82k|    DEBUG_RANGE_OFST("init", ps_cabac->u4_range, ps_cabac->u4_ofst);
  166|       |
  167|       |    /*
  168|       |     * If the offset is greater than or equal to range, return fail.
  169|       |     */
  170|  9.82k|    if(ps_cabac->u4_ofst >= ps_cabac->u4_range)
  ------------------
  |  Branch (170:8): [True: 72, False: 9.75k]
  ------------------
  171|     72|    {
  172|     72|        return ((IHEVCD_ERROR_T)IHEVCD_FAIL);
  173|     72|    }
  174|       |
  175|  9.75k|    return ((IHEVCD_ERROR_T)IHEVCD_SUCCESS);
  176|  9.82k|}
ihevcd_cabac_reset:
  180|    428|{
  181|       |    /* Sanity checks */
  182|    428|    ASSERT(ps_cabac != NULL);
  ------------------
  |  |   55|    428|#define ASSERT(x) assert((x))
  ------------------
  183|    428|    ASSERT(ps_bitstrm != NULL);
  ------------------
  |  |   55|    428|#define ASSERT(x) assert((x))
  ------------------
  184|       |
  185|       |    /* CABAC engine uses 32 bit range instead of 9 bits as specified by
  186|       |     * the spec. This is done to reduce number of renormalizations
  187|       |     */
  188|       |    /* cabac engine initialization */
  189|    428|#if FULLRANGE
  190|    428|    ps_cabac->u4_range = (UWORD32)510 << RANGE_SHIFT;
  ------------------
  |  |   41|    428|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  ------------------
  |  |  |  |   40|    428|#define RANGE_NUMBITS 31
  |  |  ------------------
  ------------------
  191|    428|    BITS_GET(ps_cabac->u4_ofst, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  150|    428|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|    428|{                                                               \
  |  |  152|    428|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|    428|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|    428|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|    428|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|    428|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|    856|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 352, False: 76]
  |  |  ------------------
  |  |  156|    428|    {                                                           \
  |  |  157|    352|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|    352|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 352, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|    352|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|    352|    }                                                           \
  |  |  160|    428|                                                                \
  |  |  161|    428|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|    856|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 352, False: 76]
  |  |  ------------------
  |  |  162|    428|    {                                                           \
  |  |  163|    352|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|    352|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|    352|        /* Getting the next word */                             \
  |  |  166|    352|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|    352|                                                                \
  |  |  168|    352|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|    352|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|    352|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|    352|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|    352|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|    352|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|    352|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|    352|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|    352|    }                                                           \
  |  |  172|    428|}
  ------------------
  192|    428|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, (9 + RANGE_SHIFT));
  193|       |
  194|       |#else
  195|       |    ps_cabac->u4_range = (UWORD32)510;
  196|       |    BITS_GET(ps_cabac->u4_ofst, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  197|       |                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, 9);
  198|       |
  199|       |#endif
  200|       |
  201|    428|    return ((IHEVCD_ERROR_T)IHEVCD_SUCCESS);
  202|    428|}
ihevcd_cabac_decode_bin:
  234|  47.6M|{
  235|  47.6M|    UWORD32 u4_range = ps_cabac->u4_range;
  236|  47.6M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;
  237|  47.6M|    UWORD32 u4_rlps;
  238|  47.6M|    UWORD32 u4_bin;
  239|  47.6M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];
  240|  47.6M|    WORD32 state_mps = *pu1_ctxt_model;
  241|  47.6M|#if FULLRANGE
  242|  47.6M|    WORD32 clz;
  243|  47.6M|#endif
  244|  47.6M|    UWORD32 u4_qnt_range;
  245|       |
  246|       |    /* Sanity checks */
  247|  47.6M|    ASSERT(u4_range >= 256);
  ------------------
  |  |   55|  47.6M|#define ASSERT(x) assert((x))
  ------------------
  248|  47.6M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));
  ------------------
  |  |   55|  47.6M|#define ASSERT(x) assert((x))
  ------------------
  249|  47.6M|    ASSERT(state_mps < 128);
  ------------------
  |  |   55|  47.6M|#define ASSERT(x) assert((x))
  ------------------
  250|  47.6M|#if FULLRANGE
  251|  47.6M|    clz = CLZ(u4_range);
  252|  47.6M|    clz -= (32 - RANGE_NUMBITS);
  ------------------
  |  |   40|  47.6M|#define RANGE_NUMBITS 31
  ------------------
  253|  47.6M|    u4_qnt_range = u4_range << clz;
  254|  47.6M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;
  ------------------
  |  |   41|  47.6M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  ------------------
  |  |  |  |   40|  47.6M|#define RANGE_NUMBITS 31
  |  |  ------------------
  ------------------
  255|       |#else
  256|       |    u4_qnt_range = (u4_range >> 6) & 0x3;
  257|       |#endif
  258|       |    /* Get the lps range from LUT based on quantized range and state */
  259|  47.6M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];
  260|  47.6M|#if FULLRANGE
  261|  47.6M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);
  ------------------
  |  |   41|  47.6M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  ------------------
  |  |  |  |   40|  47.6M|#define RANGE_NUMBITS 31
  |  |  ------------------
  ------------------
  262|  47.6M|#endif
  263|  47.6M|    u4_range -= u4_rlps;
  264|       |
  265|  47.6M|    u4_bin = state_mps & 1;
  266|       |
  267|  47.6M|    if(u4_ofst >= u4_range)
  ------------------
  |  Branch (267:8): [True: 5.32M, False: 42.2M]
  ------------------
  268|  5.32M|    {
  269|  5.32M|        u4_bin = 1 - u4_bin;
  270|  5.32M|        u4_ofst -= u4_range;
  271|  5.32M|        u4_range = u4_rlps;
  272|  5.32M|    }
  273|       |
  274|  47.6M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];
  275|       |
  276|       |    /*****************************************************************/
  277|       |    /* Re-normalization; calculate bits generated based on range(R)  */
  278|       |    /*****************************************************************/
  279|  47.6M|    if(u4_range < (1 << 8))
  ------------------
  |  Branch (279:8): [True: 536k, False: 47.0M]
  ------------------
  280|   536k|    {
  281|   536k|        UWORD32 u4_bits;
  282|   536k|        WORD32 numbits;
  283|   536k|        numbits = CLZ(u4_range);
  284|   536k|        numbits -= (32 - RANGE_NUMBITS);
  ------------------
  |  |   40|   536k|#define RANGE_NUMBITS 31
  ------------------
  285|       |#if !FULLRANGE
  286|       |        numbits -= RANGE_SHIFT;
  287|       |#endif
  288|   536k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  150|   536k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|   536k|{                                                               \
  |  |  152|   536k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|   536k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|   536k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|   536k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|   536k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  1.07M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 376k, False: 160k]
  |  |  ------------------
  |  |  156|   536k|    {                                                           \
  |  |  157|   376k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|   376k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 376k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|   376k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|   376k|    }                                                           \
  |  |  160|   536k|                                                                \
  |  |  161|   536k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  1.07M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 391k, False: 145k]
  |  |  ------------------
  |  |  162|   536k|    {                                                           \
  |  |  163|   391k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|   391k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|   391k|        /* Getting the next word */                             \
  |  |  166|   391k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|   391k|                                                                \
  |  |  168|   391k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|   391k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|   391k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|   391k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|   391k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   391k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   391k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   391k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|   391k|    }                                                           \
  |  |  172|   536k|}
  ------------------
  289|   536k|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);
  290|       |
  291|   536k|        u4_ofst <<= numbits;
  292|   536k|        u4_ofst |= u4_bits;
  293|   536k|        u4_range <<= numbits;
  294|       |
  295|   536k|    }
  296|       |    /* Update the cabac context */
  297|  47.6M|    ps_cabac->u4_range = u4_range;
  298|  47.6M|    ps_cabac->u4_ofst = u4_ofst;
  299|  47.6M|    DEBUG_RANGE_OFST("bin", ps_cabac->u4_range, ps_cabac->u4_ofst);
  300|       |
  301|  47.6M|    return (u4_bin);
  302|       |
  303|       |
  304|  47.6M|}
ihevcd_cabac_decode_bypass_bin:
  326|  1.31M|{
  327|       |
  328|  1.31M|    UWORD32 u4_bin;
  329|  1.31M|    UWORD32 u4_range = ps_cabac->u4_range;
  330|  1.31M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;
  331|  1.31M|    UWORD32 u4_bits;
  332|       |
  333|       |    /* Sanity checks */
  334|  1.31M|    ASSERT(u4_range >= 256);
  ------------------
  |  |   55|  1.31M|#define ASSERT(x) assert((x))
  ------------------
  335|       |
  336|  1.31M|    BIT_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  182|  1.31M|                          m_u4_cur_word,m_u4_nxt_word)          \
  |  |  183|  1.31M|{                                                               \
  |  |  184|  1.31M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  185|  1.31M|                             >> (WORD_SIZE_MINUS1);             \
  |  |  ------------------
  |  |  |  |   51|  1.31M|#define WORD_SIZE_MINUS1  (WORD_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.31M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  186|  1.31M|    m_u4_bit_ofst++;                                            \
  |  |  187|  1.31M|                                                                \
  |  |  188|  1.31M|    if(m_u4_bit_ofst ==  WORD_SIZE)                             \
  |  |  ------------------
  |  |  |  |   42|  2.62M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (188:8): [True: 43.1k, False: 1.26M]
  |  |  ------------------
  |  |  189|  1.31M|    {                                                           \
  |  |  190|  43.1k|        UWORD32 pu4_word_tmp;                                   \
  |  |  191|  43.1k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  192|  43.1k|        /* Getting the next word */                             \
  |  |  193|  43.1k|        pu4_word_tmp = *m_pu4_buf++;                            \
  |  |  194|  43.1k|                                                                \
  |  |  195|  43.1k|        m_u4_bit_ofst = 0;                                      \
  |  |  196|  43.1k|        /* Swapping little endian to big endian conversion*/    \
  |  |  197|  43.1k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|  43.1k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|  43.1k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|  43.1k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|  43.1k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  198|  43.1k|    }                                                           \
  |  |  199|  1.31M|}
  ------------------
  337|  1.31M|            ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word);
  338|       |
  339|  1.31M|    u4_ofst <<= 1;
  340|  1.31M|    u4_ofst |= u4_bits;
  341|       |
  342|  1.31M|    u4_bin = 0;
  343|  1.31M|    if(u4_ofst >= u4_range)
  ------------------
  |  Branch (343:8): [True: 652k, False: 657k]
  ------------------
  344|   652k|    {
  345|   652k|        u4_bin = 1;
  346|   652k|        u4_ofst -= u4_range;
  347|   652k|    }
  348|       |
  349|       |    /* Update the cabac context */
  350|  1.31M|    ps_cabac->u4_ofst = u4_ofst;
  351|  1.31M|    DEBUG_RANGE_OFST("bypass end", ps_cabac->u4_range, ps_cabac->u4_ofst);
  352|  1.31M|    return (u4_bin);
  353|  1.31M|}
ihevcd_cabac_decode_terminate:
  376|  1.01M|{
  377|  1.01M|    UWORD32 u4_range = ps_cabac->u4_range;
  378|  1.01M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;
  379|  1.01M|    UWORD32 u4_bin;
  380|  1.01M|#if FULLRANGE
  381|  1.01M|    WORD32 clz;
  382|  1.01M|#endif
  383|       |    /* Sanity checks */
  384|  1.01M|    ASSERT(u4_range >= 256);
  ------------------
  |  |   55|  1.01M|#define ASSERT(x) assert((x))
  ------------------
  385|  1.01M|#if FULLRANGE
  386|  1.01M|    clz = CLZ(u4_range);
  387|  1.01M|    clz -= (32 - RANGE_NUMBITS);
  ------------------
  |  |   40|  1.01M|#define RANGE_NUMBITS 31
  ------------------
  388|  1.01M|    u4_range -= 2 << (RANGE_SHIFT - clz);
  ------------------
  |  |   41|  1.01M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  ------------------
  |  |  |  |   40|  1.01M|#define RANGE_NUMBITS 31
  |  |  ------------------
  ------------------
  389|       |#else
  390|       |    u4_range -= 2;
  391|       |#endif
  392|       |
  393|  1.01M|    if(u4_ofst >= u4_range)
  ------------------
  |  Branch (393:8): [True: 1.43k, False: 1.01M]
  ------------------
  394|  1.43k|    {
  395|  1.43k|        u4_bin = 1;
  396|       |
  397|  1.43k|#if FULLRANGE
  398|       |        /* In case of FULLRANGE extra bits read earlier need to pushed back to the bitstream */
  399|  1.43k|        {
  400|  1.43k|            WORD32 clz;
  401|  1.43k|            WORD32 numbits;
  402|  1.43k|            clz = CLZ(ps_cabac->u4_range);
  403|       |
  404|  1.43k|            numbits = (32 - clz);
  405|  1.43k|            numbits -= 9;
  406|       |
  407|  1.43k|            ihevcd_bits_seek(ps_bitstrm, -numbits);
  408|  1.43k|        }
  409|  1.43k|#endif
  410|       |
  411|  1.43k|    }
  412|  1.01M|    else
  413|  1.01M|    {
  414|  1.01M|        u4_bin = 0;
  415|  1.01M|    }
  416|  1.01M|    if(0 == u4_bin)
  ------------------
  |  Branch (416:8): [True: 1.01M, False: 1.43k]
  ------------------
  417|  1.01M|    {
  418|  1.01M|        UWORD32 u4_bits;
  419|  1.01M|        WORD32 numbits;
  420|  1.01M|        numbits = CLZ(u4_range);
  421|  1.01M|        numbits -= (32 - RANGE_NUMBITS);
  ------------------
  |  |   40|  1.01M|#define RANGE_NUMBITS 31
  ------------------
  422|       |#if !FULLRANGE
  423|       |        numbits -= RANGE_SHIFT;
  424|       |#endif
  425|       |        /* Renormalize if required */
  426|  1.01M|        if(numbits)
  ------------------
  |  Branch (426:12): [True: 968k, False: 49.8k]
  ------------------
  427|   968k|        {
  428|   968k|            BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  150|   968k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|   968k|{                                                               \
  |  |  152|   968k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|   968k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|   968k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|   968k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|   968k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  1.93M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 269k, False: 698k]
  |  |  ------------------
  |  |  156|   968k|    {                                                           \
  |  |  157|   269k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|   269k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 269k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|   269k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|   269k|    }                                                           \
  |  |  160|   968k|                                                                \
  |  |  161|   968k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  1.93M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 297k, False: 670k]
  |  |  ------------------
  |  |  162|   968k|    {                                                           \
  |  |  163|   297k|        UWORD32 pu4_word_tmp;                                   \
  |  |  164|   297k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  165|   297k|        /* Getting the next word */                             \
  |  |  166|   297k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  167|   297k|                                                                \
  |  |  168|   297k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  ------------------
  |  |  |  |   42|   297k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  169|   297k|        /* Swapping little endian to big endian conversion*/    \
  |  |  170|   297k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  ------------------
  |  |  |  |   63|   297k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   297k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   297k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   297k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  171|   297k|    }                                                           \
  |  |  172|   968k|}
  ------------------
  429|   968k|                     ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);
  430|       |
  431|   968k|            u4_ofst <<= numbits;
  432|   968k|            u4_ofst |= u4_bits;
  433|   968k|            u4_range <<= numbits;
  434|   968k|        }
  435|  1.01M|    }
  436|       |    /* bits to be inserted in the bitstream */
  437|  1.01M|    ps_cabac->u4_range = u4_range;
  438|  1.01M|    ps_cabac->u4_ofst = u4_ofst;
  439|  1.01M|    DEBUG_RANGE_OFST("term", ps_cabac->u4_range, ps_cabac->u4_ofst);
  440|       |
  441|  1.01M|    return (u4_bin);
  442|  1.01M|}
ihevcd_cabac_decode_bypass_bins:
  471|  6.72M|{
  472|  6.72M|    UWORD32 u4_bins;
  473|       |
  474|       |
  475|  6.72M|    UWORD32 u4_range = ps_cabac->u4_range;
  476|  6.72M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;
  477|  6.72M|    UWORD32 u4_bits;
  478|  6.72M|    ASSERT(u4_range >= 256);
  ------------------
  |  |   55|  6.72M|#define ASSERT(x) assert((x))
  ------------------
  479|  6.72M|    ASSERT(numbins > 0);
  ------------------
  |  |   55|  6.72M|#define ASSERT(x) assert((x))
  ------------------
  480|       |
  481|       |    /* Sanity checks */
  482|  6.72M|    ASSERT(numbins < 17);
  ------------------
  |  |   55|  6.72M|#define ASSERT(x) assert((x))
  ------------------
  483|       |
  484|  6.72M|    u4_bins = 0;
  485|       |
  486|  6.72M|    BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  150|  6.72M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  151|  6.72M|{                                                               \
  |  |  152|  6.72M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  153|  6.72M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  ------------------
  |  |  |  |   42|  6.72M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  154|  6.72M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  155|  6.72M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  ------------------
  |  |  |  |   42|  13.4M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (155:8): [True: 346k, False: 6.37M]
  |  |  ------------------
  |  |  156|  6.72M|    {                                                           \
  |  |  157|   346k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  ------------------
  |  |  |  |   57|   346k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 346k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  158|   346k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  159|   346k|    }                                                           \
  |  |  160|  6.72M|                                                                \
  |  |  161|  6.72M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  ------------------
  |  |  |  |   42|  13.4M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (161:9): [True: 550k, False: 6.17M]
  |  |  ------------------
  |  |  162|  6.72M|    {                                                           \
  |  |  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|  6.72M|}
  ------------------
  487|  6.72M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins);
  488|       |
  489|  6.72M|    do
  490|  18.0M|    {
  491|  18.0M|        UWORD32 u4_bit;
  492|  18.0M|        numbins--;
  493|  18.0M|        u4_bit = (u4_bits >> numbins) & 1;
  494|  18.0M|        u4_ofst <<= 1;
  495|  18.0M|        u4_ofst |= u4_bit;
  496|       |
  497|  18.0M|        u4_bins <<= 1;
  498|  18.0M|        if(u4_ofst >= u4_range)
  ------------------
  |  Branch (498:12): [True: 6.14M, False: 11.9M]
  ------------------
  499|  6.14M|        {
  500|  6.14M|            u4_bins += 1;
  501|  6.14M|            u4_ofst -= u4_range;
  502|  6.14M|        }
  503|  18.0M|    }while(numbins);
  ------------------
  |  Branch (503:12): [True: 11.3M, False: 6.72M]
  ------------------
  504|       |
  505|       |    /* Update the cabac context */
  506|  6.72M|    ps_cabac->u4_ofst = u4_ofst;
  507|  6.72M|    DEBUG_RANGE_OFST("bypass", ps_cabac->u4_range, ps_cabac->u4_ofst);
  508|  6.72M|    return (u4_bins);
  509|  6.72M|}
ihevcd_cabac_decode_bins_tunary:
  556|  15.9M|{
  557|  15.9M|    UWORD32 u4_sym;
  558|  15.9M|    WORD32 bin;
  559|       |
  560|       |    /* Sanity checks */
  561|  15.9M|    ASSERT(c_max > 0);
  ------------------
  |  |   55|  15.9M|#define ASSERT(x) assert((x))
  ------------------
  562|  15.9M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));
  ------------------
  |  |   55|  15.9M|#define ASSERT(x) assert((x))
  ------------------
  563|  15.9M|    ASSERT((ctxt_index + (c_max >> ctxt_shift)) < IHEVC_CAB_CTXT_END);
  ------------------
  |  |   55|  15.9M|#define ASSERT(x) assert((x))
  ------------------
  564|       |
  565|  15.9M|    u4_sym = 0;
  566|  15.9M|    do
  567|  40.9M|    {
  568|  40.9M|        WORD32 bin_index;
  569|  40.9M|        bin_index = ctxt_index + MIN((u4_sym >> ctxt_shift), (UWORD32)ctxt_inc_max);
  ------------------
  |  |   43|  40.9M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 40.7M, False: 190k]
  |  |  ------------------
  ------------------
  570|   163M|        IHEVCD_CABAC_DECODE_BIN(bin, ps_cabac, ps_bitstrm,  bin_index);
  ------------------
  |  |   59|  40.9M|#define IHEVCD_CABAC_DECODE_BIN(u4_bin, ps_cabac, ps_bitstrm, ctxt_index)       \
  |  |   60|  40.9M|{                                                                               \
  |  |   61|  40.9M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |   62|  40.9M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |   63|  40.9M|    UWORD32 u4_rlps;                                                            \
  |  |   64|  40.9M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];            \
  |  |   65|  40.9M|    WORD32 state_mps = *pu1_ctxt_model;                                         \
  |  |   66|  40.9M|    WORD32 clz;                                                                 \
  |  |   67|  40.9M|    UWORD32 u4_qnt_range;                                                       \
  |  |   68|  40.9M|                                                                                \
  |  |   69|  40.9M|    /* Sanity checks */                                                         \
  |  |   70|  40.9M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  40.9M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   71|  40.9M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  40.9M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   72|  40.9M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));             \
  |  |  ------------------
  |  |  |  |   55|  40.9M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   73|  40.9M|    ASSERT(state_mps < 128);                                                    \
  |  |  ------------------
  |  |  |  |   55|  40.9M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   74|  40.9M|    clz = CLZ(u4_range);                                                        \
  |  |   75|  40.9M|    clz -= (32 - RANGE_NUMBITS);                                                \
  |  |  ------------------
  |  |  |  |   40|  40.9M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |   76|  40.9M|    u4_qnt_range = u4_range << clz;                                             \
  |  |   77|  40.9M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;                   \
  |  |  ------------------
  |  |  |  |   41|  40.9M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  40.9M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|  40.9M|    /* Get the lps range from LUT based on quantized range and state */         \
  |  |   79|  40.9M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];              \
  |  |   80|  40.9M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);                                   \
  |  |  ------------------
  |  |  |  |   41|  40.9M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  40.9M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  40.9M|    u4_range -= u4_rlps;                                                        \
  |  |   82|  40.9M|                                                                                \
  |  |   83|  40.9M|    u4_bin = state_mps & 1;                                                     \
  |  |   84|  40.9M|                                                                                \
  |  |   85|  40.9M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (85:8): [True: 4.26M, False: 36.6M]
  |  |  ------------------
  |  |   86|  40.9M|    {                                                                           \
  |  |   87|  4.26M|        u4_bin = 1 - u4_bin;                                                    \
  |  |   88|  4.26M|        u4_ofst -= u4_range;                                                    \
  |  |   89|  4.26M|        u4_range = u4_rlps;                                                     \
  |  |   90|  4.26M|    }                                                                           \
  |  |   91|  40.9M|                                                                                \
  |  |   92|  40.9M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];         \
  |  |   93|  40.9M|                                                                                \
  |  |   94|  40.9M|    /*****************************************************************/         \
  |  |   95|  40.9M|    /* Re-normalization; calculate bits generated based on range(R)  */         \
  |  |   96|  40.9M|    /*****************************************************************/         \
  |  |   97|  40.9M|    if(u4_range < (1 << 8))                                                     \
  |  |  ------------------
  |  |  |  Branch (97:8): [True: 468k, False: 40.4M]
  |  |  ------------------
  |  |   98|  40.9M|    {                                                                           \
  |  |   99|   468k|        UWORD32 u4_bits;                                                        \
  |  |  100|   468k|        WORD32 numbits;                                                         \
  |  |  101|   468k|        numbits = CLZ(u4_range);                                                \
  |  |  102|   468k|        numbits -= (32 - RANGE_NUMBITS);                                        \
  |  |  ------------------
  |  |  |  |   40|   468k|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |  103|   468k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|   468k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|   468k|{                                                               \
  |  |  |  |  152|   468k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|   468k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   468k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|   468k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|   468k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   937k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 332k, False: 136k]
  |  |  |  |  ------------------
  |  |  |  |  156|   468k|    {                                                           \
  |  |  |  |  157|   332k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   332k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 332k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   332k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   332k|    }                                                           \
  |  |  |  |  160|   468k|                                                                \
  |  |  |  |  161|   468k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   937k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 348k, False: 120k]
  |  |  |  |  ------------------
  |  |  |  |  162|   468k|    {                                                           \
  |  |  |  |  163|   348k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   348k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   348k|        /* Getting the next word */                             \
  |  |  |  |  166|   348k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   348k|                                                                \
  |  |  |  |  168|   348k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   348k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   348k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   348k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   348k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   348k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   348k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   348k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   348k|    }                                                           \
  |  |  |  |  172|   468k|}
  |  |  ------------------
  |  |  104|   468k|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);    \
  |  |  105|   468k|                                                                                \
  |  |  106|   468k|        u4_ofst <<= numbits;                                                    \
  |  |  107|   468k|        u4_ofst |= u4_bits;                                                     \
  |  |  108|   468k|        u4_range <<= numbits;                                                   \
  |  |  109|   468k|                                                                                \
  |  |  110|   468k|    }                                                                           \
  |  |  111|  40.9M|    /* Update the cabac context */                                              \
  |  |  112|  40.9M|    ps_cabac->u4_range = u4_range;                                              \
  |  |  113|  40.9M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  114|  40.9M|                                                                                \
  |  |  115|  40.9M|}
  ------------------
  571|   163M|        u4_sym++;
  572|   163M|    }while(((WORD32)u4_sym < c_max) && bin);
  ------------------
  |  Branch (572:12): [True: 38.9M, False: 1.99M]
  |  Branch (572:40): [True: 25.0M, False: 13.9M]
  ------------------
  573|       |
  574|  15.9M|    u4_sym = u4_sym - 1 + bin;
  575|       |
  576|  15.9M|    return (u4_sym);
  577|  15.9M|}
ihevcd_cabac_decode_bypass_bins_tunary:
  606|  7.26M|{
  607|       |
  608|  7.26M|    UWORD32 u4_sym;
  609|  7.26M|    WORD32 bin;
  610|  7.26M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;
  611|  7.26M|    UWORD32 u4_range = ps_cabac->u4_range;
  612|  7.26M|    UWORD32 u4_bits;
  613|       |    /* Sanity checks */
  614|  7.26M|    ASSERT(c_max > 0);
  ------------------
  |  |   55|  7.26M|#define ASSERT(x) assert((x))
  ------------------
  615|  7.26M|    ASSERT(u4_range >= 256);
  ------------------
  |  |   55|  7.26M|#define ASSERT(x) assert((x))
  ------------------
  616|  7.26M|    u4_sym = 0;
  617|  7.26M|    BITS_NXT(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |   91|  7.26M|                 m_u4_cur_word, m_u4_nxt_word, m_cnt)       \
  |  |   92|  7.26M|{                                                           \
  |  |   93|  7.26M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)  >>        \
  |  |   94|  7.26M|                              (WORD_SIZE - m_cnt);          \
  |  |  ------------------
  |  |  |  |   42|  7.26M|#define WORD_SIZE         32
  |  |  ------------------
  |  |   95|  7.26M|                                                            \
  |  |   96|  7.26M|    if(m_u4_bit_ofst > (WORD_SIZE - m_cnt))                 \
  |  |  ------------------
  |  |  |  |   42|  7.26M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (96:8): [True: 595k, False: 6.66M]
  |  |  ------------------
  |  |   97|  7.26M|    {                                                       \
  |  |   98|   595k|        m_u4_bits |= SHR(m_u4_nxt_word,                     \
  |  |  ------------------
  |  |  |  |   57|   595k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:19): [True: 595k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   99|   595k|                   (WORD_SIZE + WORD_SIZE - m_cnt           \
  |  |  100|   595k|                          - m_u4_bit_ofst));                \
  |  |  101|   595k|    }                                                       \
  |  |  102|  7.26M|}
  ------------------
  618|  7.26M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, (UWORD32)c_max);
  619|  7.26M|    u4_bits <<= (32 - c_max);
  620|  7.26M|    do
  621|  11.1M|    {
  622|  11.1M|        u4_ofst <<= 1;
  623|  11.1M|        u4_ofst |= (u4_bits >> 31);
  624|  11.1M|        u4_bits <<= 1;
  625|       |
  626|  11.1M|        bin = 0;
  627|  11.1M|        if(u4_ofst >= u4_range)
  ------------------
  |  Branch (627:12): [True: 4.59M, False: 6.51M]
  ------------------
  628|  4.59M|        {
  629|  4.59M|            bin = 1;
  630|  4.59M|            u4_ofst -= u4_range;
  631|  4.59M|        }
  632|  11.1M|        u4_sym++;
  633|  11.1M|    }while(((WORD32)u4_sym < c_max) && bin);
  ------------------
  |  Branch (633:12): [True: 9.61M, False: 1.49M]
  |  Branch (633:40): [True: 3.84M, False: 5.76M]
  ------------------
  634|  7.26M|    BITS_FLUSH(ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,
  ------------------
  |  |  127|  7.26M|                    m_u4_nxt_word, m_cnt)                   \
  |  |  128|  7.26M|{                                                           \
  |  |  129|  7.26M|    UWORD32 temp;                                           \
  |  |  130|  7.26M|                                                            \
  |  |  131|  7.26M|    m_u4_bit_ofst += m_cnt;                                 \
  |  |  132|  7.26M|    if( m_u4_bit_ofst >=   WORD_SIZE )                      \
  |  |  ------------------
  |  |  |  |   42|  14.5M|#define WORD_SIZE         32
  |  |  ------------------
  |  |  |  Branch (132:9): [True: 349k, False: 6.91M]
  |  |  ------------------
  |  |  133|  7.26M|    {                                                       \
  |  |  134|   349k|        m_u4_cur_word  = m_u4_nxt_word;                     \
  |  |  135|   349k|        /* Getting the next word */                         \
  |  |  136|   349k|        temp = *(m_pu4_buf++);                              \
  |  |  137|   349k|                                                            \
  |  |  138|   349k|        m_u4_bit_ofst -= WORD_SIZE;                         \
  |  |  ------------------
  |  |  |  |   42|   349k|#define WORD_SIZE         32
  |  |  ------------------
  |  |  139|   349k|        /* Swapping little endian to big endian conversion*/\
  |  |  140|   349k|        m_u4_nxt_word = ITT_BIG_ENDIAN(temp);                   \
  |  |  ------------------
  |  |  |  |   63|   349k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |   64|   349k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |   65|   349k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |   66|   349k|                            ((UWORD32)x >> 24);
  |  |  ------------------
  |  |  141|   349k|    }                                                       \
  |  |  142|  7.26M|}
  ------------------
  635|  7.26M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, u4_sym);
  636|       |
  637|  7.26M|    u4_sym = u4_sym - 1 + bin;
  638|       |    /* Update the cabac context */
  639|  7.26M|    ps_cabac->u4_ofst = u4_ofst;
  640|       |
  641|  7.26M|    return (u4_sym);
  642|  7.26M|}
ihevcd_cabac_decode_bypass_bins_egk:
  669|  78.5k|{
  670|       |
  671|  78.5k|    UWORD32 u4_sym;
  672|  78.5k|    WORD32 numones;
  673|  78.5k|    WORD32 bin;
  674|       |
  675|       |    /* Sanity checks */
  676|  78.5k|    ASSERT((k >= 0));
  ------------------
  |  |   55|  78.5k|#define ASSERT(x) assert((x))
  ------------------
  677|       |
  678|  78.5k|    numones = k;
  679|  78.5k|    bin = 1;
  680|  78.5k|    u4_sym = 0;
  681|   212k|    while(bin && (numones <= 16))
  ------------------
  |  Branch (681:11): [True: 133k, False: 78.4k]
  |  Branch (681:18): [True: 133k, False: 25]
  ------------------
  682|   133k|    {
  683|   267k|        IHEVCD_CABAC_DECODE_BYPASS_BIN(bin, ps_cabac, ps_bitstrm);
  ------------------
  |  |  122|   133k|#define IHEVCD_CABAC_DECODE_BYPASS_BIN(u4_bin, ps_cabac, ps_bitstrm)            \
  |  |  123|   133k|{                                                                               \
  |  |  124|   133k|                                                                                \
  |  |  125|   133k|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  126|   133k|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  127|   133k|    UWORD32 u4_bits;                                                            \
  |  |  128|   133k|                                                                                \
  |  |  129|   133k|    /* Sanity checks */                                                         \
  |  |  130|   133k|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|   133k|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  131|   133k|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|   133k|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  132|   133k|                                                                                \
  |  |  133|   133k|    BIT_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,              \
  |  |  ------------------
  |  |  |  |  182|   133k|                          m_u4_cur_word,m_u4_nxt_word)          \
  |  |  |  |  183|   133k|{                                                               \
  |  |  |  |  184|   133k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  185|   133k|                             >> (WORD_SIZE_MINUS1);             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|   133k|#define WORD_SIZE_MINUS1  (WORD_SIZE - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|   133k|#define WORD_SIZE         32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  186|   133k|    m_u4_bit_ofst++;                                            \
  |  |  |  |  187|   133k|                                                                \
  |  |  |  |  188|   133k|    if(m_u4_bit_ofst ==  WORD_SIZE)                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   267k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (188:8): [True: 4.16k, False: 129k]
  |  |  |  |  ------------------
  |  |  |  |  189|   133k|    {                                                           \
  |  |  |  |  190|  4.16k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  191|  4.16k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  192|  4.16k|        /* Getting the next word */                             \
  |  |  |  |  193|  4.16k|        pu4_word_tmp = *m_pu4_buf++;                            \
  |  |  |  |  194|  4.16k|                                                                \
  |  |  |  |  195|  4.16k|        m_u4_bit_ofst = 0;                                      \
  |  |  |  |  196|  4.16k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  197|  4.16k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  4.16k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  4.16k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  4.16k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  4.16k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  198|  4.16k|    }                                                           \
  |  |  |  |  199|   133k|}
  |  |  ------------------
  |  |  134|   133k|            ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word);                  \
  |  |  135|   133k|                                                                                \
  |  |  136|   133k|    u4_ofst <<= 1;                                                              \
  |  |  137|   133k|    u4_ofst |= u4_bits;                                                         \
  |  |  138|   133k|                                                                                \
  |  |  139|   133k|    u4_bin = 0;                                                                 \
  |  |  140|   133k|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 55.0k, False: 78.4k]
  |  |  ------------------
  |  |  141|   133k|    {                                                                           \
  |  |  142|  55.0k|        u4_bin = 1;                                                             \
  |  |  143|  55.0k|        u4_ofst -= u4_range;                                                    \
  |  |  144|  55.0k|    }                                                                           \
  |  |  145|   133k|                                                                                \
  |  |  146|   133k|    /* Update the cabac context */                                              \
  |  |  147|   133k|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  148|   133k|}
  ------------------
  684|   267k|        u4_sym += bin << numones++;
  685|   267k|    }
  686|       |
  687|  78.5k|    numones -= 1;
  688|       |
  689|  78.5k|    if(numones)
  ------------------
  |  Branch (689:8): [True: 69.6k, False: 8.82k]
  ------------------
  690|  69.6k|    {
  691|  69.6k|        UWORD32 u4_suffix;
  692|       |
  693|   278k|        IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_suffix, ps_cabac, ps_bitstrm, numones);
  ------------------
  |  |  156|  69.6k|#define IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_bins, ps_cabac, ps_bitstrm, numbins) \
  |  |  157|  69.6k|{                                                                               \
  |  |  158|  69.6k|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  159|  69.6k|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  160|  69.6k|    UWORD32 u4_bits;                                                            \
  |  |  161|  69.6k|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  69.6k|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  162|  69.6k|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  69.6k|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  163|  69.6k|    ASSERT(numbins > 0);                                                        \
  |  |  ------------------
  |  |  |  |   55|  69.6k|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  164|  69.6k|    {                                                                           \
  |  |  165|  69.6k|        WORD32 numbins_tmp = numbins;                                           \
  |  |  166|  69.6k|        /* Sanity checks */                                                     \
  |  |  167|  69.6k|        ASSERT(numbins < 17);                                                   \
  |  |  ------------------
  |  |  |  |   55|  69.6k|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  168|  69.6k|                                                                                \
  |  |  169|  69.6k|        u4_bins = 0;                                                            \
  |  |  170|  69.6k|                                                                                \
  |  |  171|  69.6k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  69.6k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  69.6k|{                                                               \
  |  |  |  |  152|  69.6k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  69.6k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  69.6k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  69.6k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  69.6k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   139k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 1.80k, False: 67.8k]
  |  |  |  |  ------------------
  |  |  |  |  156|  69.6k|    {                                                           \
  |  |  |  |  157|  1.80k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  1.80k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 1.80k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|  1.80k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|  1.80k|    }                                                           \
  |  |  |  |  160|  69.6k|                                                                \
  |  |  |  |  161|  69.6k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   139k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 3.68k, False: 66.0k]
  |  |  |  |  ------------------
  |  |  |  |  162|  69.6k|    {                                                           \
  |  |  |  |  163|  3.68k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|  3.68k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|  3.68k|        /* Getting the next word */                             \
  |  |  |  |  166|  3.68k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|  3.68k|                                                                \
  |  |  |  |  168|  3.68k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  3.68k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|  3.68k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|  3.68k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  3.68k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  3.68k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  3.68k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  3.68k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|  3.68k|    }                                                           \
  |  |  |  |  172|  69.6k|}
  |  |  ------------------
  |  |  172|  69.6k|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins); \
  |  |  173|  69.6k|        do                                                                      \
  |  |  174|   122k|        {                                                                       \
  |  |  175|   122k|            UWORD32 u4_bit;                                                     \
  |  |  176|   122k|            numbins_tmp--;                                                      \
  |  |  177|   122k|            u4_bit = (u4_bits >> numbins_tmp) & 1;                              \
  |  |  178|   122k|            u4_ofst <<= 1;                                                      \
  |  |  179|   122k|            u4_ofst |= u4_bit;                                                  \
  |  |  180|   122k|                                                                                \
  |  |  181|   122k|            u4_bins <<= 1;                                                      \
  |  |  182|   122k|            if(u4_ofst >= u4_range)                                             \
  |  |  ------------------
  |  |  |  Branch (182:16): [True: 58.9k, False: 63.8k]
  |  |  ------------------
  |  |  183|   122k|            {                                                                   \
  |  |  184|  58.9k|                u4_bins += 1;                                                   \
  |  |  185|  58.9k|                u4_ofst -= u4_range;                                            \
  |  |  186|  58.9k|            }                                                                   \
  |  |  187|   122k|        }while(numbins_tmp);                                                    \
  |  |  ------------------
  |  |  |  Branch (187:16): [True: 53.0k, False: 69.6k]
  |  |  ------------------
  |  |  188|  69.6k|                                                                                \
  |  |  189|  69.6k|        /* Update the cabac context */                                          \
  |  |  190|  69.6k|        ps_cabac->u4_ofst = u4_ofst;                                            \
  |  |  191|  69.6k|    }                                                                           \
  |  |  192|  69.6k|}
  ------------------
  694|   278k|        u4_sym += u4_suffix;
  695|   278k|    }
  696|  78.5k|    return (u4_sym);
  697|  78.5k|}

ihevcd_deblk_ctb:
  100|  7.53M|{
  101|  7.53M|    WORD32 ctb_size;
  102|  7.53M|    WORD32 log2_ctb_size;
  103|  7.53M|    UWORD32 u4_bs;
  104|  7.53M|    WORD32 bs_tz; /*Leading zeros in boundary strength*/
  105|  7.53M|    WORD32 qp_p, qp_q;
  106|       |
  107|  7.53M|    WORD32 filter_p, filter_q;
  108|       |
  109|  7.53M|    UWORD8 *pu1_src;
  110|  7.53M|    WORD32 qp_strd;
  111|  7.53M|    UWORD32 *pu4_vert_bs, *pu4_horz_bs;
  112|  7.53M|    UWORD32 *pu4_ctb_vert_bs, *pu4_ctb_horz_bs;
  113|  7.53M|    WORD32 bs_strd;
  114|  7.53M|    WORD32 src_strd;
  115|  7.53M|    UWORD8 *pu1_qp;
  116|  7.53M|    UWORD16 *pu2_ctb_no_loop_filter_flag;
  117|  7.53M|    UWORD16 au2_ctb_no_loop_filter_flag[9];
  118|       |
  119|  7.53M|    WORD32 col, row;
  120|       |
  121|       |    /* Flag to indicate if QP is constant in CTB
  122|       |     * 0 - top_left, 1 - top, 2 - left, 3 - current */
  123|  7.53M|    UWORD32 u4_qp_const_in_ctb[4] = { 0, 0, 0, 0 };
  124|  7.53M|    WORD32 ctb_indx;
  125|  7.53M|    WORD32  chroma_yuv420sp_vu = ps_deblk->is_chroma_yuv420sp_vu;
  126|  7.53M|    sps_t *ps_sps;
  127|  7.53M|    pps_t *ps_pps;
  128|  7.53M|    codec_t *ps_codec;
  129|  7.53M|    slice_header_t *ps_slice_hdr;
  130|       |
  131|  7.53M|    PROFILE_DISABLE_DEBLK();
  ------------------
  |  |   57|  7.53M|#define PROFILE_DISABLE_DEBLK() ;
  ------------------
  132|       |
  133|  7.53M|    ps_sps = ps_deblk->ps_sps;
  134|  7.53M|    ps_pps = ps_deblk->ps_pps;
  135|  7.53M|    ps_codec = ps_deblk->ps_codec;
  136|  7.53M|    ps_slice_hdr = ps_deblk->ps_slice_hdr;
  137|       |
  138|  7.53M|    log2_ctb_size = ps_sps->i1_log2_ctb_size;
  139|  7.53M|    ctb_size = (1 << ps_sps->i1_log2_ctb_size);
  140|       |
  141|       |    /* strides are in units of number of bytes */
  142|       |    /* ctb_size * ctb_size / 8 / 16 is the number of bytes needed per CTB */
  143|  7.53M|    bs_strd = (ps_sps->i2_pic_wd_in_ctb + 1) << (2 * log2_ctb_size - 7);
  144|       |
  145|  7.53M|    pu4_vert_bs = (UWORD32 *)((UWORD8 *)ps_deblk->s_bs_ctxt.pu4_pic_vert_bs +
  146|  7.53M|                    (ps_deblk->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  147|  7.53M|                    ps_deblk->i4_ctb_y * bs_strd);
  148|  7.53M|    pu4_ctb_vert_bs = pu4_vert_bs;
  149|       |
  150|  7.53M|    pu4_horz_bs = (UWORD32 *)((UWORD8 *)ps_deblk->s_bs_ctxt.pu4_pic_horz_bs +
  151|  7.53M|                    (ps_deblk->i4_ctb_x << (2 * log2_ctb_size - 7)) +
  152|  7.53M|                    ps_deblk->i4_ctb_y * bs_strd);
  153|  7.53M|    pu4_ctb_horz_bs = pu4_horz_bs;
  154|       |
  155|  7.53M|    qp_strd = ps_sps->i2_pic_wd_in_ctb << (log2_ctb_size - 3);
  156|  7.53M|    pu1_qp = ps_deblk->s_bs_ctxt.pu1_pic_qp + ((ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * qp_strd) << (log2_ctb_size - 3));
  157|       |
  158|  7.53M|    pu2_ctb_no_loop_filter_flag = ps_deblk->au2_ctb_no_loop_filter_flag;
  159|       |
  160|  7.53M|    ctb_indx = ps_deblk->i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_deblk->i4_ctb_y;
  161|  7.53M|    if(i4_is_last_ctb_y)
  ------------------
  |  Branch (161:8): [True: 8.54k, False: 7.52M]
  ------------------
  162|  8.54k|    {
  163|  8.54k|        pu4_vert_bs = (UWORD32 *)((UWORD8 *)pu4_vert_bs + bs_strd);
  164|  8.54k|        pu4_ctb_vert_bs = pu4_vert_bs;
  165|       |        /* ctb_size/8 is the number of edges per CTB
  166|       |         * ctb_size/4 is the number of BS values needed per edge
  167|       |         * divided by 8 for the number of bytes
  168|       |         * 2 is the number of bits needed for each BS value */
  169|  8.54k|        memset(pu4_vert_bs, 0, 1 << (2 * log2_ctb_size - 7));
  170|       |
  171|  8.54k|        pu1_qp += (qp_strd << (log2_ctb_size - 3));
  172|  8.54k|        pu2_ctb_no_loop_filter_flag += (ctb_size >> 3);
  173|  8.54k|        ctb_indx += ps_sps->i2_pic_wd_in_ctb;
  174|  8.54k|    }
  175|       |
  176|  7.53M|    if(i4_is_last_ctb_x)
  ------------------
  |  Branch (176:8): [True: 29.7k, False: 7.50M]
  ------------------
  177|  29.7k|    {
  178|  29.7k|        pu4_horz_bs = (UWORD32 *)((UWORD8 *)pu4_horz_bs + (1 << (2 * log2_ctb_size - 7)));
  179|  29.7k|        pu4_ctb_horz_bs = pu4_horz_bs;
  180|  29.7k|        memset(pu4_horz_bs, 0, 1 << (2 * log2_ctb_size - 7));
  181|       |
  182|  29.7k|        pu1_qp += (ctb_size >> 3);
  183|       |
  184|   289k|        for(row = 0; row < (ctb_size >> 3) + 1; row++)
  ------------------
  |  Branch (184:22): [True: 259k, False: 29.7k]
  ------------------
  185|   259k|            au2_ctb_no_loop_filter_flag[row] = ps_deblk->au2_ctb_no_loop_filter_flag[row] >> (ctb_size >> 3);
  186|  29.7k|        pu2_ctb_no_loop_filter_flag = au2_ctb_no_loop_filter_flag;
  187|  29.7k|        ctb_indx += 1;
  188|  29.7k|    }
  189|       |
  190|  7.53M|    u4_qp_const_in_ctb[3] = ps_deblk->s_bs_ctxt.pu1_pic_qp_const_in_ctb[(ctb_indx) >> 3] & (1 << (ctb_indx & 7));
  191|       |
  192|  7.53M|    if(ps_deblk->i4_ctb_x || i4_is_last_ctb_x)
  ------------------
  |  Branch (192:8): [True: 7.05M, False: 474k]
  |  Branch (192:30): [True: 616, False: 473k]
  ------------------
  193|  7.05M|    {
  194|  7.05M|        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));
  195|  7.05M|    }
  196|       |
  197|  7.53M|    if((ps_deblk->i4_ctb_x || i4_is_last_ctb_x) && (ps_deblk->i4_ctb_y || i4_is_last_ctb_y))
  ------------------
  |  Branch (197:9): [True: 7.05M, False: 474k]
  |  Branch (197:31): [True: 616, False: 473k]
  |  Branch (197:53): [True: 6.77M, False: 277k]
  |  Branch (197:75): [True: 0, False: 277k]
  ------------------
  198|  6.77M|    {
  199|  6.77M|        u4_qp_const_in_ctb[0] =
  200|  6.77M|                        ps_deblk->s_bs_ctxt.pu1_pic_qp_const_in_ctb[(ctb_indx - ps_sps->i2_pic_wd_in_ctb - 1) >> 3] &
  201|  6.77M|                        (1 << ((ctb_indx - ps_sps->i2_pic_wd_in_ctb - 1) & 7));
  202|  6.77M|    }
  203|       |
  204|       |
  205|       |
  206|  7.53M|    if(ps_deblk->i4_ctb_y || i4_is_last_ctb_y)
  ------------------
  |  Branch (206:8): [True: 7.24M, False: 286k]
  |  Branch (206:30): [True: 0, False: 286k]
  ------------------
  207|  7.24M|    {
  208|  7.24M|        u4_qp_const_in_ctb[1] =
  209|  7.24M|                        ps_deblk->s_bs_ctxt.pu1_pic_qp_const_in_ctb[(ctb_indx - ps_sps->i2_pic_wd_in_ctb) >> 3] &
  210|  7.24M|                        (1 << ((ctb_indx - ps_sps->i2_pic_wd_in_ctb) & 7));
  211|  7.24M|    }
  212|       |
  213|  7.53M|    src_strd = ps_codec->i4_strd;
  214|       |
  215|       |    /* Luma Vertical Edge */
  216|       |
  217|  7.53M|    if(0 == i4_is_last_ctb_x)
  ------------------
  |  Branch (217:8): [True: 7.50M, False: 29.8k]
  ------------------
  218|  7.50M|    {
  219|       |        /* Top CTB's slice header */
  220|  7.50M|        slice_header_t *ps_slice_hdr_top;
  221|  7.50M|        {
  222|  7.50M|            WORD32 cur_ctb_indx = ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
  223|  7.50M|            if(i4_is_last_ctb_y)
  ------------------
  |  Branch (223:16): [True: 8.54k, False: 7.49M]
  ------------------
  224|  8.54k|                cur_ctb_indx += ps_sps->i2_pic_wd_in_ctb;
  225|  7.50M|            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];
  226|  7.50M|        }
  227|       |
  228|  7.50M|        pu1_src = ps_deblk->pu1_cur_pic_luma + ((ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_deblk->ps_codec->i4_strd) << (log2_ctb_size));
  229|  7.50M|        pu1_src += i4_is_last_ctb_y ? ps_deblk->ps_codec->i4_strd << log2_ctb_size : 0;
  ------------------
  |  Branch (229:20): [True: 8.54k, False: 7.49M]
  ------------------
  230|       |
  231|       |        /** Deblocking is done on a shifted CTB -
  232|       |         *  Vertical edge processing is done by shifting the CTB up by four pixels */
  233|  7.50M|        pu1_src -= 4 * src_strd;
  234|       |
  235|  36.9M|        for(col = 0; col < ctb_size / 8; col++)
  ------------------
  |  Branch (235:22): [True: 29.4M, False: 7.50M]
  ------------------
  236|  29.4M|        {
  237|  29.4M|            WORD32 shift = 0;
  238|       |
  239|       |            /*  downshift vert_bs by ctb_size/2 for each column
  240|       |             *  shift = (col & ((MAX_CTB_SIZE >> log2_ctb_size) - 1)) << (log2_ctb_size - 1);
  241|       |             *  which will reduce to the following assuming ctb size is one of 16, 32 and 64
  242|       |             *  and deblocking is done on 8x8 grid
  243|       |             */
  244|  29.4M|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (244:16): [True: 11.2M, False: 18.1M]
  ------------------
  245|  11.2M|                shift = (col & 1) << (log2_ctb_size - 1);
  246|       |
  247|       |            /* BS for the column - Last row is excluded and the top row is included*/
  248|  29.4M|            u4_bs = (pu4_vert_bs[0] >> shift) << 2;
  249|       |
  250|  29.4M|            if(ps_deblk->i4_ctb_y || i4_is_last_ctb_y)
  ------------------
  |  Branch (250:16): [True: 27.4M, False: 2.06M]
  |  Branch (250:38): [True: 0, False: 2.06M]
  ------------------
  251|  27.4M|            {
  252|       |                /* Picking the last BS of the previous CTB corresponding to the same column */
  253|  27.4M|                UWORD32 *pu4_vert_bs_top = (UWORD32 *)((UWORD8 *)pu4_vert_bs - bs_strd);
  254|  27.4M|                UWORD32 u4_top_bs = (*pu4_vert_bs_top) >> (shift + (1 << (log2_ctb_size - 1)) - 2);
  255|  27.4M|                u4_bs |= u4_top_bs & 3;
  256|  27.4M|            }
  257|       |
  258|   143M|            for(row = 0; row < ctb_size / 4;)
  ------------------
  |  Branch (258:26): [True: 113M, False: 29.4M]
  ------------------
  259|   113M|            {
  260|   113M|                WORD8 i1_beta_offset_div2 = ps_slice_hdr->i1_beta_offset_div2;
  261|   113M|                WORD8 i1_tc_offset_div2 = ps_slice_hdr->i1_tc_offset_div2;
  262|       |
  263|       |                /* Trailing zeros are computed and the corresponding rows are not processed */
  264|   113M|                bs_tz = CTZ(u4_bs) >> 1;
  265|   113M|                if(0 != bs_tz)
  ------------------
  |  Branch (265:20): [True: 38.3M, False: 75.2M]
  ------------------
  266|  38.3M|                {
  267|  38.3M|                    u4_bs = u4_bs >> (bs_tz << 1);
  268|  38.3M|                    if((row + bs_tz) >= (ctb_size / 4))
  ------------------
  |  Branch (268:24): [True: 24.7M, False: 13.6M]
  ------------------
  269|  24.7M|                        pu1_src += 4 * (ctb_size / 4 - row) * src_strd;
  270|  13.6M|                    else
  271|  13.6M|                        pu1_src += 4 * bs_tz  * src_strd;
  272|       |
  273|  38.3M|                    row += bs_tz;
  274|  38.3M|                    continue;
  275|  38.3M|                }
  276|       |
  277|  75.2M|                if(0 == row)
  ------------------
  |  Branch (277:20): [True: 4.77M, False: 70.5M]
  ------------------
  278|  4.77M|                {
  279|  4.77M|                    i1_beta_offset_div2 = ps_slice_hdr_top->i1_beta_offset_div2;
  280|  4.77M|                    i1_tc_offset_div2 = ps_slice_hdr_top->i1_tc_offset_div2;
  281|       |
  282|  4.77M|                    if(0 == col)
  ------------------
  |  Branch (282:24): [True: 1.47M, False: 3.29M]
  ------------------
  283|  1.47M|                    {
  284|  1.47M|                        qp_p = u4_qp_const_in_ctb[0] ?
  ------------------
  |  Branch (284:32): [True: 1.38M, False: 89.5k]
  ------------------
  285|  1.38M|                                        pu1_qp[-ctb_size / 8 * qp_strd - ctb_size / 8] :
  286|  1.47M|                                        pu1_qp[-qp_strd - 1];
  287|  1.47M|                    }
  288|  3.29M|                    else
  289|  3.29M|                    {
  290|  3.29M|                        qp_p = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (290:32): [True: 3.15M, False: 145k]
  ------------------
  291|  3.15M|                                        pu1_qp[-ctb_size / 8 * qp_strd] :
  292|  3.29M|                                        pu1_qp[col - 1 - qp_strd];
  293|  3.29M|                    }
  294|       |
  295|  4.77M|                    qp_q = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (295:28): [True: 4.53M, False: 237k]
  ------------------
  296|  4.53M|                                    pu1_qp[-ctb_size / 8 * qp_strd] :
  297|  4.77M|                                    pu1_qp[col - qp_strd];
  298|  4.77M|                }
  299|  70.5M|                else
  300|  70.5M|                {
  301|  70.5M|                    if(0 == col)
  ------------------
  |  Branch (301:24): [True: 22.3M, False: 48.2M]
  ------------------
  302|  22.3M|                    {
  303|  22.3M|                        qp_p = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (303:32): [True: 21.0M, False: 1.25M]
  ------------------
  304|  21.0M|                                        pu1_qp[-ctb_size / 8] :
  305|  22.3M|                                        pu1_qp[((row - 1) >> 1) * qp_strd - 1];
  306|  22.3M|                    }
  307|  48.2M|                    else
  308|  48.2M|                    {
  309|  48.2M|                        qp_p = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (309:32): [True: 47.9M, False: 210k]
  ------------------
  310|  47.9M|                                        pu1_qp[0] :
  311|  48.2M|                                        pu1_qp[((row - 1) >> 1) * qp_strd + col - 1];
  312|  48.2M|                    }
  313|       |
  314|  70.5M|                    qp_q = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (314:28): [True: 68.3M, False: 2.14M]
  ------------------
  315|  68.3M|                                    pu1_qp[0] :
  316|  70.5M|                                    pu1_qp[((row - 1) >> 1) * qp_strd + col];
  317|  70.5M|                }
  318|       |
  319|  75.2M|                filter_p = (pu2_ctb_no_loop_filter_flag[(row + 1) >> 1] >> col) & 1;
  320|  75.2M|                filter_q = (pu2_ctb_no_loop_filter_flag[(row + 1) >> 1] >> col) & 2;
  321|       |                /* filter_p and filter_q are inverted as they are calculated using no_loop_filter_flags */
  322|  75.2M|                filter_p = !filter_p;
  323|  75.2M|                filter_q = !filter_q;
  324|       |
  325|  75.2M|                if(filter_p || filter_q)
  ------------------
  |  Branch (325:20): [True: 74.9M, False: 321k]
  |  Branch (325:32): [True: 73.0k, False: 248k]
  ------------------
  326|  75.7M|                {
  327|  75.7M|                    DUMP_DEBLK_LUMA_VERT(pu1_src, src_strd,
  328|  75.7M|                                         u4_bs & 3, qp_p, qp_q,
  329|  75.7M|                                         ps_slice_hdr->i1_beta_offset_div2,
  330|  75.7M|                                         ps_slice_hdr->i1_tc_offset_div2,
  331|  75.7M|                                         filter_p, filter_q);
  332|  75.7M|                    ps_codec->s_func_selector.ihevc_deblk_luma_vert_fptr(pu1_src, src_strd,
  333|  75.7M|                                                                         u4_bs & 3, qp_p, qp_q,
  334|  75.7M|                                                                         i1_beta_offset_div2,
  335|  75.7M|                                                                         i1_tc_offset_div2,
  336|  75.7M|                                                                         filter_p, filter_q);
  337|  75.7M|                }
  338|       |
  339|  75.2M|                pu1_src += 4 * src_strd;
  340|  75.2M|                u4_bs = u4_bs >> 2;
  341|  75.2M|                row++;
  342|  75.2M|            }
  343|       |
  344|  29.4M|            if((64 == ctb_size) ||
  ------------------
  |  Branch (344:16): [True: 18.1M, False: 11.2M]
  ------------------
  345|  29.4M|                            ((32 == ctb_size) && (col & 1)))
  ------------------
  |  Branch (345:30): [True: 1.72M, False: 9.57M]
  |  Branch (345:50): [True: 860k, False: 860k]
  ------------------
  346|  19.0M|            {
  347|  19.0M|                pu4_vert_bs++;
  348|  19.0M|            }
  349|  29.4M|            pu1_src -= (src_strd << log2_ctb_size);
  350|  29.4M|            pu1_src += 8;
  351|  29.4M|        }
  352|  7.50M|        pu4_vert_bs = pu4_ctb_vert_bs;
  353|  7.50M|    }
  354|       |
  355|       |
  356|       |    /* Luma Horizontal Edge */
  357|       |
  358|  7.53M|    if(0 == i4_is_last_ctb_y)
  ------------------
  |  Branch (358:8): [True: 7.52M, False: 9.57k]
  ------------------
  359|  7.52M|    {
  360|       |
  361|       |        /* Left CTB's slice header */
  362|  7.52M|        slice_header_t *ps_slice_hdr_left;
  363|  7.52M|        {
  364|  7.52M|            WORD32 cur_ctb_indx = ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
  365|  7.52M|            if(i4_is_last_ctb_x)
  ------------------
  |  Branch (365:16): [True: 29.7k, False: 7.49M]
  ------------------
  366|  29.7k|                cur_ctb_indx += 1;
  367|  7.52M|            ps_slice_hdr_left = ps_codec->ps_slice_hdr_base + ps_deblk->pu1_slice_idx[cur_ctb_indx - 1];
  368|  7.52M|        }
  369|  7.52M|        pu1_src = ps_deblk->pu1_cur_pic_luma + ((ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_deblk->ps_codec->i4_strd) << log2_ctb_size);
  370|  7.52M|        pu1_src += i4_is_last_ctb_x ? ctb_size : 0;
  ------------------
  |  Branch (370:20): [True: 29.7k, False: 7.49M]
  ------------------
  371|       |
  372|       |        /** Deblocking is done on a shifted CTB -
  373|       |         *  Horizontal edge processing is done by shifting the CTB left by four pixels */
  374|  7.52M|        pu1_src -= 4;
  375|  37.2M|        for(row = 0; row < ctb_size / 8; row++)
  ------------------
  |  Branch (375:22): [True: 29.7M, False: 7.52M]
  ------------------
  376|  29.7M|        {
  377|  29.7M|            WORD32 shift = 0;
  378|       |
  379|       |            /* downshift vert_bs by ctb_size/2 for each column
  380|       |             *  shift = (row & (MAX_CTB_SIZE / ctb_size - 1)) * ctb_size / 2;
  381|       |             *  which will reduce to the following assuming ctb size is one of 16, 32 and 64
  382|       |             *  and deblocking is done on 8x8 grid
  383|       |             */
  384|  29.7M|            if(6 != log2_ctb_size)
  ------------------
  |  Branch (384:16): [True: 11.2M, False: 18.4M]
  ------------------
  385|  11.2M|                shift = (row & 1) << (log2_ctb_size - 1);
  386|       |
  387|       |            /* BS for the row - Last column is excluded and the left column is included*/
  388|  29.7M|            u4_bs = (pu4_horz_bs[0] >> shift) << 2;
  389|       |
  390|  29.7M|            if(ps_deblk->i4_ctb_x || i4_is_last_ctb_x)
  ------------------
  |  Branch (390:16): [True: 28.2M, False: 1.48M]
  |  Branch (390:38): [True: 4.92k, False: 1.47M]
  ------------------
  391|  28.2M|            {
  392|       |                /** Picking the last BS of the previous CTB corresponding to the same row
  393|       |                * UWORD32 *pu4_horz_bs_left = (UWORD32 *)((UWORD8 *)pu4_horz_bs - (ctb_size / 8) * (ctb_size / 4) / 8 * 2);
  394|       |                */
  395|  28.2M|                UWORD32 *pu4_horz_bs_left = (UWORD32 *)((UWORD8 *)pu4_horz_bs - (1 << (2 * log2_ctb_size - 7)));
  396|  28.2M|                UWORD32 u4_left_bs = (*pu4_horz_bs_left) >> (shift + (1 << (log2_ctb_size - 1)) - 2);
  397|  28.2M|                u4_bs |= u4_left_bs & 3;
  398|  28.2M|            }
  399|       |
  400|   142M|            for(col = 0; col < ctb_size / 4;)
  ------------------
  |  Branch (400:26): [True: 112M, False: 29.7M]
  ------------------
  401|   112M|            {
  402|   112M|                WORD8 i1_beta_offset_div2 = ps_slice_hdr->i1_beta_offset_div2;
  403|   112M|                WORD8 i1_tc_offset_div2 = ps_slice_hdr->i1_tc_offset_div2;
  404|       |
  405|   112M|                bs_tz = CTZ(u4_bs) >> 1;
  406|   112M|                if(0 != bs_tz)
  ------------------
  |  Branch (406:20): [True: 38.7M, False: 73.8M]
  ------------------
  407|  38.7M|                {
  408|  38.7M|                    u4_bs = u4_bs >> (bs_tz << 1);
  409|       |
  410|  38.7M|                    if((col + bs_tz) >= (ctb_size / 4))
  ------------------
  |  Branch (410:24): [True: 24.9M, False: 13.7M]
  ------------------
  411|  24.9M|                        pu1_src += 4 * (ctb_size / 4 - col);
  412|  13.7M|                    else
  413|  13.7M|                        pu1_src += 4 * bs_tz;
  414|       |
  415|  38.7M|                    col += bs_tz;
  416|  38.7M|                    continue;
  417|  38.7M|                }
  418|       |
  419|  73.8M|                if(0 == col)
  ------------------
  |  Branch (419:20): [True: 4.81M, False: 68.9M]
  ------------------
  420|  4.81M|                {
  421|  4.81M|                    i1_beta_offset_div2 = ps_slice_hdr_left->i1_beta_offset_div2;
  422|  4.81M|                    i1_tc_offset_div2 = ps_slice_hdr_left->i1_tc_offset_div2;
  423|       |
  424|  4.81M|                    if(0 == row)
  ------------------
  |  Branch (424:24): [True: 1.39M, False: 3.41M]
  ------------------
  425|  1.39M|                    {
  426|  1.39M|                        qp_p = u4_qp_const_in_ctb[0] ?
  ------------------
  |  Branch (426:32): [True: 1.30M, False: 93.4k]
  ------------------
  427|  1.30M|                                        pu1_qp[-ctb_size / 8 * qp_strd - ctb_size / 8] :
  428|  1.39M|                                        pu1_qp[-qp_strd - 1];
  429|  1.39M|                    }
  430|  3.41M|                    else
  431|  3.41M|                    {
  432|  3.41M|                        qp_p = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (432:32): [True: 3.27M, False: 146k]
  ------------------
  433|  3.27M|                                        pu1_qp[-ctb_size / 8] :
  434|  3.41M|                                        pu1_qp[(row - 1) * qp_strd - 1];
  435|  3.41M|                    }
  436|       |
  437|  4.81M|                    qp_q = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (437:28): [True: 4.57M, False: 238k]
  ------------------
  438|  4.57M|                                    pu1_qp[-ctb_size / 8] :
  439|  4.81M|                                    pu1_qp[row * qp_strd - 1];
  440|  4.81M|                }
  441|  68.9M|                else
  442|  68.9M|                {
  443|  68.9M|                    if(0 == row)
  ------------------
  |  Branch (443:24): [True: 20.7M, False: 48.2M]
  ------------------
  444|  20.7M|                    {
  445|  20.7M|                        qp_p = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (445:32): [True: 19.4M, False: 1.30M]
  ------------------
  446|  19.4M|                                        pu1_qp[-ctb_size / 8 * qp_strd] :
  447|  20.7M|                                        pu1_qp[((col - 1) >> 1) - qp_strd];
  448|  20.7M|                    }
  449|  48.2M|                    else
  450|  48.2M|                    {
  451|  48.2M|                        qp_p = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (451:32): [True: 47.6M, False: 618k]
  ------------------
  452|  47.6M|                                        pu1_qp[0] :
  453|  48.2M|                                        pu1_qp[((col - 1) >> 1) + (row - 1) * qp_strd];
  454|  48.2M|                    }
  455|       |
  456|  68.9M|                    qp_q = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (456:28): [True: 66.5M, False: 2.46M]
  ------------------
  457|  66.5M|                                    pu1_qp[0] :
  458|  68.9M|                                    pu1_qp[((col - 1) >> 1) + row * qp_strd];
  459|  68.9M|                }
  460|       |
  461|  73.8M|                filter_p = (pu2_ctb_no_loop_filter_flag[row] >> ((col + 1) >> 1)) & 1;
  462|  73.8M|                filter_q = (pu2_ctb_no_loop_filter_flag[row + 1] >> ((col + 1) >> 1)) & 1;
  463|       |                /* filter_p and filter_q are inverted as they are calculated using no_loop_filter_flags */
  464|  73.8M|                filter_p = !filter_p;
  465|  73.8M|                filter_q = !filter_q;
  466|       |
  467|  73.8M|                if(filter_p || filter_q)
  ------------------
  |  Branch (467:20): [True: 73.5M, False: 291k]
  |  Branch (467:32): [True: 126k, False: 165k]
  ------------------
  468|  74.0M|                {
  469|  74.0M|                    DUMP_DEBLK_LUMA_HORZ(pu1_src, src_strd,
  470|  74.0M|                                         u4_bs & 3, qp_p, qp_q,
  471|  74.0M|                                         ps_slice_hdr->i1_beta_offset_div2,
  472|  74.0M|                                         ps_slice_hdr->i1_tc_offset_div2,
  473|  74.0M|                                         filter_p, filter_q);
  474|  74.0M|                    ps_codec->s_func_selector.ihevc_deblk_luma_horz_fptr(pu1_src, src_strd,
  475|  74.0M|                                                                         u4_bs & 3, qp_p, qp_q,
  476|  74.0M|                                                                         i1_beta_offset_div2,
  477|  74.0M|                                                                         i1_tc_offset_div2, filter_p, filter_q);
  478|  74.0M|                }
  479|       |
  480|  73.8M|                pu1_src += 4;
  481|  73.8M|                u4_bs = u4_bs >> 2;
  482|  73.8M|                col++;
  483|  73.8M|            }
  484|       |
  485|  29.7M|            if((64 == ctb_size) ||
  ------------------
  |  Branch (485:16): [True: 18.4M, False: 11.2M]
  ------------------
  486|  29.7M|                            ((32 == ctb_size) && (row & 1)))
  ------------------
  |  Branch (486:30): [True: 1.71M, False: 9.56M]
  |  Branch (486:50): [True: 858k, False: 858k]
  ------------------
  487|  19.2M|            {
  488|  19.2M|                pu4_horz_bs++;
  489|  19.2M|            }
  490|  29.7M|            pu1_src -= ctb_size;
  491|  29.7M|            pu1_src += (src_strd << 3);
  492|  29.7M|        }
  493|  7.52M|        pu4_horz_bs = pu4_ctb_horz_bs;
  494|  7.52M|    }
  495|       |
  496|       |
  497|       |    /* Chroma Veritcal Edge */
  498|       |
  499|  7.53M|    if(0 == i4_is_last_ctb_x)
  ------------------
  |  Branch (499:8): [True: 7.50M, False: 30.1k]
  ------------------
  500|  7.50M|    {
  501|       |
  502|       |        /* Top CTB's slice header */
  503|  7.50M|        slice_header_t *ps_slice_hdr_top;
  504|  7.50M|        {
  505|  7.50M|            WORD32 cur_ctb_indx = ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
  506|  7.50M|            if(i4_is_last_ctb_y)
  ------------------
  |  Branch (506:16): [True: 8.54k, False: 7.49M]
  ------------------
  507|  8.54k|                cur_ctb_indx += ps_sps->i2_pic_wd_in_ctb;
  508|  7.50M|            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];
  509|  7.50M|        }
  510|       |
  511|  7.50M|        pu1_src = ps_deblk->pu1_cur_pic_chroma + ((ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_deblk->ps_codec->i4_strd / 2) << log2_ctb_size);
  512|  7.50M|        pu1_src += i4_is_last_ctb_y ? (ps_deblk->ps_codec->i4_strd / 2) << log2_ctb_size : 0;
  ------------------
  |  Branch (512:20): [True: 8.54k, False: 7.49M]
  ------------------
  513|       |
  514|       |        /** Deblocking is done on a shifted CTB -
  515|       |         *  Vertical edge processing is done by shifting the CTB up by four pixels */
  516|  7.50M|        pu1_src -= 4 * src_strd;
  517|       |
  518|  22.2M|        for(col = 0; col < ctb_size / 16; col++)
  ------------------
  |  Branch (518:22): [True: 14.7M, False: 7.50M]
  ------------------
  519|  14.7M|        {
  520|       |
  521|       |            /* BS for the column - Last row is excluded and the top row is included*/
  522|  14.7M|            u4_bs = pu4_vert_bs[0] << 2;
  523|       |
  524|  14.7M|            if(ps_deblk->i4_ctb_y || i4_is_last_ctb_y)
  ------------------
  |  Branch (524:16): [True: 13.7M, False: 1.03M]
  |  Branch (524:38): [True: 0, False: 1.03M]
  ------------------
  525|  13.7M|            {
  526|       |                /* Picking the last BS of the previous CTB corresponding to the same column */
  527|  13.7M|                UWORD32 *pu4_vert_bs_top = (UWORD32 *)((UWORD8 *)pu4_vert_bs - bs_strd);
  528|  13.7M|                UWORD32 u4_top_bs = (*pu4_vert_bs_top) >> ((1 << (log2_ctb_size - 1)) - 2);
  529|  13.7M|                u4_bs |= u4_top_bs & 3;
  530|  13.7M|            }
  531|       |
  532|       |            /* Every alternate boundary strength value is used for chroma */
  533|  14.7M|            u4_bs &= 0x22222222;
  534|       |
  535|  63.4M|            for(row = 0; row < ctb_size / 8;)
  ------------------
  |  Branch (535:26): [True: 48.6M, False: 14.7M]
  ------------------
  536|  48.6M|            {
  537|  48.6M|                WORD8 i1_tc_offset_div2 = ps_slice_hdr->i1_tc_offset_div2;
  538|       |
  539|  48.6M|                bs_tz = CTZ(u4_bs) >> 2;
  540|  48.6M|                if(0 != bs_tz)
  ------------------
  |  Branch (540:20): [True: 15.8M, False: 32.8M]
  ------------------
  541|  15.8M|                {
  542|  15.8M|                    if((row + bs_tz) >= (ctb_size / 8))
  ------------------
  |  Branch (542:24): [True: 10.7M, False: 5.12M]
  ------------------
  543|  10.7M|                        pu1_src += 4 * (ctb_size / 8 - row) * src_strd;
  544|  5.12M|                    else
  545|  5.12M|                        pu1_src += 4 * bs_tz  * src_strd;
  546|  15.8M|                    row += bs_tz;
  547|  15.8M|                    u4_bs = u4_bs >> (bs_tz << 2);
  548|  15.8M|                    continue;
  549|  15.8M|                }
  550|       |
  551|  32.8M|                if(0 == row)
  ------------------
  |  Branch (551:20): [True: 4.03M, False: 28.7M]
  ------------------
  552|  4.03M|                {
  553|  4.03M|                    i1_tc_offset_div2 = ps_slice_hdr_top->i1_tc_offset_div2;
  554|       |
  555|  4.03M|                    if(0 == col)
  ------------------
  |  Branch (555:24): [True: 1.46M, False: 2.57M]
  ------------------
  556|  1.46M|                    {
  557|  1.46M|                        qp_p = u4_qp_const_in_ctb[0] ?
  ------------------
  |  Branch (557:32): [True: 1.37M, False: 88.6k]
  ------------------
  558|  1.37M|                                        pu1_qp[-ctb_size / 8 * qp_strd - ctb_size / 8] :
  559|  1.46M|                                        pu1_qp[-qp_strd - 1];
  560|  1.46M|                    }
  561|  2.57M|                    else
  562|  2.57M|                    {
  563|  2.57M|                        qp_p = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (563:32): [True: 2.45M, False: 126k]
  ------------------
  564|  2.45M|                                        pu1_qp[-ctb_size / 8 * qp_strd] :
  565|  2.57M|                                        pu1_qp[2 * col - 1 - qp_strd];
  566|  2.57M|                    }
  567|       |
  568|  4.03M|                    qp_q = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (568:28): [True: 3.82M, False: 218k]
  ------------------
  569|  3.82M|                                    pu1_qp[-ctb_size / 8 * qp_strd] :
  570|  4.03M|                                    pu1_qp[2 * col - qp_strd];
  571|  4.03M|                }
  572|  28.7M|                else
  573|  28.7M|                {
  574|  28.7M|                    if(0 == col)
  ------------------
  |  Branch (574:24): [True: 10.4M, False: 18.2M]
  ------------------
  575|  10.4M|                    {
  576|  10.4M|                        qp_p = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (576:32): [True: 9.87M, False: 618k]
  ------------------
  577|  9.87M|                                        pu1_qp[-ctb_size / 8] :
  578|  10.4M|                                        pu1_qp[(row - 1) * qp_strd - 1];
  579|  10.4M|                    }
  580|  18.2M|                    else
  581|  18.2M|                    {
  582|  18.2M|                        qp_p = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (582:32): [True: 17.7M, False: 529k]
  ------------------
  583|  17.7M|                                        pu1_qp[0] :
  584|  18.2M|                                        pu1_qp[(row - 1) * qp_strd + 2 * col - 1];
  585|  18.2M|                    }
  586|       |
  587|  28.7M|                    qp_q = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (587:28): [True: 27.4M, False: 1.29M]
  ------------------
  588|  27.4M|                                    pu1_qp[0] :
  589|  28.7M|                                    pu1_qp[(row - 1) * qp_strd + 2 * col];
  590|  28.7M|                }
  591|       |
  592|  32.8M|                filter_p = (pu2_ctb_no_loop_filter_flag[row] >> (col << 1)) & 1;
  593|  32.8M|                filter_q = (pu2_ctb_no_loop_filter_flag[row] >> (col << 1)) & 2;
  594|       |                /* filter_p and filter_q are inverted as they are calculated using no_loop_filter_flags */
  595|  32.8M|                filter_p = !filter_p;
  596|  32.8M|                filter_q = !filter_q;
  597|       |
  598|  32.8M|                if(filter_p || filter_q)
  ------------------
  |  Branch (598:20): [True: 32.6M, False: 144k]
  |  Branch (598:32): [True: 34.4k, False: 110k]
  ------------------
  599|  32.8M|                {
  600|  32.8M|                    ASSERT(1 == ((u4_bs & 3) >> 1));
  ------------------
  |  |   55|  32.8M|#define ASSERT(x) assert((x))
  ------------------
  601|  32.8M|                    DUMP_DEBLK_CHROMA_VERT(pu1_src, src_strd,
  602|  32.8M|                                           u4_bs & 3, qp_p, qp_q,
  603|  32.8M|                                           ps_pps->i1_pic_cb_qp_offset,
  604|  32.8M|                                           ps_pps->i1_pic_cr_qp_offset,
  605|  32.8M|                                           ps_slice_hdr->i1_tc_offset_div2,
  606|  32.8M|                                           filter_p, filter_q);
  607|  32.8M|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (607:24): [True: 10.9M, False: 21.8M]
  ------------------
  608|  10.9M|                    {
  609|  10.9M|                        ps_codec->s_func_selector.ihevc_deblk_chroma_vert_fptr(pu1_src,
  610|  10.9M|                                                                               src_strd,
  611|  10.9M|                                                                               qp_q,
  612|  10.9M|                                                                               qp_p,
  613|  10.9M|                                                                               ps_pps->i1_pic_cr_qp_offset,
  614|  10.9M|                                                                               ps_pps->i1_pic_cb_qp_offset,
  615|  10.9M|                                                                               i1_tc_offset_div2,
  616|  10.9M|                                                                               filter_q,
  617|  10.9M|                                                                               filter_p);
  618|  10.9M|                    }
  619|  21.8M|                    else
  620|  21.8M|                    {
  621|  21.8M|                        ps_codec->s_func_selector.ihevc_deblk_chroma_vert_fptr(pu1_src,
  622|  21.8M|                                                                               src_strd,
  623|  21.8M|                                                                               qp_p,
  624|  21.8M|                                                                               qp_q,
  625|  21.8M|                                                                               ps_pps->i1_pic_cb_qp_offset,
  626|  21.8M|                                                                               ps_pps->i1_pic_cr_qp_offset,
  627|  21.8M|                                                                               i1_tc_offset_div2,
  628|  21.8M|                                                                               filter_p,
  629|  21.8M|                                                                               filter_q);
  630|  21.8M|                    }
  631|  32.8M|                }
  632|       |
  633|  32.8M|                pu1_src += 4 * src_strd;
  634|  32.8M|                u4_bs = u4_bs >> 4;
  635|  32.8M|                row++;
  636|  32.8M|            }
  637|       |
  638|  14.7M|            pu4_vert_bs += (64 == ctb_size) ? 2 : 1;
  ------------------
  |  Branch (638:28): [True: 9.11M, False: 5.64M]
  ------------------
  639|  14.7M|            pu1_src -= ((src_strd / 2) << log2_ctb_size);
  640|  14.7M|            pu1_src += 16;
  641|  14.7M|        }
  642|  7.50M|    }
  643|       |
  644|       |    /* Chroma Horizontal Edge */
  645|       |
  646|  7.53M|    if(0 == i4_is_last_ctb_y)
  ------------------
  |  Branch (646:8): [True: 7.52M, False: 10.1k]
  ------------------
  647|  7.52M|    {
  648|       |
  649|       |        /* Left CTB's slice header */
  650|  7.52M|        slice_header_t *ps_slice_hdr_left;
  651|  7.52M|        {
  652|  7.52M|            WORD32 cur_ctb_indx = ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
  653|  7.52M|            if(i4_is_last_ctb_x)
  ------------------
  |  Branch (653:16): [True: 29.7k, False: 7.49M]
  ------------------
  654|  29.7k|                cur_ctb_indx += 1;
  655|  7.52M|            ps_slice_hdr_left = ps_codec->ps_slice_hdr_base + ps_deblk->pu1_slice_idx[cur_ctb_indx - 1];
  656|  7.52M|        }
  657|       |
  658|  7.52M|        pu1_src = ps_deblk->pu1_cur_pic_chroma + ((ps_deblk->i4_ctb_x + ps_deblk->i4_ctb_y * ps_deblk->ps_codec->i4_strd / 2) << log2_ctb_size);
  659|  7.52M|        pu1_src += i4_is_last_ctb_x ? ctb_size : 0;
  ------------------
  |  Branch (659:20): [True: 29.7k, False: 7.49M]
  ------------------
  660|       |
  661|       |        /** Deblocking is done on a shifted CTB -
  662|       |         * Vertical edge processing is done by shifting the CTB up by four pixels (8 here beacuse UV are interleaved) */
  663|  7.52M|        pu1_src -= 8;
  664|  22.3M|        for(row = 0; row < ctb_size / 16; row++)
  ------------------
  |  Branch (664:22): [True: 14.8M, False: 7.52M]
  ------------------
  665|  14.8M|        {
  666|       |            /* BS for the row - Last column is excluded and the left column is included*/
  667|  14.8M|            u4_bs = pu4_horz_bs[0] << 2;
  668|       |
  669|  14.8M|            if(ps_deblk->i4_ctb_x || i4_is_last_ctb_x)
  ------------------
  |  Branch (669:16): [True: 14.1M, False: 740k]
  |  Branch (669:38): [True: 2.46k, False: 737k]
  ------------------
  670|  14.1M|            {
  671|       |                /** Picking the last BS of the previous CTB corresponding to the same row
  672|       |                * UWORD32 *pu4_horz_bs_left = (UWORD32 *)((UWORD8 *)pu4_horz_bs - (ctb_size / 8) * (ctb_size / 4) / 8 * 2);
  673|       |                */
  674|  14.1M|                UWORD32 *pu4_horz_bs_left = (UWORD32 *)((UWORD8 *)pu4_horz_bs - (1 << (2 * log2_ctb_size - 7)));
  675|  14.1M|                UWORD32 u4_left_bs = (*pu4_horz_bs_left) >> ((1 << (log2_ctb_size - 1)) - 2);
  676|  14.1M|                u4_bs |= u4_left_bs & 3;
  677|  14.1M|            }
  678|       |
  679|       |            /* Every alternate boundary strength value is used for chroma */
  680|  14.8M|            u4_bs &= 0x22222222;
  681|       |
  682|  62.7M|            for(col = 0; col < ctb_size / 8;)
  ------------------
  |  Branch (682:26): [True: 47.8M, False: 14.8M]
  ------------------
  683|  47.8M|            {
  684|  47.8M|                WORD8 i1_tc_offset_div2 = ps_slice_hdr->i1_tc_offset_div2;
  685|       |
  686|  47.8M|                bs_tz = CTZ(u4_bs) >> 2;
  687|  47.8M|                if(0 != bs_tz)
  ------------------
  |  Branch (687:20): [True: 16.1M, False: 31.7M]
  ------------------
  688|  16.1M|                {
  689|  16.1M|                    u4_bs = u4_bs >> (bs_tz << 2);
  690|       |
  691|  16.1M|                    if((col + bs_tz) >= (ctb_size / 8))
  ------------------
  |  Branch (691:24): [True: 10.8M, False: 5.27M]
  ------------------
  692|  10.8M|                        pu1_src += 8 * (ctb_size / 8 - col);
  693|  5.27M|                    else
  694|  5.27M|                        pu1_src += 8 * bs_tz;
  695|       |
  696|  16.1M|                    col += bs_tz;
  697|  16.1M|                    continue;
  698|  16.1M|                }
  699|       |
  700|  31.7M|                if(0 == col)
  ------------------
  |  Branch (700:20): [True: 3.99M, False: 27.7M]
  ------------------
  701|  3.99M|                {
  702|  3.99M|                    i1_tc_offset_div2 = ps_slice_hdr_left->i1_tc_offset_div2;
  703|       |
  704|  3.99M|                    if(0 == row)
  ------------------
  |  Branch (704:24): [True: 1.38M, False: 2.61M]
  ------------------
  705|  1.38M|                    {
  706|  1.38M|                        qp_p = u4_qp_const_in_ctb[0] ?
  ------------------
  |  Branch (706:32): [True: 1.28M, False: 91.9k]
  ------------------
  707|  1.28M|                                        pu1_qp[-ctb_size / 8 * qp_strd - ctb_size / 8] :
  708|  1.38M|                                        pu1_qp[-qp_strd - 1];
  709|  1.38M|                    }
  710|  2.61M|                    else
  711|  2.61M|                    {
  712|  2.61M|                        qp_p = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (712:32): [True: 2.48M, False: 127k]
  ------------------
  713|  2.48M|                                        pu1_qp[-ctb_size / 8] :
  714|  2.61M|                                        pu1_qp[(2 * row - 1) * qp_strd - 1];
  715|  2.61M|                    }
  716|       |
  717|  3.99M|                    qp_q = u4_qp_const_in_ctb[2] ?
  ------------------
  |  Branch (717:28): [True: 3.77M, False: 216k]
  ------------------
  718|  3.77M|                                    pu1_qp[-ctb_size / 8] :
  719|  3.99M|                                    pu1_qp[(2 * row) * qp_strd - 1];
  720|  3.99M|                }
  721|  27.7M|                else
  722|  27.7M|                {
  723|  27.7M|                    if(0 == row)
  ------------------
  |  Branch (723:24): [True: 9.64M, False: 18.0M]
  ------------------
  724|  9.64M|                    {
  725|  9.64M|                        qp_p = u4_qp_const_in_ctb[1] ?
  ------------------
  |  Branch (725:32): [True: 9.01M, False: 629k]
  ------------------
  726|  9.01M|                                        pu1_qp[-ctb_size / 8 * qp_strd] :
  727|  9.64M|                                        pu1_qp[col - 1 - qp_strd];
  728|  9.64M|                    }
  729|  18.0M|                    else
  730|  18.0M|                    {
  731|  18.0M|                        qp_p = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (731:32): [True: 17.4M, False: 644k]
  ------------------
  732|  17.4M|                                        pu1_qp[0] :
  733|  18.0M|                                        pu1_qp[(col - 1) +  (2 * row - 1) * qp_strd];
  734|  18.0M|                    }
  735|       |
  736|  27.7M|                    qp_q = u4_qp_const_in_ctb[3] ?
  ------------------
  |  Branch (736:28): [True: 26.4M, False: 1.31M]
  ------------------
  737|  26.4M|                                    pu1_qp[0] :
  738|  27.7M|                                    pu1_qp[(col - 1) + 2 * row * qp_strd];
  739|  27.7M|                }
  740|       |
  741|  31.7M|                filter_p = (pu2_ctb_no_loop_filter_flag[row << 1] >> col) & 1;
  742|  31.7M|                filter_q = (pu2_ctb_no_loop_filter_flag[(row << 1) + 1] >> col) & 1;
  743|       |                /* filter_p and filter_q are inverted as they are calculated using no_loop_filter_flags */
  744|  31.7M|                filter_p = !filter_p;
  745|  31.7M|                filter_q = !filter_q;
  746|       |
  747|  31.7M|                if(filter_p || filter_q)
  ------------------
  |  Branch (747:20): [True: 31.5M, False: 128k]
  |  Branch (747:32): [True: 60.2k, False: 68.3k]
  ------------------
  748|  31.7M|                {
  749|  31.7M|                    ASSERT(1 == ((u4_bs & 3) >> 1));
  ------------------
  |  |   55|  31.7M|#define ASSERT(x) assert((x))
  ------------------
  750|  31.7M|                    DUMP_DEBLK_CHROMA_HORZ(pu1_src, src_strd,
  751|  31.7M|                                           u4_bs & 3, qp_p, qp_q,
  752|  31.7M|                                           ps_pps->i1_pic_cb_qp_offset,
  753|  31.7M|                                           ps_pps->i1_pic_cr_qp_offset,
  754|  31.7M|                                           ps_slice_hdr->i1_tc_offset_div2,
  755|  31.7M|                                           filter_p, filter_q);
  756|  31.7M|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (756:24): [True: 10.4M, False: 21.2M]
  ------------------
  757|  10.4M|                    {
  758|  10.4M|                        ps_codec->s_func_selector.ihevc_deblk_chroma_horz_fptr(pu1_src,
  759|  10.4M|                                                                               src_strd,
  760|  10.4M|                                                                               qp_q,
  761|  10.4M|                                                                               qp_p,
  762|  10.4M|                                                                               ps_pps->i1_pic_cr_qp_offset,
  763|  10.4M|                                                                               ps_pps->i1_pic_cb_qp_offset,
  764|  10.4M|                                                                               i1_tc_offset_div2,
  765|  10.4M|                                                                               filter_q,
  766|  10.4M|                                                                               filter_p);
  767|  10.4M|                    }
  768|  21.2M|                    else
  769|  21.2M|                    {
  770|  21.2M|                        ps_codec->s_func_selector.ihevc_deblk_chroma_horz_fptr(pu1_src,
  771|  21.2M|                                                                               src_strd,
  772|  21.2M|                                                                               qp_p,
  773|  21.2M|                                                                               qp_q,
  774|  21.2M|                                                                               ps_pps->i1_pic_cb_qp_offset,
  775|  21.2M|                                                                               ps_pps->i1_pic_cr_qp_offset,
  776|  21.2M|                                                                               i1_tc_offset_div2,
  777|  21.2M|                                                                               filter_p,
  778|  21.2M|                                                                               filter_q);
  779|  21.2M|                    }
  780|  31.7M|                }
  781|       |
  782|  31.7M|                pu1_src += 8;
  783|  31.7M|                u4_bs = u4_bs >> 4;
  784|  31.7M|                col++;
  785|  31.7M|            }
  786|       |
  787|  14.8M|            pu4_horz_bs += (64 == ctb_size) ? 2 : 1;
  ------------------
  |  Branch (787:28): [True: 9.22M, False: 5.64M]
  ------------------
  788|  14.8M|            pu1_src -= ctb_size;
  789|  14.8M|            pu1_src += 8 * src_strd;
  790|       |
  791|  14.8M|        }
  792|  7.52M|    }
  793|  7.53M|}

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

ihevcd_fmt_conv_420sp_to_rgb565:
  125|  2.78k|{
  126|       |
  127|       |
  128|  2.78k|    WORD16  i2_r, i2_g, i2_b;
  129|  2.78k|    UWORD32  u4_r, u4_g, u4_b;
  130|  2.78k|    WORD16  i2_i, i2_j;
  131|  2.78k|    UWORD8  *pu1_y_src_nxt;
  132|  2.78k|    UWORD16 *pu2_rgb_dst_NextRow;
  133|       |
  134|  2.78k|    UWORD8 *pu1_u_src, *pu1_v_src;
  135|       |
  136|  2.78k|    if(is_u_first)
  ------------------
  |  Branch (136:8): [True: 2.78k, False: 0]
  ------------------
  137|  2.78k|    {
  138|  2.78k|        pu1_u_src = (UWORD8 *)pu1_uv_src;
  139|  2.78k|        pu1_v_src = (UWORD8 *)pu1_uv_src + 1;
  140|  2.78k|    }
  141|      0|    else
  142|      0|    {
  143|      0|        pu1_u_src = (UWORD8 *)pu1_uv_src + 1;
  144|      0|        pu1_v_src = (UWORD8 *)pu1_uv_src;
  145|      0|    }
  146|       |
  147|  2.78k|    pu1_y_src_nxt   = pu1_y_src + src_y_strd;
  148|  2.78k|    pu2_rgb_dst_NextRow = pu2_rgb_dst + dst_strd;
  149|       |
  150|  98.7k|    for(i2_i = 0; i2_i < (ht >> 1); i2_i++)
  ------------------
  |  Branch (150:19): [True: 95.9k, False: 2.78k]
  ------------------
  151|  95.9k|    {
  152|  88.7M|        for(i2_j = (wd >> 1); i2_j > 0; i2_j--)
  ------------------
  |  Branch (152:31): [True: 88.6M, False: 95.9k]
  ------------------
  153|  88.6M|        {
  154|  88.6M|            i2_b = ((*pu1_u_src - 128) * COEFF4 >> 13);
  ------------------
  |  |   44|  88.6M|#define COEFF4          16530
  ------------------
  155|  88.6M|            i2_g = ((*pu1_u_src - 128) * COEFF2 + (*pu1_v_src - 128) * COEFF3) >> 13;
  ------------------
  |  |   42|  88.6M|#define COEFF2          -3207
  ------------------
                          i2_g = ((*pu1_u_src - 128) * COEFF2 + (*pu1_v_src - 128) * COEFF3) >> 13;
  ------------------
  |  |   43|  88.6M|#define COEFF3          -6664
  ------------------
  156|  88.6M|            i2_r = ((*pu1_v_src - 128) * COEFF1) >> 13;
  ------------------
  |  |   41|  88.6M|#define COEFF1          13073
  ------------------
  157|       |
  158|  88.6M|            pu1_u_src += 2;
  159|  88.6M|            pu1_v_src += 2;
  160|       |            /* pixel 0 */
  161|       |            /* B */
  162|  88.6M|            u4_b = CLIP_U8(*pu1_y_src + i2_b);
  ------------------
  |  |   40|  88.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  88.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 13.7M, False: 74.8M]
  |  |  |  |  |  Branch (40:53): [True: 6.15M, False: 68.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|  88.6M|            u4_b >>= 3;
  164|       |            /* G */
  165|  88.6M|            u4_g = CLIP_U8(*pu1_y_src + i2_g);
  ------------------
  |  |   40|  88.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  88.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.15M, False: 87.4M]
  |  |  |  |  |  Branch (40:53): [True: 3.60M, False: 83.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|  88.6M|            u4_g >>= 2;
  167|       |            /* R */
  168|  88.6M|            u4_r = CLIP_U8(*pu1_y_src + i2_r);
  ------------------
  |  |   40|  88.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  88.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 8.55M, False: 80.0M]
  |  |  |  |  |  Branch (40:53): [True: 6.69M, False: 73.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  88.6M|            u4_r >>= 3;
  170|       |
  171|  88.6M|            pu1_y_src++;
  172|  88.6M|            *pu2_rgb_dst++ = ((u4_r << 11) | (u4_g << 5) | u4_b);
  173|       |
  174|       |            /* pixel 1 */
  175|       |            /* B */
  176|  88.6M|            u4_b = CLIP_U8(*pu1_y_src + i2_b);
  ------------------
  |  |   40|  88.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  88.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 13.7M, False: 74.8M]
  |  |  |  |  |  Branch (40:53): [True: 6.14M, False: 68.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|  88.6M|            u4_b >>= 3;
  178|       |            /* G */
  179|  88.6M|            u4_g = CLIP_U8(*pu1_y_src + i2_g);
  ------------------
  |  |   40|  88.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  88.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.16M, False: 87.4M]
  |  |  |  |  |  Branch (40:53): [True: 3.61M, False: 83.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  180|  88.6M|            u4_g >>= 2;
  181|       |            /* R */
  182|  88.6M|            u4_r = CLIP_U8(*pu1_y_src + i2_r);
  ------------------
  |  |   40|  88.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  88.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 8.53M, False: 80.0M]
  |  |  |  |  |  Branch (40:53): [True: 6.69M, False: 73.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  183|  88.6M|            u4_r >>= 3;
  184|       |
  185|  88.6M|            pu1_y_src++;
  186|  88.6M|            *pu2_rgb_dst++ = ((u4_r << 11) | (u4_g << 5) | u4_b);
  187|       |
  188|       |            /* pixel 2 */
  189|       |            /* B */
  190|  88.6M|            u4_b = CLIP_U8(*pu1_y_src_nxt + i2_b);
  ------------------
  |  |   40|  88.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  88.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 13.7M, False: 74.8M]
  |  |  |  |  |  Branch (40:53): [True: 6.17M, False: 68.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|  88.6M|            u4_b >>= 3;
  192|       |            /* G */
  193|  88.6M|            u4_g = CLIP_U8(*pu1_y_src_nxt + i2_g);
  ------------------
  |  |   40|  88.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  88.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.08M, False: 87.5M]
  |  |  |  |  |  Branch (40:53): [True: 3.59M, False: 83.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  194|  88.6M|            u4_g >>= 2;
  195|       |            /* R */
  196|  88.6M|            u4_r = CLIP_U8(*pu1_y_src_nxt + i2_r);
  ------------------
  |  |   40|  88.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  88.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 8.54M, False: 80.0M]
  |  |  |  |  |  Branch (40:53): [True: 6.68M, False: 73.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|  88.6M|            u4_r >>= 3;
  198|       |
  199|  88.6M|            pu1_y_src_nxt++;
  200|  88.6M|            *pu2_rgb_dst_NextRow++ = ((u4_r << 11) | (u4_g << 5) | u4_b);
  201|       |
  202|       |            /* pixel 3 */
  203|       |            /* B */
  204|  88.6M|            u4_b = CLIP_U8(*pu1_y_src_nxt + i2_b);
  ------------------
  |  |   40|  88.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  88.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 13.8M, False: 74.8M]
  |  |  |  |  |  Branch (40:53): [True: 6.17M, False: 68.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|  88.6M|            u4_b >>= 3;
  206|       |            /* G */
  207|  88.6M|            u4_g = CLIP_U8(*pu1_y_src_nxt + i2_g);
  ------------------
  |  |   40|  88.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  88.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.09M, False: 87.5M]
  |  |  |  |  |  Branch (40:53): [True: 3.60M, False: 83.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  208|  88.6M|            u4_g >>= 2;
  209|       |            /* R */
  210|  88.6M|            u4_r = CLIP_U8(*pu1_y_src_nxt + i2_r);
  ------------------
  |  |   40|  88.6M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  88.6M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 8.56M, False: 80.0M]
  |  |  |  |  |  Branch (40:53): [True: 6.68M, False: 73.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  211|  88.6M|            u4_r >>= 3;
  212|       |
  213|  88.6M|            pu1_y_src_nxt++;
  214|  88.6M|            *pu2_rgb_dst_NextRow++ = ((u4_r << 11) | (u4_g << 5) | u4_b);
  215|       |
  216|  88.6M|        }
  217|       |
  218|  95.9k|        pu1_u_src = pu1_u_src + src_uv_strd - wd;
  219|  95.9k|        pu1_v_src = pu1_v_src + src_uv_strd - wd;
  220|       |
  221|  95.9k|        pu1_y_src = pu1_y_src + (src_y_strd << 1) - wd;
  222|  95.9k|        pu1_y_src_nxt = pu1_y_src_nxt + (src_y_strd << 1) - wd;
  223|       |
  224|  95.9k|        pu2_rgb_dst = pu2_rgb_dst_NextRow - wd + dst_strd;
  225|  95.9k|        pu2_rgb_dst_NextRow = pu2_rgb_dst_NextRow + (dst_strd << 1) - wd;
  226|  95.9k|    }
  227|       |
  228|       |
  229|  2.78k|}
ihevcd_fmt_conv_420sp_to_420sp:
  391|  81.5k|{
  392|  81.5k|    UWORD8 *pu1_src, *pu1_dst;
  393|  81.5k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
  394|  81.5k|    WORD32 i;
  395|       |
  396|       |    /* copy luma */
  397|  81.5k|    pu1_src = (UWORD8 *)pu1_y_src;
  398|  81.5k|    pu1_dst = (UWORD8 *)pu1_y_dst;
  399|       |
  400|  81.5k|    num_rows = ht;
  401|  81.5k|    num_cols = wd;
  402|       |
  403|  81.5k|    src_strd = src_y_strd;
  404|  81.5k|    dst_strd = dst_y_strd;
  405|       |
  406|  3.01M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (406:16): [True: 2.93M, False: 81.5k]
  ------------------
  407|  2.93M|    {
  408|  2.93M|        memcpy(pu1_dst, pu1_src, num_cols);
  409|  2.93M|        pu1_dst += dst_strd;
  410|  2.93M|        pu1_src += src_strd;
  411|  2.93M|    }
  412|       |
  413|       |    /* copy U and V */
  414|  81.5k|    pu1_src = (UWORD8 *)pu1_uv_src;
  415|  81.5k|    pu1_dst = (UWORD8 *)pu1_uv_dst;
  416|       |
  417|  81.5k|    num_rows = ht >> 1;
  418|  81.5k|    num_cols = wd;
  419|       |
  420|  81.5k|    src_strd = src_uv_strd;
  421|  81.5k|    dst_strd = dst_uv_strd;
  422|       |
  423|  1.65M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (423:16): [True: 1.57M, False: 81.5k]
  ------------------
  424|  1.57M|    {
  425|  1.57M|        memcpy(pu1_dst, pu1_src, num_cols);
  426|  1.57M|        pu1_dst += dst_strd;
  427|  1.57M|        pu1_src += src_strd;
  428|  1.57M|    }
  429|  81.5k|    return;
  430|  81.5k|}
ihevcd_fmt_conv_420sp_to_420p:
  602|  20.4k|{
  603|  20.4k|    UWORD8 *pu1_src, *pu1_dst;
  604|  20.4k|    UWORD8 *pu1_u_src, *pu1_v_src;
  605|  20.4k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
  606|  20.4k|    WORD32 i, j;
  607|       |
  608|  20.4k|    if(0 == disable_luma_copy)
  ------------------
  |  Branch (608:8): [True: 0, False: 20.4k]
  ------------------
  609|      0|    {
  610|       |        /* copy luma */
  611|      0|        pu1_src = (UWORD8 *)pu1_y_src;
  612|      0|        pu1_dst = (UWORD8 *)pu1_y_dst;
  613|       |
  614|      0|        num_rows = ht;
  615|      0|        num_cols = wd;
  616|       |
  617|      0|        src_strd = src_y_strd;
  618|      0|        dst_strd = dst_y_strd;
  619|       |
  620|      0|        for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (620:20): [True: 0, False: 0]
  ------------------
  621|      0|        {
  622|      0|            memcpy(pu1_dst, pu1_src, num_cols);
  623|      0|            pu1_dst += dst_strd;
  624|      0|            pu1_src += src_strd;
  625|      0|        }
  626|      0|    }
  627|       |    /* de-interleave U and V and copy to destination */
  628|  20.4k|    if(is_u_first)
  ------------------
  |  Branch (628:8): [True: 20.4k, False: 18.4E]
  ------------------
  629|  20.4k|    {
  630|  20.4k|        pu1_u_src = (UWORD8 *)pu1_uv_src;
  631|  20.4k|        pu1_v_src = (UWORD8 *)pu1_uv_src + 1;
  632|  20.4k|    }
  633|  18.4E|    else
  634|  18.4E|    {
  635|  18.4E|        pu1_u_src = (UWORD8 *)pu1_uv_src + 1;
  636|  18.4E|        pu1_v_src = (UWORD8 *)pu1_uv_src;
  637|  18.4E|    }
  638|       |
  639|       |
  640|  20.4k|    num_rows = ht >> 1;
  641|  20.4k|    num_cols = wd >> 1;
  642|       |
  643|  20.4k|    src_strd = src_uv_strd;
  644|  20.4k|    dst_strd = dst_uv_strd;
  645|       |
  646|  1.69M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (646:16): [True: 1.67M, False: 20.4k]
  ------------------
  647|  1.67M|    {
  648|   591M|        for(j = 0; j < num_cols; j++)
  ------------------
  |  Branch (648:20): [True: 589M, False: 1.67M]
  ------------------
  649|   589M|        {
  650|   589M|            pu1_u_dst[j] = pu1_u_src[j * 2];
  651|   589M|            pu1_v_dst[j] = pu1_v_src[j * 2];
  652|   589M|        }
  653|       |
  654|  1.67M|        pu1_u_dst += dst_strd;
  655|  1.67M|        pu1_v_dst += dst_strd;
  656|  1.67M|        pu1_u_src += src_strd;
  657|  1.67M|        pu1_v_src += src_strd;
  658|  1.67M|    }
  659|  20.4k|    return;
  660|  20.4k|}
ihevcd_fmt_conv:
  699|   191k|{
  700|   191k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  701|   191k|    pic_buf_t *ps_disp_pic;
  702|   191k|    UWORD8 *pu1_y_src, *pu1_uv_src;
  703|   191k|    UWORD8 *pu1_y_dst_tmp, *pu1_uv_dst_tmp;
  704|   191k|    UWORD8 *pu1_u_dst_tmp, *pu1_v_dst_tmp;
  705|   191k|    UWORD16 *pu2_rgb_dst_tmp;
  706|   191k|    UWORD32 *pu4_rgb_dst_tmp;
  707|   191k|    WORD32 is_u_first;
  708|   191k|    UWORD8 *pu1_luma;
  709|   191k|    UWORD8 *pu1_chroma;
  710|   191k|    sps_t *ps_sps;
  711|   191k|    WORD32 disable_luma_copy;
  712|   191k|    WORD32 crop_unit_x, crop_unit_y;
  713|       |
  714|   191k|    if(0 == num_rows)
  ------------------
  |  Branch (714:8): [True: 44.6k, False: 147k]
  ------------------
  715|  44.6k|        return ret;
  716|       |
  717|       |    /* In case processing is disabled, then no need to format convert/copy */
  718|   147k|    PROFILE_DISABLE_FMT_CONV();
  ------------------
  |  |   78|   147k|#define PROFILE_DISABLE_FMT_CONV();
  ------------------
  719|   147k|    ps_sps = ps_proc->ps_sps;
  720|       |
  721|   147k|    crop_unit_x = 1;
  722|   147k|    crop_unit_y = 1;
  723|       |
  724|   147k|    if(CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (724:8): [True: 147k, False: 18.4E]
  ------------------
  725|   147k|    {
  726|   147k|        crop_unit_x = 2;
  727|   147k|        crop_unit_y = 2;
  728|   147k|    }
  729|       |
  730|   147k|    ps_disp_pic = ps_codec->ps_disp_buf;
  731|   147k|    pu1_luma = ps_disp_pic->pu1_luma;
  732|   147k|    pu1_chroma = ps_disp_pic->pu1_chroma;
  733|       |
  734|       |
  735|       |    /* Take care of cropping */
  736|   147k|    pu1_luma    += ps_codec->i4_strd * ps_sps->i2_pic_crop_top_offset * crop_unit_y + ps_sps->i2_pic_crop_left_offset * crop_unit_x;
  737|       |
  738|       |    /* Left offset is multiplied by 2 because buffer is UV interleaved */
  739|   147k|    pu1_chroma  += ps_codec->i4_strd * ps_sps->i2_pic_crop_top_offset + ps_sps->i2_pic_crop_left_offset * 2;
  740|       |
  741|       |
  742|   147k|    is_u_first = (IV_YUV_420SP_UV == ps_codec->e_ref_chroma_fmt) ? 1 : 0;
  ------------------
  |  Branch (742:18): [True: 95.2k, False: 52.0k]
  ------------------
  743|       |
  744|       |    /* In case of 420P output luma copy is disabled for shared mode */
  745|   147k|    disable_luma_copy = 0;
  746|   147k|    if(1 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (746:8): [True: 0, False: 147k]
  ------------------
  747|      0|    {
  748|      0|        disable_luma_copy = 1;
  749|      0|    }
  750|       |
  751|       |
  752|       |
  753|   147k|    {
  754|   147k|        pu1_y_src   = pu1_luma + cur_row * ps_codec->i4_strd;
  755|   147k|        pu1_uv_src  = pu1_chroma + (cur_row / 2) * ps_codec->i4_strd;
  756|       |
  757|       |        /* In case of shared mode, with 420P output, get chroma destination */
  758|   147k|        if((1 == ps_codec->i4_share_disp_buf) && (IV_YUV_420P == ps_codec->e_chroma_fmt))
  ------------------
  |  Branch (758:12): [True: 0, False: 147k]
  |  Branch (758:50): [True: 0, False: 0]
  ------------------
  759|      0|        {
  760|      0|            WORD32 i;
  761|      0|            for(i = 0; i < ps_codec->i4_share_disp_buf_cnt; i++)
  ------------------
  |  Branch (761:24): [True: 0, False: 0]
  ------------------
  762|      0|            {
  763|      0|                WORD32 diff = ps_disp_pic->pu1_luma - ps_codec->s_disp_buffer[i].pu1_bufs[0];
  764|      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 (764:20): [True: 0, False: 0]
  ------------------
  765|      0|                {
  766|      0|                    pu1_u_dst = ps_codec->s_disp_buffer[i].pu1_bufs[1];
  767|      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
  ------------------
  768|       |
  769|      0|                    pu1_v_dst = ps_codec->s_disp_buffer[i].pu1_bufs[2];
  770|      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
  ------------------
  771|      0|                    break;
  772|      0|                }
  773|      0|            }
  774|      0|        }
  775|   147k|        pu2_rgb_dst_tmp  = (UWORD16 *)pu1_y_dst;
  776|   147k|        pu2_rgb_dst_tmp  += cur_row * ps_codec->i4_disp_strd;
  777|   147k|        pu4_rgb_dst_tmp  = (UWORD32 *)pu1_y_dst;
  778|   147k|        pu4_rgb_dst_tmp  += cur_row * ps_codec->i4_disp_strd;
  779|   147k|        pu1_y_dst_tmp  = pu1_y_dst  + cur_row * ps_codec->i4_disp_strd;
  780|   147k|        pu1_uv_dst_tmp = pu1_u_dst  + (cur_row / 2) * ps_codec->i4_disp_strd;
  781|   147k|        pu1_u_dst_tmp = pu1_u_dst  + (cur_row / 2) * ps_codec->i4_disp_strd / 2;
  782|   147k|        pu1_v_dst_tmp = pu1_v_dst  + (cur_row / 2) * ps_codec->i4_disp_strd / 2;
  783|       |
  784|       |        /* In case of multi threaded implementation, format conversion might be called
  785|       |         * before reconstruction is completed. If the frame being converted/copied
  786|       |         * is same as the frame being reconstructed,
  787|       |         * Check how many rows can be format converted
  788|       |         * Convert those many rows and then check for remaining rows and so on
  789|       |         */
  790|       |
  791|   147k|        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 (791:12): [True: 147k, False: 16]
  |  Branch (791:46): [True: 126k, False: 20.3k]
  |  Branch (791:106): [True: 125k, False: 1.87k]
  ------------------
  792|   125k|        {
  793|   125k|            WORD32 idx;
  794|   125k|            UWORD8 *pu1_buf;
  795|   125k|            WORD32 status;
  796|   125k|            WORD32 last_row = cur_row + num_rows;
  797|   125k|            WORD32 last_ctb_y;
  798|   125k|            UWORD32 ctb_in_row;
  799|       |
  800|  2.65M|            while(1)
  ------------------
  |  Branch (800:19): [Folded - Ignored]
  ------------------
  801|  2.65M|            {
  802|  2.65M|                last_row = cur_row + MAX(num_rows, (1 << ps_sps->i1_log2_ctb_size)) +
  ------------------
  |  |   42|  2.65M|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 0, False: 2.65M]
  |  |  ------------------
  ------------------
  803|  2.65M|                                ps_sps->i2_pic_crop_top_offset * crop_unit_y;
  804|  2.65M|                last_ctb_y = (last_row >> ps_sps->i1_log2_ctb_size) - 1;
  805|       |                /* Since deblocking works with a shift of -4, -4 ,wait till next CTB row is processed */
  806|  2.65M|                last_ctb_y++;
  807|       |                /* In case of a  conformance window, an extra wait of one row might be needed */
  808|  2.65M|                last_ctb_y++;
  809|  2.65M|                last_ctb_y = MIN(last_ctb_y, (ps_sps->i2_pic_ht_in_ctb - 1));
  ------------------
  |  |   43|  2.65M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.81M, False: 836k]
  |  |  ------------------
  ------------------
  810|       |
  811|  2.65M|                idx = (last_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  812|       |
  813|       |                /*Check if the row below is completely processed before proceeding with format conversion*/
  814|  2.65M|                status = 1;
  815|   162M|                for(ctb_in_row = 0; (WORD32)ctb_in_row < ps_sps->i2_pic_wd_in_ctb; ctb_in_row++)
  ------------------
  |  Branch (815:37): [True: 159M, False: 2.65M]
  ------------------
  816|   159M|                {
  817|   159M|                    pu1_buf = (ps_codec->pu1_proc_map + idx + ctb_in_row);
  818|   159M|                    status &= *pu1_buf;
  819|   159M|                }
  820|       |
  821|  2.65M|                if(status)
  ------------------
  |  Branch (821:20): [True: 124k, False: 2.53M]
  ------------------
  822|   124k|                {
  823|   124k|                    break;
  824|   124k|                }
  825|  2.53M|                else
  826|  2.53M|                {
  827|  2.53M|                    ithread_yield();
  828|  2.53M|                }
  829|  2.65M|            }
  830|   125k|        }
  831|       |
  832|       |
  833|   147k|        if((IV_YUV_420SP_UV == ps_codec->e_chroma_fmt) || (IV_YUV_420SP_VU == ps_codec->e_chroma_fmt))
  ------------------
  |  Branch (833:12): [True: 29.5k, False: 117k]
  |  Branch (833:59): [True: 51.9k, False: 65.6k]
  ------------------
  834|  81.5k|        {
  835|  81.5k|            ihevcd_fmt_conv_420sp_to_420sp_ft *fmt_conv_fptr;
  836|  81.5k|            if(ps_codec->i4_disp_wd >= MIN_FMT_CONV_SIMD_WIDTH)
  ------------------
  |  |   69|  81.5k|#define MIN_FMT_CONV_SIMD_WIDTH 32
  ------------------
  |  Branch (836:16): [True: 81.2k, False: 331]
  ------------------
  837|  81.2k|            {
  838|  81.2k|                fmt_conv_fptr = ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420sp_fptr;
  839|  81.2k|            }
  840|    331|            else
  841|    331|            {
  842|    331|                fmt_conv_fptr = ihevcd_fmt_conv_420sp_to_420sp;
  843|    331|            }
  844|  81.5k|            fmt_conv_fptr(pu1_y_src, pu1_uv_src,
  845|  81.5k|                          pu1_y_dst_tmp, pu1_uv_dst_tmp,
  846|  81.5k|                          ps_codec->i4_disp_wd,
  847|  81.5k|                          num_rows,
  848|  81.5k|                          ps_codec->i4_strd,
  849|  81.5k|                          ps_codec->i4_strd,
  850|  81.5k|                          ps_codec->i4_disp_strd,
  851|  81.5k|                          ps_codec->i4_disp_strd);
  852|  81.5k|        }
  853|  65.6k|        else if(IV_YUV_420P == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (853:17): [True: 25.5k, False: 40.1k]
  ------------------
  854|  25.5k|        {
  855|  25.5k|            ihevcd_fmt_conv_420sp_to_420p_ft *fmt_conv_fptr;
  856|  25.5k|            if(ps_codec->i4_disp_wd >= MIN_FMT_CONV_SIMD_WIDTH)
  ------------------
  |  |   69|  25.5k|#define MIN_FMT_CONV_SIMD_WIDTH 32
  ------------------
  |  Branch (856:16): [True: 25.0k, False: 434]
  ------------------
  857|  25.0k|            {
  858|  25.0k|                fmt_conv_fptr = ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420p_fptr;
  859|  25.0k|            }
  860|    434|            else
  861|    434|            {
  862|    434|                fmt_conv_fptr = ihevcd_fmt_conv_420sp_to_420p;
  863|    434|            }
  864|       |
  865|  25.5k|            if(0 == disable_luma_copy)
  ------------------
  |  Branch (865:16): [True: 25.5k, False: 4]
  ------------------
  866|  25.5k|            {
  867|       |                // copy luma
  868|  25.5k|                WORD32 i;
  869|  25.5k|                WORD32 num_cols = ps_codec->i4_disp_wd;
  870|       |
  871|  4.00M|                for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (871:28): [True: 3.98M, False: 25.5k]
  ------------------
  872|  3.98M|                {
  873|  3.98M|                    memcpy(pu1_y_dst_tmp, pu1_y_src, num_cols);
  874|  3.98M|                    pu1_y_dst_tmp += ps_codec->i4_disp_strd;
  875|  3.98M|                    pu1_y_src += ps_codec->i4_strd;
  876|  3.98M|                }
  877|       |
  878|  25.5k|                disable_luma_copy = 1;
  879|  25.5k|            }
  880|  25.5k|            fmt_conv_fptr(pu1_y_src, pu1_uv_src,
  881|  25.5k|                          pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp,
  882|  25.5k|                          ps_codec->i4_disp_wd,
  883|  25.5k|                          num_rows,
  884|  25.5k|                          ps_codec->i4_strd,
  885|  25.5k|                          ps_codec->i4_strd,
  886|  25.5k|                          ps_codec->i4_disp_strd,
  887|  25.5k|                          (ps_codec->i4_disp_strd / 2),
  888|  25.5k|                          is_u_first,
  889|  25.5k|                          disable_luma_copy);
  890|  25.5k|        }
  891|  40.1k|        else if(IV_RGB_565 == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (891:17): [True: 2.78k, False: 37.3k]
  ------------------
  892|  2.78k|        {
  893|  2.78k|            ihevcd_fmt_conv_420sp_to_rgb565_ft *fmt_conv_fptr;
  894|  2.78k|            if(ps_codec->i4_disp_wd >= MIN_FMT_CONV_SIMD_WIDTH)
  ------------------
  |  |   69|  2.78k|#define MIN_FMT_CONV_SIMD_WIDTH 32
  ------------------
  |  Branch (894:16): [True: 2.78k, False: 0]
  ------------------
  895|  2.78k|            {
  896|  2.78k|                fmt_conv_fptr = ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgb565_fptr;
  897|  2.78k|            }
  898|      0|            else
  899|      0|            {
  900|      0|                fmt_conv_fptr = ihevcd_fmt_conv_420sp_to_rgb565;
  901|      0|            }
  902|       |
  903|  2.78k|            fmt_conv_fptr(pu1_y_src, pu1_uv_src,
  904|  2.78k|                          pu2_rgb_dst_tmp,
  905|  2.78k|                          ps_codec->i4_disp_wd,
  906|  2.78k|                          num_rows,
  907|  2.78k|                          ps_codec->i4_strd,
  908|  2.78k|                          ps_codec->i4_strd,
  909|  2.78k|                          ps_codec->i4_disp_strd,
  910|  2.78k|                          is_u_first);
  911|  2.78k|        }
  912|  37.3k|        else if(IV_RGBA_8888 == ps_codec->e_chroma_fmt)
  ------------------
  |  Branch (912:17): [True: 0, False: 37.3k]
  ------------------
  913|      0|        {
  914|      0|            ihevcd_fmt_conv_420sp_to_rgba8888_ft *fmt_conv_fptr;
  915|      0|            if(ps_codec->i4_disp_wd >= MIN_FMT_CONV_SIMD_WIDTH)
  ------------------
  |  |   69|      0|#define MIN_FMT_CONV_SIMD_WIDTH 32
  ------------------
  |  Branch (915:16): [True: 0, False: 0]
  ------------------
  916|      0|            {
  917|      0|                fmt_conv_fptr = ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgba8888_fptr;
  918|      0|            }
  919|      0|            else
  920|      0|            {
  921|      0|                fmt_conv_fptr = ihevcd_fmt_conv_420sp_to_rgba8888;
  922|      0|            }
  923|       |
  924|      0|            ASSERT(is_u_first == 1);
  ------------------
  |  |   55|      0|#define ASSERT(x) assert((x))
  ------------------
  925|      0|            fmt_conv_fptr(pu1_y_src,
  926|      0|                          pu1_uv_src,
  927|      0|                          pu4_rgb_dst_tmp,
  928|      0|                          ps_codec->i4_disp_wd,
  929|      0|                          num_rows,
  930|      0|                          ps_codec->i4_strd,
  931|      0|                          ps_codec->i4_strd,
  932|      0|                          ps_codec->i4_disp_strd,
  933|      0|                          is_u_first);
  934|      0|        }
  935|       |
  936|       |
  937|       |
  938|   147k|    }
  939|   147k|    return (ret);
  940|   147k|}

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

ihevcd_inter_pred_ctb:
  114|   498k|{
  115|   498k|    UWORD8 *ref_pic_luma_l0, *ref_pic_chroma_l0;
  116|   498k|    UWORD8 *ref_pic_luma_l1, *ref_pic_chroma_l1;
  117|       |
  118|   498k|    UWORD8 *ref_pic_l0 = NULL, *ref_pic_l1 = NULL;
  119|       |
  120|   498k|    slice_header_t *ps_slice_hdr;
  121|   498k|    sps_t *ps_sps;
  122|   498k|    pps_t *ps_pps;
  123|   498k|    pu_t *ps_pu;
  124|   498k|    codec_t *ps_codec;
  125|   498k|    WORD32 pu_indx;
  126|   498k|    WORD32 pu_x, pu_y;
  127|   498k|    WORD32 pu_wd, pu_ht;
  128|   498k|    WORD32 i4_pu_cnt;
  129|   498k|    WORD32 cur_ctb_idx;
  130|       |
  131|   498k|    WORD32 clr_indx;
  132|   498k|    WORD32 ntaps;
  133|       |
  134|       |
  135|       |
  136|   498k|    WORD32 ai2_xint[2] = { 0, 0 }, ai2_yint[2] = { 0, 0 };
  137|   498k|    WORD32 ai2_xfrac[2] = { 0, 0 }, ai2_yfrac[2] = { 0, 0 };
  138|       |
  139|   498k|    WORD32 weighted_pred, bi_pred;
  140|       |
  141|   498k|    WORD32 ref_strd;
  142|   498k|    UWORD8 *pu1_dst_luma, *pu1_dst_chroma;
  143|       |
  144|   498k|    UWORD8 *pu1_dst;
  145|       |
  146|   498k|    WORD16 *pi2_tmp1, *pi2_tmp2;
  147|       |
  148|   498k|    WORD32 luma_weight_l0, luma_weight_l1;
  149|   498k|    WORD32 chroma_weight_l0_cb, chroma_weight_l1_cb, chroma_weight_l0_cr, chroma_weight_l1_cr;
  150|   498k|    WORD32 luma_offset_l0, luma_offset_l1;
  151|   498k|    WORD32 chroma_offset_l0_cb, chroma_offset_l1_cb, chroma_offset_l0_cr, chroma_offset_l1_cr;
  152|   498k|    WORD32 shift, lvl_shift1, lvl_shift2;
  153|       |
  154|   498k|    pf_inter_pred func_ptr1, func_ptr2, func_ptr3, func_ptr4;
  155|   498k|    WORD32 func_indx1, func_indx2, func_indx3, func_indx4;
  156|   498k|    void *func_src;
  157|   498k|    void *func_dst;
  158|   498k|    WORD32 func_src_strd;
  159|   498k|    WORD32 func_dst_strd;
  160|   498k|    WORD8 *func_coeff;
  161|   498k|    WORD32 func_wd;
  162|   498k|    WORD32 func_ht;
  163|   498k|    WORD32 next_ctb_idx;
  164|   498k|    WORD8(*coeff)[8];
  165|   498k|    WORD32  chroma_yuv420sp_vu;
  166|       |
  167|   498k|    PROFILE_DISABLE_INTER_PRED();
  ------------------
  |  |   69|   498k|#define PROFILE_DISABLE_INTER_PRED() ;
  ------------------
  168|   498k|    ps_codec = ps_proc->ps_codec;
  169|   498k|    ps_slice_hdr = ps_proc->ps_slice_hdr;
  170|   498k|    ps_pps = ps_proc->ps_pps;
  171|   498k|    ps_sps = ps_proc->ps_sps;
  172|   498k|    cur_ctb_idx = ps_proc->i4_ctb_x
  173|   498k|                    + ps_proc->i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
  174|       |    /*
  175|       |     * In case of tiles, the next ctb belonging to the same tile must be used to get the PU index
  176|       |     */
  177|       |
  178|   498k|    next_ctb_idx = ps_proc->i4_next_pu_ctb_cnt;
  179|   498k|    i4_pu_cnt = ps_proc->pu4_pic_pu_idx[next_ctb_idx] - ps_proc->pu4_pic_pu_idx[cur_ctb_idx];
  180|       |
  181|   498k|    ps_pu = ps_proc->ps_pu;
  182|   498k|    ref_strd = ps_codec->i4_strd;
  183|   498k|    pi2_tmp1 = ps_proc->pi2_inter_pred_tmp_buf1;
  184|   498k|    pi2_tmp2 = ps_proc->pi2_inter_pred_tmp_buf2;
  185|   498k|    pu1_dst_luma = ps_proc->pu1_cur_pic_luma;
  186|   498k|    pu1_dst_chroma = ps_proc->pu1_cur_pic_chroma;
  187|       |
  188|   498k|    chroma_yuv420sp_vu = (ps_codec->e_ref_chroma_fmt == IV_YUV_420SP_VU);
  189|       |
  190|   498k|    ASSERT(PSLICE == ps_slice_hdr->i1_slice_type || BSLICE == ps_slice_hdr->i1_slice_type);
  ------------------
  |  |   55|   498k|#define ASSERT(x) assert((x))
  ------------------
  191|       |
  192|   499k|    ref_pic_luma_l0 = NULL;
  193|   499k|    ref_pic_chroma_l0 = NULL;
  194|       |
  195|   499k|    luma_weight_l0 = 0;
  196|   499k|    chroma_weight_l0_cb = 0;
  197|   499k|    chroma_weight_l0_cr = 0;
  198|       |
  199|   499k|    luma_offset_l0 = 0;
  200|   499k|    chroma_offset_l0_cb = 0;
  201|   499k|    chroma_offset_l0_cr = 0;
  202|       |
  203|   499k|    ref_pic_luma_l1 = NULL;
  204|   499k|    ref_pic_chroma_l1 = NULL;
  205|       |
  206|   499k|    luma_weight_l1 = 0;
  207|   499k|    chroma_weight_l1_cb = 0;
  208|   499k|    chroma_weight_l1_cr = 0;
  209|       |
  210|   499k|    luma_offset_l1 = 0;
  211|   499k|    chroma_offset_l1_cb = 0;
  212|   499k|    chroma_offset_l1_cr = 0;
  213|       |
  214|  8.22M|    for(pu_indx = 0; pu_indx < i4_pu_cnt; pu_indx++, ps_pu++)
  ------------------
  |  Branch (214:22): [True: 7.73M, False: 499k]
  ------------------
  215|  7.73M|    {
  216|       |        /* If the PU is intra then proceed to the next */
  217|  7.73M|        if(1 == ps_pu->b1_intra_flag)
  ------------------
  |  Branch (217:12): [True: 47.1k, False: 7.68M]
  ------------------
  218|  47.1k|            continue;
  219|  7.68M|        pu_x = (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size) + (ps_pu->b4_pos_x << 2);
  220|  7.68M|        pu_y = (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size) + (ps_pu->b4_pos_y << 2);
  221|       |
  222|  7.68M|        pu_wd = (ps_pu->b4_wd + 1) << 2;
  223|  7.68M|        pu_ht = (ps_pu->b4_ht + 1) << 2;
  224|       |
  225|  7.68M|        weighted_pred = (ps_slice_hdr->i1_slice_type == PSLICE) ? ps_pps->i1_weighted_pred_flag :
  ------------------
  |  Branch (225:25): [True: 262k, False: 7.42M]
  ------------------
  226|  7.68M|                        ps_pps->i1_weighted_bipred_flag;
  227|  7.68M|        bi_pred = (ps_pu->b2_pred_mode == PRED_BI);
  228|       |
  229|  7.68M|        if(ps_pu->b2_pred_mode != PRED_L1)
  ------------------
  |  Branch (229:12): [True: 7.51M, False: 163k]
  ------------------
  230|  7.51M|        {
  231|  7.51M|            pic_buf_t *ps_pic_buf_l0;
  232|       |
  233|  7.51M|            ps_pic_buf_l0 = (pic_buf_t *)((ps_slice_hdr->as_ref_pic_list0[ps_pu->mv.i1_l0_ref_idx].pv_pic_buf));
  234|       |
  235|  7.51M|            ref_pic_luma_l0 = ps_pic_buf_l0->pu1_luma;
  236|  7.51M|            ref_pic_chroma_l0 = ps_pic_buf_l0->pu1_chroma;
  237|       |
  238|  7.51M|            luma_weight_l0 = ps_slice_hdr->s_wt_ofst.i2_luma_weight_l0[ps_pu->mv.i1_l0_ref_idx];
  239|  7.51M|            chroma_weight_l0_cb = ps_slice_hdr->s_wt_ofst.i2_chroma_weight_l0_cb[ps_pu->mv.i1_l0_ref_idx];
  240|  7.51M|            chroma_weight_l0_cr = ps_slice_hdr->s_wt_ofst.i2_chroma_weight_l0_cr[ps_pu->mv.i1_l0_ref_idx];
  241|       |
  242|  7.51M|            luma_offset_l0 = ps_slice_hdr->s_wt_ofst.i2_luma_offset_l0[ps_pu->mv.i1_l0_ref_idx];
  243|  7.51M|            chroma_offset_l0_cb = ps_slice_hdr->s_wt_ofst.i2_chroma_offset_l0_cb[ps_pu->mv.i1_l0_ref_idx];
  244|  7.51M|            chroma_offset_l0_cr = ps_slice_hdr->s_wt_ofst.i2_chroma_offset_l0_cr[ps_pu->mv.i1_l0_ref_idx];
  245|  7.51M|        }
  246|       |
  247|  7.68M|        if(ps_pu->b2_pred_mode != PRED_L0)
  ------------------
  |  Branch (247:12): [True: 5.14M, False: 2.53M]
  ------------------
  248|  5.14M|        {
  249|  5.14M|            pic_buf_t *ps_pic_buf_l1;
  250|  5.14M|            ps_pic_buf_l1 = (pic_buf_t *)((ps_slice_hdr->as_ref_pic_list1[ps_pu->mv.i1_l1_ref_idx].pv_pic_buf));
  251|  5.14M|            ref_pic_luma_l1 = ps_pic_buf_l1->pu1_luma;
  252|  5.14M|            ref_pic_chroma_l1 = ps_pic_buf_l1->pu1_chroma;
  253|       |
  254|  5.14M|            luma_weight_l1 = ps_slice_hdr->s_wt_ofst.i2_luma_weight_l1[ps_pu->mv.i1_l1_ref_idx];
  255|  5.14M|            chroma_weight_l1_cb = ps_slice_hdr->s_wt_ofst.i2_chroma_weight_l1_cb[ps_pu->mv.i1_l1_ref_idx];
  256|  5.14M|            chroma_weight_l1_cr = ps_slice_hdr->s_wt_ofst.i2_chroma_weight_l1_cr[ps_pu->mv.i1_l1_ref_idx];
  257|       |
  258|  5.14M|            luma_offset_l1 = ps_slice_hdr->s_wt_ofst.i2_luma_offset_l1[ps_pu->mv.i1_l1_ref_idx];
  259|  5.14M|            chroma_offset_l1_cb = ps_slice_hdr->s_wt_ofst.i2_chroma_offset_l1_cb[ps_pu->mv.i1_l1_ref_idx];
  260|  5.14M|            chroma_offset_l1_cr = ps_slice_hdr->s_wt_ofst.i2_chroma_offset_l1_cr[ps_pu->mv.i1_l1_ref_idx];
  261|  5.14M|        }
  262|       |
  263|       |        /*luma and chroma components*/
  264|  22.9M|        for(clr_indx = 0; clr_indx < 2; clr_indx++)
  ------------------
  |  Branch (264:27): [True: 15.2M, False: 7.68M]
  ------------------
  265|  15.2M|        {
  266|  15.2M|            PROFILE_DISABLE_INTER_PRED_LUMA(clr_indx);
  ------------------
  |  |   98|  15.2M|#define PROFILE_DISABLE_INTER_PRED_LUMA(clr_indx) ;
  ------------------
  267|  15.2M|            PROFILE_DISABLE_INTER_PRED_CHROMA(clr_indx);
  ------------------
  |  |   99|  15.2M|#define PROFILE_DISABLE_INTER_PRED_CHROMA(clr_indx) ;
  ------------------
  268|       |
  269|  15.2M|            if(clr_indx == 0)
  ------------------
  |  Branch (269:16): [True: 7.68M, False: 7.53M]
  ------------------
  270|  7.68M|            {
  271|  7.68M|                WORD32 mv;
  272|  7.68M|                if(ps_pu->b2_pred_mode != PRED_L1)
  ------------------
  |  Branch (272:20): [True: 7.50M, False: 178k]
  ------------------
  273|  7.50M|                {
  274|  7.50M|                    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|  7.50M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 44.0k, False: 7.46M]
  |  |  |  Branch (40:53): [True: 45.4k, False: 7.42M]
  |  |  ------------------
  ------------------
  275|  7.50M|                    ai2_xint[0] = pu_x + (mv >> 2);
  276|  7.50M|                    ai2_xfrac[0] = mv & 3;
  277|       |
  278|  7.50M|                    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|  7.50M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 502k, False: 7.00M]
  |  |  |  Branch (40:53): [True: 44.9k, False: 6.96M]
  |  |  ------------------
  ------------------
  279|  7.50M|                    ai2_yint[0] = pu_y + (mv >> 2);
  280|  7.50M|                    ai2_yfrac[0] = mv & 3;
  281|       |
  282|  7.50M|                    ai2_xfrac[0] &= ps_codec->i4_mv_frac_mask;
  283|  7.50M|                    ai2_yfrac[0] &= ps_codec->i4_mv_frac_mask;
  284|       |
  285|       |
  286|  7.50M|                    ref_pic_l0 = ref_pic_luma_l0 + ai2_yint[0] * ref_strd
  287|  7.50M|                                    + ai2_xint[0];
  288|  7.50M|                }
  289|       |
  290|  7.68M|                if(ps_pu->b2_pred_mode != PRED_L0)
  ------------------
  |  Branch (290:20): [True: 5.22M, False: 2.45M]
  ------------------
  291|  5.22M|                {
  292|       |
  293|  5.22M|                    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|  5.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 67.0k, False: 5.16M]
  |  |  |  Branch (40:53): [True: 45.6k, False: 5.11M]
  |  |  ------------------
  ------------------
  294|  5.22M|                    ai2_xint[1] = pu_x + (mv >> 2);
  295|  5.22M|                    ai2_xfrac[1] = mv & 3;
  296|       |
  297|  5.22M|                    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|  5.22M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 257k, False: 4.97M]
  |  |  |  Branch (40:53): [True: 6.41k, False: 4.96M]
  |  |  ------------------
  ------------------
  298|  5.22M|                    ai2_yint[1] = pu_y + (mv >> 2);
  299|  5.22M|                    ai2_yfrac[1] = mv & 3;
  300|       |
  301|  5.22M|                    ref_pic_l1 = ref_pic_luma_l1 + ai2_yint[1] * ref_strd
  302|  5.22M|                                    + ai2_xint[1];
  303|  5.22M|                    ai2_xfrac[1] &= ps_codec->i4_mv_frac_mask;
  304|  5.22M|                    ai2_yfrac[1] &= ps_codec->i4_mv_frac_mask;
  305|       |
  306|  5.22M|                }
  307|       |
  308|  7.68M|                pu1_dst = pu1_dst_luma + pu_y * ref_strd + pu_x;
  309|       |
  310|  7.68M|                ntaps = NTAPS_LUMA;
  ------------------
  |  |   39|  7.68M|#define NTAPS_LUMA 8
  ------------------
  311|  7.68M|                coeff = gai1_luma_filter;
  312|  7.68M|            }
  313|       |
  314|  7.53M|            else
  315|  7.53M|            {
  316|  7.53M|                WORD32 mv;
  317|       |                /* xint is upshifted by 1 because the chroma components are  */
  318|       |                /* interleaved which is not the assumption made by standard  */
  319|  7.53M|                if(ps_pu->b2_pred_mode != PRED_L1)
  ------------------
  |  Branch (319:20): [True: 7.55M, False: 18.4E]
  ------------------
  320|  7.55M|                {
  321|  7.55M|                    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|  7.55M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 44.1k, False: 7.51M]
  |  |  |  Branch (40:53): [True: 45.2k, False: 7.46M]
  |  |  ------------------
  ------------------
  322|  7.55M|                    ai2_xint[0] = (pu_x / 2 + (mv >> 3)) << 1;
  323|  7.55M|                    ai2_xfrac[0] = mv & 7;
  324|       |
  325|  7.55M|                    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|  7.55M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 517k, False: 7.03M]
  |  |  |  Branch (40:53): [True: 46.8k, False: 6.99M]
  |  |  ------------------
  ------------------
  326|  7.55M|                    ai2_yint[0] = pu_y / 2 + (mv >> 3);
  327|  7.55M|                    ai2_yfrac[0] = mv & 7;
  328|       |
  329|  7.55M|                    ref_pic_l0 = ref_pic_chroma_l0 + ai2_yint[0] * ref_strd
  330|  7.55M|                                    + ai2_xint[0];
  331|       |
  332|  7.55M|                    ai2_xfrac[0] &= ps_codec->i4_mv_frac_mask;
  333|  7.55M|                    ai2_yfrac[0] &= ps_codec->i4_mv_frac_mask;
  334|       |
  335|  7.55M|                }
  336|       |
  337|  7.53M|                if(ps_pu->b2_pred_mode != PRED_L0)
  ------------------
  |  Branch (337:20): [True: 5.17M, False: 2.36M]
  ------------------
  338|  5.17M|                {
  339|  5.17M|                    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|  5.17M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 66.4k, False: 5.10M]
  |  |  |  Branch (40:53): [True: 45.1k, False: 5.06M]
  |  |  ------------------
  ------------------
  340|  5.17M|                    ai2_xint[1] = (pu_x / 2 + (mv >> 3)) << 1;
  341|  5.17M|                    ai2_xfrac[1] = mv & 7;
  342|       |
  343|  5.17M|                    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|  5.17M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 253k, False: 4.92M]
  |  |  |  Branch (40:53): [True: 6.39k, False: 4.91M]
  |  |  ------------------
  ------------------
  344|  5.17M|                    ai2_yint[1] = pu_y / 2 + (mv >> 3);
  345|  5.17M|                    ai2_yfrac[1] = mv & 7;
  346|       |
  347|  5.17M|                    ref_pic_l1 = ref_pic_chroma_l1 + ai2_yint[1] * ref_strd
  348|  5.17M|                                    + ai2_xint[1];
  349|  5.17M|                    ai2_xfrac[1] &= ps_codec->i4_mv_frac_mask;
  350|  5.17M|                    ai2_yfrac[1] &= ps_codec->i4_mv_frac_mask;
  351|       |
  352|  5.17M|                }
  353|       |
  354|  7.53M|                pu1_dst = pu1_dst_chroma + pu_y * ref_strd / 2 + pu_x;
  355|       |
  356|  7.53M|                ntaps = NTAPS_CHROMA;
  ------------------
  |  |   40|  7.53M|#define NTAPS_CHROMA 4
  ------------------
  357|  7.53M|                coeff = gai1_chroma_filter;
  358|  7.53M|            }
  359|       |
  360|  15.2M|            if(ps_pu->b2_pred_mode != PRED_L1)
  ------------------
  |  Branch (360:16): [True: 14.9M, False: 227k]
  ------------------
  361|  14.9M|            {
  362|  14.9M|                func_indx1 = 4 * (weighted_pred || bi_pred) + 1 + 11 * clr_indx;
  ------------------
  |  Branch (362:35): [True: 2.01M, False: 12.9M]
  |  Branch (362:52): [True: 7.97M, False: 5.01M]
  ------------------
  363|  14.9M|                func_indx1 += ai2_xfrac[0] ? 2 : 0;
  ------------------
  |  Branch (363:31): [True: 2.99M, False: 12.0M]
  ------------------
  364|  14.9M|                func_indx1 += ai2_yfrac[0] ? 1 : 0;
  ------------------
  |  Branch (364:31): [True: 2.27M, False: 12.7M]
  ------------------
  365|       |
  366|  14.9M|                func_indx2 = (ai2_xfrac[0] && ai2_yfrac[0])
  ------------------
  |  Branch (366:31): [True: 3.00M, False: 11.9M]
  |  Branch (366:47): [True: 1.10M, False: 1.89M]
  ------------------
  367|  14.9M|                                * (9 + (weighted_pred || bi_pred)) + 11 * clr_indx;
  ------------------
  |  Branch (367:41): [True: 1.96M, False: 13.0M]
  |  Branch (367:58): [True: 8.00M, False: 5.02M]
  ------------------
  368|       |
  369|  14.9M|                func_ptr1 = ps_codec->apf_inter_pred[func_indx1];
  370|  14.9M|                func_ptr2 = ps_codec->apf_inter_pred[func_indx2];
  371|  14.9M|            }
  372|   227k|            else
  373|   227k|            {
  374|   227k|                func_ptr1 = NULL;
  375|   227k|                func_ptr2 = NULL;
  376|   227k|            }
  377|  15.2M|            if(ps_pu->b2_pred_mode != PRED_L0)
  ------------------
  |  Branch (377:16): [True: 10.2M, False: 4.92M]
  ------------------
  378|  10.2M|            {
  379|  10.2M|                func_indx3 = 4 * (weighted_pred || bi_pred) + 1 + 11 * clr_indx;
  ------------------
  |  Branch (379:35): [True: 1.93M, False: 8.36M]
  |  Branch (379:52): [True: 8.00M, False: 353k]
  ------------------
  380|  10.2M|                func_indx3 += ai2_xfrac[1] ? 2 : 0;
  ------------------
  |  Branch (380:31): [True: 1.55M, False: 8.74M]
  ------------------
  381|  10.2M|                func_indx3 += ai2_yfrac[1] ? 1 : 0;
  ------------------
  |  Branch (381:31): [True: 1.54M, False: 8.75M]
  ------------------
  382|       |
  383|  10.2M|                func_indx4 = (ai2_xfrac[1] && ai2_yfrac[1])
  ------------------
  |  Branch (383:31): [True: 1.55M, False: 8.73M]
  |  Branch (383:47): [True: 825k, False: 732k]
  ------------------
  384|  10.2M|                                * (9 + (weighted_pred || bi_pred)) + 11 * clr_indx;
  ------------------
  |  Branch (384:41): [True: 1.93M, False: 8.36M]
  |  Branch (384:58): [True: 8.01M, False: 353k]
  ------------------
  385|       |
  386|  10.2M|                func_ptr3 = ps_codec->apf_inter_pred[func_indx3];
  387|  10.2M|                func_ptr4 = ps_codec->apf_inter_pred[func_indx4];
  388|  10.2M|            }
  389|  4.92M|            else
  390|  4.92M|            {
  391|  4.92M|                func_ptr3 = NULL;
  392|  4.92M|                func_ptr4 = NULL;
  393|  4.92M|            }
  394|       |
  395|       |            /*Function 1*/
  396|  15.2M|            if(func_ptr1 != NULL)
  ------------------
  |  Branch (396:16): [True: 15.0M, False: 183k]
  ------------------
  397|  15.0M|            {
  398|  15.0M|                func_src_strd = ref_strd;
  399|  15.0M|                func_src = (ai2_xfrac[0] && ai2_yfrac[0]) ?
  ------------------
  |  Branch (399:29): [True: 3.00M, False: 12.0M]
  |  Branch (399:45): [True: 1.10M, False: 1.89M]
  ------------------
  400|  1.10M|                                ref_pic_l0 - (ntaps / 2 - 1) * func_src_strd :
  401|  15.0M|                                ref_pic_l0;
  402|  15.0M|                func_dst = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (402:29): [True: 1.98M, False: 13.0M]
  |  Branch (402:46): [True: 8.02M, False: 5.03M]
  ------------------
  403|  10.0M|                                (void *)pi2_tmp1 : (void *)pu1_dst;
  404|  15.0M|                if(ai2_xfrac[0] && ai2_yfrac[0])
  ------------------
  |  Branch (404:20): [True: 3.00M, False: 12.0M]
  |  Branch (404:36): [True: 1.10M, False: 1.89M]
  ------------------
  405|  1.10M|                {
  406|  1.10M|                    func_dst = pi2_tmp1;
  407|  1.10M|                }
  408|       |
  409|  15.0M|                func_dst_strd = (weighted_pred || bi_pred
  ------------------
  |  Branch (409:34): [True: 1.98M, False: 13.0M]
  |  Branch (409:51): [True: 8.02M, False: 5.03M]
  ------------------
  410|  15.0M|                                || (ai2_xfrac[0] && ai2_yfrac[0])) ?
  ------------------
  |  Branch (410:37): [True: 1.50M, False: 3.52M]
  |  Branch (410:53): [True: 676k, False: 832k]
  ------------------
  411|  10.7M|                                pu_wd : ref_strd;
  412|  15.0M|                func_coeff = ai2_xfrac[0] ?
  ------------------
  |  Branch (412:30): [True: 3.00M, False: 12.0M]
  ------------------
  413|  12.0M|                                coeff[ai2_xfrac[0]] : coeff[ai2_yfrac[0]];
  414|  15.0M|                func_wd = pu_wd >> clr_indx;
  415|  15.0M|                func_ht = pu_ht >> clr_indx;
  416|  15.0M|                func_ht += (ai2_xfrac[0] && ai2_yfrac[0]) ? ntaps - 1 : 0;
  ------------------
  |  Branch (416:29): [True: 3.00M, False: 12.0M]
  |  Branch (416:45): [True: 1.10M, False: 1.89M]
  ------------------
  417|  15.0M|                func_ptr1(func_src, func_dst, func_src_strd, func_dst_strd,
  418|  15.0M|                          func_coeff, func_ht, func_wd);
  419|  15.0M|            }
  420|       |
  421|       |            /*Function 2*/
  422|  15.2M|            if(func_ptr2 != NULL)
  ------------------
  |  Branch (422:16): [True: 1.09M, False: 14.1M]
  ------------------
  423|  1.09M|            {
  424|  1.09M|                func_src_strd = pu_wd;
  425|  1.09M|                func_src = pi2_tmp1 + (ntaps / 2 - 1) * func_src_strd;
  426|  1.09M|                func_dst = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (426:29): [True: 28.8k, False: 1.06M]
  |  Branch (426:46): [True: 400k, False: 665k]
  ------------------
  427|   664k|                                (void *)pi2_tmp1 : (void *)pu1_dst;
  428|       |
  429|  1.09M|                func_dst_strd = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (429:34): [True: 28.4k, False: 1.06M]
  |  Branch (429:51): [True: 401k, False: 665k]
  ------------------
  430|   664k|                                pu_wd : ref_strd;
  431|  1.09M|                func_coeff = coeff[ai2_yfrac[0]];
  432|  1.09M|                func_wd = pu_wd >> clr_indx;
  433|  1.09M|                func_ht = pu_ht >> clr_indx;
  434|  1.09M|                func_ptr2(func_src, func_dst, func_src_strd, func_dst_strd,
  435|  1.09M|                          func_coeff, func_ht, func_wd);
  436|  1.09M|            }
  437|       |
  438|  15.2M|            if(func_ptr3 != NULL)
  ------------------
  |  Branch (438:16): [True: 9.87M, False: 5.35M]
  ------------------
  439|  9.87M|            {
  440|  9.87M|                func_src_strd = ref_strd;
  441|  9.87M|                func_src = (ai2_xfrac[1] && ai2_yfrac[1]) ?
  ------------------
  |  Branch (441:29): [True: 1.53M, False: 8.33M]
  |  Branch (441:45): [True: 813k, False: 722k]
  ------------------
  442|   814k|                                ref_pic_l1 - (ntaps / 2 - 1) * func_src_strd :
  443|  9.87M|                                ref_pic_l1;
  444|       |
  445|  9.87M|                func_dst = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (445:29): [True: 1.84M, False: 8.03M]
  |  Branch (445:46): [True: 7.67M, False: 353k]
  ------------------
  446|  9.53M|                                (void *)pi2_tmp2 : (void *)pu1_dst;
  447|  9.87M|                if(ai2_xfrac[1] && ai2_yfrac[1])
  ------------------
  |  Branch (447:20): [True: 1.53M, False: 8.33M]
  |  Branch (447:36): [True: 814k, False: 723k]
  ------------------
  448|   814k|                {
  449|   814k|                    func_dst = pi2_tmp2;
  450|   814k|                }
  451|  9.87M|                func_dst_strd = (weighted_pred || bi_pred
  ------------------
  |  Branch (451:34): [True: 1.83M, False: 8.03M]
  |  Branch (451:51): [True: 7.68M, False: 353k]
  ------------------
  452|  9.87M|                                || (ai2_xfrac[1] && ai2_yfrac[1])) ?
  ------------------
  |  Branch (452:37): [True: 138k, False: 214k]
  |  Branch (452:53): [True: 93.4k, False: 45.5k]
  ------------------
  453|  9.63M|                                pu_wd : ref_strd;
  454|  9.87M|                func_coeff = ai2_xfrac[1] ?
  ------------------
  |  Branch (454:30): [True: 1.53M, False: 8.33M]
  ------------------
  455|  8.33M|                                coeff[ai2_xfrac[1]] : coeff[ai2_yfrac[1]];
  456|  9.87M|                func_wd = pu_wd >> clr_indx;
  457|  9.87M|                func_ht = pu_ht >> clr_indx;
  458|  9.87M|                func_ht += (ai2_xfrac[1] && ai2_yfrac[1]) ? ntaps - 1 : 0;
  ------------------
  |  Branch (458:29): [True: 1.53M, False: 8.33M]
  |  Branch (458:45): [True: 815k, False: 724k]
  ------------------
  459|  9.87M|                func_ptr3(func_src, func_dst, func_src_strd, func_dst_strd,
  460|  9.87M|                          func_coeff, func_ht, func_wd);
  461|       |
  462|  9.87M|            }
  463|       |
  464|  15.2M|            if(func_ptr4 != NULL)
  ------------------
  |  Branch (464:16): [True: 813k, False: 14.4M]
  ------------------
  465|   813k|            {
  466|   813k|                func_src_strd = pu_wd;
  467|   813k|                func_src = pi2_tmp2 + (ntaps / 2 - 1) * func_src_strd;
  468|       |
  469|   813k|                func_dst = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (469:29): [True: 3.87k, False: 809k]
  |  Branch (469:46): [True: 715k, False: 93.4k]
  ------------------
  470|   720k|                                (void *)pi2_tmp2 : (void *)pu1_dst;
  471|   813k|                func_dst_strd = (weighted_pred || bi_pred) ?
  ------------------
  |  Branch (471:34): [True: 3.57k, False: 809k]
  |  Branch (471:51): [True: 716k, False: 93.4k]
  ------------------
  472|   720k|                                pu_wd : ref_strd;
  473|   813k|                func_coeff = coeff[ai2_yfrac[1]];
  474|   813k|                func_wd = pu_wd >> clr_indx;
  475|   813k|                func_ht = pu_ht >> clr_indx;
  476|   813k|                func_ptr4(func_src, func_dst, func_src_strd, func_dst_strd,
  477|   813k|                          func_coeff, func_ht, func_wd);
  478|       |
  479|   813k|            }
  480|       |
  481|  15.2M|            PROFILE_DISABLE_INTER_PRED_LUMA_AVERAGING(clr_indx);
  ------------------
  |  |  100|  15.2M|#define PROFILE_DISABLE_INTER_PRED_LUMA_AVERAGING(clr_indx) ;
  ------------------
  482|  15.2M|            PROFILE_DISABLE_INTER_PRED_CHROMA_AVERAGING(clr_indx);
  ------------------
  |  |  101|  15.2M|#define PROFILE_DISABLE_INTER_PRED_CHROMA_AVERAGING(clr_indx) ;
  ------------------
  483|       |
  484|       |
  485|  15.2M|            if((weighted_pred != 0) && (bi_pred != 0))
  ------------------
  |  Branch (485:16): [True: 1.90M, False: 13.3M]
  |  Branch (485:40): [True: 1.82M, False: 81.8k]
  ------------------
  486|  1.82M|            {
  487|  1.82M|                lvl_shift1 = 0;
  488|  1.82M|                lvl_shift2 = 0;
  489|  1.82M|                if((0 == clr_indx) && (ai2_xfrac[0] && ai2_yfrac[0]))
  ------------------
  |  Branch (489:20): [True: 944k, False: 882k]
  |  Branch (489:40): [True: 2.66k, False: 941k]
  |  Branch (489:56): [True: 1.81k, False: 853]
  ------------------
  490|  1.81k|                    lvl_shift1 = (1 << 13);
  491|       |
  492|  1.82M|                if((0 == clr_indx) && (ai2_xfrac[1] && ai2_yfrac[1]))
  ------------------
  |  Branch (492:20): [True: 944k, False: 881k]
  |  Branch (492:40): [True: 1.51k, False: 943k]
  |  Branch (492:56): [True: 1.38k, False: 131]
  ------------------
  493|  1.38k|                    lvl_shift2 = (1 << 13);
  494|       |
  495|       |
  496|  1.82M|                if(0 == clr_indx)
  ------------------
  |  Branch (496:20): [True: 944k, False: 881k]
  ------------------
  497|   944k|                {
  498|   944k|                    shift = ps_slice_hdr->s_wt_ofst.i1_luma_log2_weight_denom
  499|   944k|                                    + SHIFT_14_MINUS_BIT_DEPTH + 1;
  ------------------
  |  |   41|   944k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|   944k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  500|       |
  501|   944k|                    ps_codec->s_func_selector.ihevc_weighted_pred_bi_fptr(pi2_tmp1,
  502|   944k|                                                                          pi2_tmp2,
  503|   944k|                                                                          pu1_dst,
  504|   944k|                                                                          pu_wd,
  505|   944k|                                                                          pu_wd,
  506|   944k|                                                                          ref_strd,
  507|   944k|                                                                          luma_weight_l0,
  508|   944k|                                                                          luma_offset_l0,
  509|   944k|                                                                          luma_weight_l1,
  510|   944k|                                                                          luma_offset_l1,
  511|   944k|                                                                          shift,
  512|   944k|                                                                          lvl_shift1,
  513|   944k|                                                                          lvl_shift2,
  514|   944k|                                                                          pu_ht,
  515|   944k|                                                                          pu_wd);
  516|   944k|                }
  517|   881k|                else
  518|   881k|                {
  519|   881k|                    shift = ps_slice_hdr->s_wt_ofst.i1_chroma_log2_weight_denom
  520|   881k|                                    + SHIFT_14_MINUS_BIT_DEPTH + 1;
  ------------------
  |  |   41|   881k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|   881k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  521|       |
  522|   881k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (522:24): [True: 110k, False: 770k]
  ------------------
  523|   110k|                    {
  524|   110k|                        ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr(pi2_tmp1,
  525|   110k|                                                                                     pi2_tmp2,
  526|   110k|                                                                                     pu1_dst,
  527|   110k|                                                                                     pu_wd,
  528|   110k|                                                                                     pu_wd,
  529|   110k|                                                                                     ref_strd,
  530|   110k|                                                                                     chroma_weight_l0_cr,
  531|   110k|                                                                                     chroma_weight_l0_cb,
  532|   110k|                                                                                     chroma_offset_l0_cr,
  533|   110k|                                                                                     chroma_offset_l0_cb,
  534|   110k|                                                                                     chroma_weight_l1_cr,
  535|   110k|                                                                                     chroma_weight_l1_cb,
  536|   110k|                                                                                     chroma_offset_l1_cr,
  537|   110k|                                                                                     chroma_offset_l1_cb,
  538|   110k|                                                                                     shift,
  539|   110k|                                                                                     lvl_shift1,
  540|   110k|                                                                                     lvl_shift2,
  541|   110k|                                                                                     pu_ht >> 1,
  542|   110k|                                                                                     pu_wd >> 1);
  543|   110k|                    }
  544|   770k|                    else
  545|   770k|                    {
  546|   770k|                        ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr(pi2_tmp1,
  547|   770k|                                                                                     pi2_tmp2,
  548|   770k|                                                                                     pu1_dst,
  549|   770k|                                                                                     pu_wd,
  550|   770k|                                                                                     pu_wd,
  551|   770k|                                                                                     ref_strd,
  552|   770k|                                                                                     chroma_weight_l0_cb,
  553|   770k|                                                                                     chroma_weight_l0_cr,
  554|   770k|                                                                                     chroma_offset_l0_cb,
  555|   770k|                                                                                     chroma_offset_l0_cr,
  556|   770k|                                                                                     chroma_weight_l1_cb,
  557|   770k|                                                                                     chroma_weight_l1_cr,
  558|   770k|                                                                                     chroma_offset_l1_cb,
  559|   770k|                                                                                     chroma_offset_l1_cr,
  560|   770k|                                                                                     shift,
  561|   770k|                                                                                     lvl_shift1,
  562|   770k|                                                                                     lvl_shift2,
  563|   770k|                                                                                     pu_ht >> 1,
  564|   770k|                                                                                     pu_wd >> 1);
  565|   770k|                    }
  566|   881k|                }
  567|  1.82M|            }
  568|       |
  569|  13.3M|            else if((weighted_pred != 0) && (bi_pred == 0))
  ------------------
  |  Branch (569:21): [True: 84.5k, False: 13.3M]
  |  Branch (569:45): [True: 84.5k, False: 18.4E]
  ------------------
  570|  84.5k|            {
  571|  84.5k|                lvl_shift1 = 0;
  572|  84.5k|                if(ps_pu->b2_pred_mode == PRED_L0)
  ------------------
  |  Branch (572:20): [True: 76.2k, False: 8.30k]
  ------------------
  573|  76.2k|                {
  574|  76.2k|                    if((0 == clr_indx) && (ai2_xfrac[0] && ai2_yfrac[0]))
  ------------------
  |  Branch (574:24): [True: 38.1k, False: 38.0k]
  |  Branch (574:44): [True: 17.6k, False: 20.5k]
  |  Branch (574:60): [True: 10.5k, False: 7.11k]
  ------------------
  575|  10.5k|                        lvl_shift1 = (1 << 13);
  576|  76.2k|                }
  577|  8.30k|                else
  578|  8.30k|                {
  579|  8.30k|                    if((0 == clr_indx) && (ai2_xfrac[1] && ai2_yfrac[1]))
  ------------------
  |  Branch (579:24): [True: 4.15k, False: 4.15k]
  |  Branch (579:44): [True: 1.73k, False: 2.42k]
  |  Branch (579:60): [True: 650, False: 1.08k]
  ------------------
  580|    650|                        lvl_shift1 = (1 << 13);
  581|  8.30k|                }
  582|       |
  583|  84.5k|                if(0 == clr_indx)
  ------------------
  |  Branch (583:20): [True: 42.3k, False: 42.2k]
  ------------------
  584|  42.3k|                {
  585|  42.3k|                    shift = ps_slice_hdr->s_wt_ofst.i1_luma_log2_weight_denom
  586|  42.3k|                                    + SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  42.3k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|  42.3k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  587|       |
  588|  42.3k|                    ps_codec->s_func_selector.ihevc_weighted_pred_uni_fptr(ps_pu->b2_pred_mode == PRED_L0 ? pi2_tmp1 : pi2_tmp2,
  ------------------
  |  Branch (588:76): [True: 38.1k, False: 4.15k]
  ------------------
  589|  42.3k|                                                                           pu1_dst,
  590|  42.3k|                                                                           pu_wd,
  591|  42.3k|                                                                           ref_strd,
  592|  42.3k|                                                                           ps_pu->b2_pred_mode == PRED_L0 ? luma_weight_l0 : luma_weight_l1,
  ------------------
  |  Branch (592:76): [True: 38.1k, False: 4.15k]
  ------------------
  593|  42.3k|                                                                           ps_pu->b2_pred_mode == PRED_L0 ? luma_offset_l0 : luma_offset_l1,
  ------------------
  |  Branch (593:76): [True: 38.1k, False: 4.15k]
  ------------------
  594|  42.3k|                                                                           shift,
  595|  42.3k|                                                                           lvl_shift1,
  596|  42.3k|                                                                           pu_ht,
  597|  42.3k|                                                                           pu_wd);
  598|  42.3k|                }
  599|  42.2k|                else
  600|  42.2k|                {
  601|  42.2k|                    shift = ps_slice_hdr->s_wt_ofst.i1_chroma_log2_weight_denom
  602|  42.2k|                                    + SHIFT_14_MINUS_BIT_DEPTH;
  ------------------
  |  |   41|  42.2k|#define SHIFT_14_MINUS_BIT_DEPTH (14 - BIT_DEPTH)
  |  |  ------------------
  |  |  |  |  269|  42.2k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  603|       |
  604|  42.2k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (604:24): [True: 13.4k, False: 28.7k]
  ------------------
  605|  13.4k|                    {
  606|  13.4k|                        ps_codec->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr(ps_pu->b2_pred_mode == PRED_L0 ? pi2_tmp1 : pi2_tmp2,
  ------------------
  |  Branch (606:87): [True: 13.3k, False: 71]
  ------------------
  607|  13.4k|                                                                                      pu1_dst,
  608|  13.4k|                                                                                      pu_wd,
  609|  13.4k|                                                                                      ref_strd,
  610|  13.4k|                                                                                      ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cr : chroma_weight_l1_cr,
  ------------------
  |  Branch (610:87): [True: 13.3k, False: 71]
  ------------------
  611|  13.4k|                                                                                      ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cb : chroma_weight_l1_cb,
  ------------------
  |  Branch (611:87): [True: 13.3k, False: 71]
  ------------------
  612|  13.4k|                                                                                      ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cr : chroma_offset_l1_cr,
  ------------------
  |  Branch (612:87): [True: 13.3k, False: 71]
  ------------------
  613|  13.4k|                                                                                      ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cb : chroma_offset_l1_cb,
  ------------------
  |  Branch (613:87): [True: 13.3k, False: 80]
  ------------------
  614|  13.4k|                                                                                      shift,
  615|  13.4k|                                                                                      lvl_shift1,
  616|  13.4k|                                                                                      pu_ht >> 1,
  617|  13.4k|                                                                                      pu_wd >> 1);
  618|  13.4k|                    }
  619|  28.7k|                    else
  620|  28.7k|                    {
  621|  28.7k|                        ps_codec->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr(ps_pu->b2_pred_mode == PRED_L0 ? pi2_tmp1 : pi2_tmp2,
  ------------------
  |  Branch (621:87): [True: 24.7k, False: 3.98k]
  ------------------
  622|  28.7k|                                                                                      pu1_dst,
  623|  28.7k|                                                                                      pu_wd,
  624|  28.7k|                                                                                      ref_strd,
  625|  28.7k|                                                                                      ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cb : chroma_weight_l1_cb,
  ------------------
  |  Branch (625:87): [True: 24.7k, False: 3.98k]
  ------------------
  626|  28.7k|                                                                                      ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cr : chroma_weight_l1_cr,
  ------------------
  |  Branch (626:87): [True: 24.7k, False: 3.98k]
  ------------------
  627|  28.7k|                                                                                      ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cb : chroma_offset_l1_cb,
  ------------------
  |  Branch (627:87): [True: 24.7k, False: 3.98k]
  ------------------
  628|  28.7k|                                                                                      ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cr : chroma_offset_l1_cr,
  ------------------
  |  Branch (628:87): [True: 24.7k, False: 3.97k]
  ------------------
  629|  28.7k|                                                                                      shift,
  630|  28.7k|                                                                                      lvl_shift1,
  631|  28.7k|                                                                                      pu_ht >> 1,
  632|  28.7k|                                                                                      pu_wd >> 1);
  633|  28.7k|                    }
  634|  42.2k|                }
  635|  84.5k|            }
  636|       |
  637|  13.3M|            else if((weighted_pred == 0) && (bi_pred != 0))
  ------------------
  |  Branch (637:21): [True: 12.8M, False: 466k]
  |  Branch (637:45): [True: 7.50M, False: 5.34M]
  ------------------
  638|  7.49M|            {
  639|  7.49M|                lvl_shift1 = 0;
  640|  7.49M|                lvl_shift2 = 0;
  641|  7.49M|                if((0 == clr_indx) && (ai2_xfrac[0] && ai2_yfrac[0]))
  ------------------
  |  Branch (641:20): [True: 3.94M, False: 3.55M]
  |  Branch (641:40): [True: 680k, False: 3.26M]
  |  Branch (641:56): [True: 172k, False: 507k]
  ------------------
  642|   172k|                    lvl_shift1 = (1 << 13);
  643|       |
  644|  7.49M|                if((0 == clr_indx) && (ai2_xfrac[1] && ai2_yfrac[1]))
  ------------------
  |  Branch (644:20): [True: 3.94M, False: 3.55M]
  |  Branch (644:40): [True: 632k, False: 3.31M]
  |  Branch (644:56): [True: 312k, False: 319k]
  ------------------
  645|   312k|                    lvl_shift2 = (1 << 13);
  646|       |
  647|  7.49M|                if(clr_indx != 0)
  ------------------
  |  Branch (647:20): [True: 3.84M, False: 3.65M]
  ------------------
  648|  3.84M|                {
  649|  3.84M|                    pu_ht = (pu_ht >> 1);
  650|  3.84M|                }
  651|  7.49M|                ps_codec->s_func_selector.ihevc_weighted_pred_bi_default_fptr(pi2_tmp1,
  652|  7.49M|                                                                              pi2_tmp2,
  653|  7.49M|                                                                              pu1_dst,
  654|  7.49M|                                                                              pu_wd,
  655|  7.49M|                                                                              pu_wd,
  656|  7.49M|                                                                              ref_strd,
  657|  7.49M|                                                                              lvl_shift1,
  658|  7.49M|                                                                              lvl_shift2,
  659|  7.49M|                                                                              pu_ht,
  660|  7.49M|                                                                              pu_wd);
  661|       |
  662|  7.49M|            }
  663|  15.2M|        }
  664|  7.68M|    }
  665|   499k|}

ihevcd_intra_pred_mode_prediction:
  109|  4.99M|{
  110|  4.99M|    WORD32 i, j, num_pred_blocks;
  111|  4.99M|    WORD32 available_l, available_t;
  112|  4.99M|    WORD32 cand_intra_pred_mode_l, cand_intra_pred_mode_t;
  113|  4.99M|    WORD32 cand_mode_list[3];
  114|  4.99M|    WORD32 cb_size, block_offset_in_min_pu;
  115|  4.99M|    UWORD8 *pu1_luma_intra_pred_mode_top;
  116|  4.99M|    UWORD8 *pu1_luma_intra_pred_mode_left;
  117|       |
  118|  4.99M|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
  119|  4.99M|    parse_cu_t *ps_cu = &ps_codec->s_parse.s_cu;
  120|  4.99M|    sps_t *ps_sps = ps_parse->ps_sps;
  121|       |
  122|       |
  123|  4.99M|    available_t = 1;
  124|  4.99M|    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|  4.99M|    pu1_luma_intra_pred_mode_top = ps_parse->pu1_luma_intra_pred_mode_top
  127|  4.99M|                    + (ps_cu->i4_pos_x * 2);
  128|       |
  129|  4.99M|    pu1_luma_intra_pred_mode_left = ps_parse->pu1_luma_intra_pred_mode_left
  130|  4.99M|                    + (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|  4.99M|    if(ps_cu->i4_pos_y)
  ------------------
  |  Branch (143:8): [True: 3.21M, False: 1.77M]
  ------------------
  144|  3.21M|    {
  145|  3.21M|        UWORD8 *pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag;
  146|  3.21M|        WORD32 top_intra_flag;
  147|       |
  148|  3.21M|        WORD32 numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
  149|  3.21M|        pu1_pic_intra_flag += ((y0 - 8) / 8) * numbytes_row;
  150|  3.21M|        pu1_pic_intra_flag += (x0 / 64);
  151|  3.21M|        top_intra_flag = *pu1_pic_intra_flag;
  152|  3.21M|        top_intra_flag &= (1 << ((x0 / 8) % 8));
  153|       |
  154|  3.21M|        if(0 == top_intra_flag)
  ------------------
  |  Branch (154:12): [True: 7.55k, False: 3.21M]
  ------------------
  155|  7.55k|        {
  156|  7.55k|            available_t = 0;
  157|  7.55k|        }
  158|  3.21M|    }
  159|  1.77M|    else
  160|  1.77M|        available_t = 0;
  161|       |
  162|       |
  163|  4.99M|    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.77M, False: 3.21M]
  |  Branch (163:36): [True: 42.1k, False: 1.73M]
  |  Branch (163:79): [True: 11.3k, False: 30.7k]
  ------------------
  164|  1.77M|                                  (0 == ps_codec->s_parse.i4_ctb_tile_x)))
  ------------------
  |  Branch (164:35): [True: 33.2k, False: 1.73M]
  ------------------
  165|  44.6k|    {
  166|  44.6k|        available_l = 0;
  167|  44.6k|    }
  168|       |
  169|  4.99M|    if(available_l)
  ------------------
  |  Branch (169:8): [True: 4.95M, False: 44.6k]
  ------------------
  170|  4.95M|    {
  171|  4.95M|        UWORD8 *pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag;
  172|  4.95M|        WORD32 left_intra_flag;
  173|  4.95M|        WORD32 numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
  174|  4.95M|        pu1_pic_intra_flag += (y0 / 8) * numbytes_row;
  175|  4.95M|        pu1_pic_intra_flag += ((x0 - 8) / 64);
  176|  4.95M|        left_intra_flag = *pu1_pic_intra_flag;
  177|  4.95M|        left_intra_flag &= (1 << (((x0 - 8) / 8) % 8));
  178|       |
  179|  4.95M|        if(0 == left_intra_flag)
  ------------------
  |  Branch (179:12): [True: 9.86k, False: 4.94M]
  ------------------
  180|  9.86k|        {
  181|  9.86k|            available_l = 0;
  182|  9.86k|        }
  183|  4.95M|    }
  184|       |
  185|  4.99M|    cb_size = (1 << log2_cb_size);
  186|       |
  187|  4.99M|    block_offset_in_min_pu = (cb_size / 2) / MIN_PU_SIZE;
  ------------------
  |  |  357|  4.99M|#define MIN_PU_SIZE         4
  ------------------
  188|       |
  189|  4.99M|    num_pred_blocks = (ps_cu->i4_part_mode == PART_NxN) ? 2 : 1;
  ------------------
  |  Branch (189:23): [True: 516k, False: 4.47M]
  ------------------
  190|       |
  191|  10.5M|    for(i = 0; i < num_pred_blocks; i++)
  ------------------
  |  Branch (191:16): [True: 5.51M, False: 4.99M]
  ------------------
  192|  5.51M|    {
  193|  5.51M|        WORD32 available_l_tmp;
  194|  5.51M|        available_l_tmp = available_l;
  195|  12.0M|        for(j = 0; j < num_pred_blocks; j++)
  ------------------
  |  Branch (195:20): [True: 6.54M, False: 5.51M]
  ------------------
  196|  6.54M|        {
  197|       |            /* Computing Candidate intra pred mode left */
  198|  6.54M|            {
  199|  6.54M|                WORD32 block_offset;
  200|       |
  201|  6.54M|                block_offset = i * block_offset_in_min_pu;
  202|  6.54M|                cand_intra_pred_mode_l = INTRA_DC;
  ------------------
  |  |  504|  6.54M|#define INTRA_DC                 1
  ------------------
  203|  6.54M|                if(available_l_tmp)
  ------------------
  |  Branch (203:20): [True: 6.47M, False: 62.9k]
  ------------------
  204|  6.47M|                {
  205|  6.47M|                    cand_intra_pred_mode_l =
  206|  6.47M|                                    pu1_luma_intra_pred_mode_left[block_offset];
  207|  6.47M|                }
  208|       |
  209|  6.54M|            }
  210|       |
  211|  6.54M|            {
  212|  6.54M|                WORD32 block_offset;
  213|  6.54M|                block_offset = j * block_offset_in_min_pu;
  214|  6.54M|                cand_intra_pred_mode_t = INTRA_DC;
  ------------------
  |  |  504|  6.54M|#define INTRA_DC                 1
  ------------------
  215|  6.54M|                if(available_t)
  ------------------
  |  Branch (215:20): [True: 4.65M, False: 1.88M]
  ------------------
  216|  4.65M|                {
  217|  4.65M|                    cand_intra_pred_mode_t =
  218|  4.65M|                                    pu1_luma_intra_pred_mode_top[block_offset];
  219|  4.65M|                }
  220|  6.54M|            }
  221|       |
  222|       |            /* Computing Candidate mode list */
  223|  6.54M|            if(cand_intra_pred_mode_l == cand_intra_pred_mode_t)
  ------------------
  |  Branch (223:16): [True: 1.89M, False: 4.64M]
  ------------------
  224|  1.89M|            {
  225|  1.89M|                if(cand_intra_pred_mode_l < 2)
  ------------------
  |  Branch (225:20): [True: 1.45M, False: 445k]
  ------------------
  226|  1.45M|                {
  227|  1.45M|                    cand_mode_list[0] = INTRA_PLANAR;
  ------------------
  |  |  501|  1.45M|#define INTRA_PLANAR             0
  ------------------
  228|  1.45M|                    cand_mode_list[1] = INTRA_DC;
  ------------------
  |  |  504|  1.45M|#define INTRA_DC                 1
  ------------------
  229|  1.45M|                    cand_mode_list[2] = INTRA_ANGULAR(26); /* angular 26 = Vertical */
  ------------------
  |  |  507|  1.45M|#define INTRA_ANGULAR(x) (x)
  ------------------
  230|  1.45M|                }
  231|   445k|                else
  232|   445k|                {
  233|   445k|                    cand_mode_list[0] = cand_intra_pred_mode_l;
  234|   445k|                    cand_mode_list[1] = 2
  235|   445k|                                    + ((cand_intra_pred_mode_l + 29) % 32);
  236|   445k|                    cand_mode_list[2] = 2
  237|   445k|                                    + ((cand_intra_pred_mode_l - 2 + 1) % 32);
  238|   445k|                }
  239|  1.89M|            }
  240|  4.64M|            else
  241|  4.64M|            {
  242|  4.64M|                cand_mode_list[0] = cand_intra_pred_mode_l;
  243|  4.64M|                cand_mode_list[1] = cand_intra_pred_mode_t;
  244|       |
  245|  4.64M|                if((cand_intra_pred_mode_l != INTRA_PLANAR)
  ------------------
  |  |  501|  4.64M|#define INTRA_PLANAR             0
  ------------------
  |  Branch (245:20): [True: 3.29M, False: 1.35M]
  ------------------
  246|  4.64M|                                && (cand_intra_pred_mode_t != INTRA_PLANAR))
  ------------------
  |  |  501|  3.29M|#define INTRA_PLANAR             0
  ------------------
  |  Branch (246:36): [True: 2.68M, False: 606k]
  ------------------
  247|  2.68M|                {
  248|  2.68M|                    cand_mode_list[2] = INTRA_PLANAR;
  ------------------
  |  |  501|  2.68M|#define INTRA_PLANAR             0
  ------------------
  249|  2.68M|                }
  250|  1.95M|                else if((cand_intra_pred_mode_l != INTRA_DC)
  ------------------
  |  |  504|  1.95M|#define INTRA_DC                 1
  ------------------
  |  Branch (250:25): [True: 1.75M, False: 198k]
  ------------------
  251|  1.95M|                                && (cand_intra_pred_mode_t != INTRA_DC))
  ------------------
  |  |  504|  1.75M|#define INTRA_DC                 1
  ------------------
  |  Branch (251:36): [True: 822k, False: 937k]
  ------------------
  252|   822k|                {
  253|   822k|                    cand_mode_list[2] = INTRA_DC;
  ------------------
  |  |  504|   822k|#define INTRA_DC                 1
  ------------------
  254|   822k|                }
  255|  1.13M|                else
  256|  1.13M|                {
  257|  1.13M|                    cand_mode_list[2] = INTRA_ANGULAR(26);
  ------------------
  |  |  507|  1.13M|#define INTRA_ANGULAR(x) (x)
  ------------------
  258|  1.13M|                }
  259|  4.64M|            }
  260|       |
  261|       |            /* Computing Intra pred mode */
  262|  6.54M|            if(ps_cu->ai4_prev_intra_luma_pred_flag[2 * i + j] == 1)
  ------------------
  |  Branch (262:16): [True: 4.67M, False: 1.86M]
  ------------------
  263|  4.67M|            {
  264|  4.67M|                ps_cu->ai4_intra_luma_pred_mode[2 * i + j] =
  265|  4.67M|                                cand_mode_list[ps_cu->ai4_mpm_idx[2 * i + j]];
  266|  4.67M|            }
  267|  1.86M|            else
  268|  1.86M|            {
  269|  1.86M|                WORD32 intra_pred_mode;
  270|       |                /* Arranging cand_mode_list in increasing order */
  271|  1.86M|                if(cand_mode_list[0] > cand_mode_list[1])
  ------------------
  |  Branch (271:20): [True: 1.00M, False: 860k]
  ------------------
  272|  1.00M|                {
  273|  1.00M|                    SWAP(cand_mode_list[0], cand_mode_list[1]);
  ------------------
  |  |   87|  1.00M|#define SWAP(X,Y)                   \
  |  |   88|  1.00M|{                                   \
  |  |   89|  1.00M|    (X) = (X) ^ (Y);                \
  |  |   90|  1.00M|    (Y) = (X) ^ (Y);                \
  |  |   91|  1.00M|    (X) = (X) ^ (Y);                \
  |  |   92|  1.00M|}
  ------------------
  274|  1.00M|                }
  275|  1.86M|                if(cand_mode_list[0] > cand_mode_list[2])
  ------------------
  |  Branch (275:20): [True: 1.27M, False: 591k]
  ------------------
  276|  1.27M|                {
  277|  1.27M|                    SWAP(cand_mode_list[0], cand_mode_list[2]);
  ------------------
  |  |   87|  1.27M|#define SWAP(X,Y)                   \
  |  |   88|  1.27M|{                                   \
  |  |   89|  1.27M|    (X) = (X) ^ (Y);                \
  |  |   90|  1.27M|    (Y) = (X) ^ (Y);                \
  |  |   91|  1.27M|    (X) = (X) ^ (Y);                \
  |  |   92|  1.27M|}
  ------------------
  278|  1.27M|                }
  279|  1.86M|                if(cand_mode_list[1] > cand_mode_list[2])
  ------------------
  |  Branch (279:20): [True: 1.54M, False: 320k]
  ------------------
  280|  1.54M|                {
  281|  1.54M|                    SWAP(cand_mode_list[1], cand_mode_list[2]);
  ------------------
  |  |   87|  1.54M|#define SWAP(X,Y)                   \
  |  |   88|  1.54M|{                                   \
  |  |   89|  1.54M|    (X) = (X) ^ (Y);                \
  |  |   90|  1.54M|    (Y) = (X) ^ (Y);                \
  |  |   91|  1.54M|    (X) = (X) ^ (Y);                \
  |  |   92|  1.54M|}
  ------------------
  282|  1.54M|                }
  283|       |
  284|  1.86M|                intra_pred_mode = ps_cu->ai4_rem_intra_luma_pred_mode[2 * i + j];
  285|       |
  286|  1.86M|                if(intra_pred_mode >= cand_mode_list[0])
  ------------------
  |  Branch (286:20): [True: 1.73M, False: 137k]
  ------------------
  287|  1.73M|                    intra_pred_mode++;
  288|       |
  289|  1.86M|                if(intra_pred_mode >= cand_mode_list[1])
  ------------------
  |  Branch (289:20): [True: 1.42M, False: 439k]
  ------------------
  290|  1.42M|                    intra_pred_mode++;
  291|       |
  292|  1.86M|                if(intra_pred_mode >= cand_mode_list[2])
  ------------------
  |  Branch (292:20): [True: 622k, False: 1.24M]
  ------------------
  293|   622k|                    intra_pred_mode++;
  294|       |
  295|  1.86M|                ps_cu->ai4_intra_luma_pred_mode[2 * i + j] = intra_pred_mode;
  296|  1.86M|            }
  297|       |            /* Update Top and Left intra pred mode */
  298|  6.54M|            {
  299|  6.54M|                WORD32 intra_pred_mode;
  300|       |
  301|  6.54M|                intra_pred_mode = ps_cu->ai4_intra_luma_pred_mode[2 * i + j];
  302|       |
  303|  6.54M|                ps_codec->s_func_selector.ihevc_memset_fptr(pu1_luma_intra_pred_mode_left + i * block_offset_in_min_pu, intra_pred_mode, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  357|  6.54M|#define MIN_PU_SIZE         4
  ------------------
  304|  6.54M|                ps_codec->s_func_selector.ihevc_memset_fptr(pu1_luma_intra_pred_mode_top + j * block_offset_in_min_pu, intra_pred_mode, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  357|  6.54M|#define MIN_PU_SIZE         4
  ------------------
  305|       |
  306|  6.54M|            }
  307|       |            /* If partition is PART_NxN, then left is available for second column always */
  308|  6.54M|            available_l_tmp = 1;
  309|       |
  310|  6.54M|        }
  311|       |        /* If partition is PART_NxN, then top is available for bottom row always */
  312|  5.51M|        available_t = 1;
  313|  5.51M|    }
  314|       |
  315|       |    /* In case it is PART_2Nx2N partition, replicate intra pred mode in other three entries */
  316|  4.99M|    if(ps_cu->i4_part_mode == PART_2Nx2N)
  ------------------
  |  Branch (316:8): [True: 4.47M, False: 516k]
  ------------------
  317|  4.47M|    {
  318|  4.47M|        ps_cu->ai4_intra_luma_pred_mode[1] = ps_cu->ai4_intra_luma_pred_mode[0];
  319|  4.47M|        ps_cu->ai4_intra_luma_pred_mode[2] = ps_cu->ai4_intra_luma_pred_mode[0];
  320|  4.47M|        ps_cu->ai4_intra_luma_pred_mode[3] = ps_cu->ai4_intra_luma_pred_mode[0];
  321|  4.47M|    }
  322|  4.99M|}

ihevcd_unpack_coeffs:
  151|  7.81M|{
  152|       |    /* Generating coeffs from coeff-map */
  153|  7.81M|    WORD32 i;
  154|  7.81M|    WORD16 *pi2_sblk_ptr;
  155|  7.81M|    WORD32 subblk_pos_x, subblk_pos_y;
  156|  7.81M|    WORD32 sblk_scan_idx, coeff_raster_idx;
  157|  7.81M|    WORD32 sblk_non_zero_coeff_idx;
  158|  7.81M|    tu_sblk_coeff_data_t *ps_tu_sblk_coeff_data;
  159|  7.81M|    UWORD8 u1_num_coded_sblks, u1_scan_type;
  160|  7.81M|    UWORD8 *pu1_new_tu_coeff_data;
  161|  7.81M|    WORD32 trans_size;
  162|  7.81M|    WORD32 xs, ys;
  163|  7.81M|    WORD32 trans_skip;
  164|  7.81M|    WORD16 iquant_out;
  165|  7.81M|    WORD32 shift_iq;
  166|  7.81M|    {
  167|  7.81M|        WORD32 bit_depth;
  168|       |
  169|  7.81M|        bit_depth = 8 + 0;
  170|  7.81M|        shift_iq = bit_depth + log2_trans_size - 5;
  171|  7.81M|    }
  172|  7.81M|    trans_size = (1 << log2_trans_size);
  173|       |
  174|       |    /* First byte points to number of coded blocks */
  175|  7.81M|    u1_num_coded_sblks = *pu1_tu_coeff_data++;
  176|       |
  177|       |    /* Next byte points to scan type */
  178|  7.81M|    u1_scan_type = *pu1_tu_coeff_data++;
  179|       |    /* 0th bit has trans_skip */
  180|  7.81M|    trans_skip = u1_scan_type & 1;
  181|  7.81M|    u1_scan_type >>= 1;
  182|       |
  183|  7.81M|    pi2_sblk_ptr = pi2_tu_coeff;
  184|       |
  185|       |    /* Initially all columns are assumed to be zero */
  186|  7.81M|    *pu4_zero_cols = 0xFFFFFFFF;
  187|       |    /* Initially all rows are assumed to be zero */
  188|  7.81M|    *pu4_zero_rows = 0xFFFFFFFF;
  189|       |
  190|  7.81M|    ps_tu_sblk_coeff_data = (tu_sblk_coeff_data_t *)(pu1_tu_coeff_data);
  191|       |
  192|  7.81M|    if(trans_skip)
  ------------------
  |  Branch (192:8): [True: 397k, False: 7.41M]
  ------------------
  193|   397k|        memset(pi2_tu_coeff, 0, trans_size * trans_size * sizeof(WORD16));
  194|       |
  195|  7.81M|    STATS_INIT_SBLK_AND_COEFF_POS();
  ------------------
  |  |  141|  7.81M|#define STATS_INIT_SBLK_AND_COEFF_POS() ;
  ------------------
  196|       |
  197|       |    /* DC only case */
  198|  7.81M|    if((e_trans_type != DST_4x4) && (1 == u1_num_coded_sblks)
  ------------------
  |  Branch (198:8): [True: 7.33M, False: 482k]
  |  Branch (198:37): [True: 4.69M, False: 2.63M]
  ------------------
  199|  7.81M|                    && (0 == ps_tu_sblk_coeff_data->u2_subblk_pos)
  ------------------
  |  Branch (199:24): [True: 4.35M, False: 346k]
  ------------------
  200|  7.81M|                    && (1 == ps_tu_sblk_coeff_data->u2_sig_coeff_map))
  ------------------
  |  Branch (200:24): [True: 2.48M, False: 1.86M]
  ------------------
  201|  2.48M|    {
  202|  2.48M|        *pu4_coeff_type = 1;
  203|       |
  204|  2.48M|        if(!trans_quant_bypass)
  ------------------
  |  Branch (204:12): [True: 2.47M, False: 10.7k]
  ------------------
  205|  2.47M|        {
  206|  2.47M|            if(4 == trans_size)
  ------------------
  |  Branch (206:16): [True: 323k, False: 2.15M]
  ------------------
  207|   323k|            {
  208|   323k|                IQUANT_4x4(iquant_out,
  ------------------
  |  |  158|   323k|#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|   323k|{                                                                                                                                              \
  |  |  160|   323k|    WORD32 clip_coeff, tmp;                                                                                                                    \
  |  |  161|   323k|    WORD32 coeff_min,coeff_max;                                                                                                                \
  |  |  162|   323k|    WORD32 coeff_bit_range;                                                                                                                    \
  |  |  163|   323k|    WORD32 add_iq;                                                                                                                             \
  |  |  164|   323k|    add_iq = SHL_NEG(1 , (shift_iq - qp_div - 1));  /* To be moved outside in neon. To be computed once per transform call */                  \
  |  |  ------------------
  |  |  |  |   60|   323k|#define SHL_NEG(val,shift)  ((shift<0)?(val>>(-shift)):(val<<shift))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:30): [True: 210k, False: 112k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|   323k|                                                                                                                                               \
  |  |  166|   323k|    coeff_bit_range = 16;                                                                                                                      \
  |  |  167|   323k|    if(qp_div > shift_iq)                                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (167:8): [True: 201k, False: 122k]
  |  |  ------------------
  |  |  168|   323k|        coeff_bit_range = 10;                                                                                                                  \
  |  |  169|   323k|                                                                                                                                               \
  |  |  170|   323k|    coeff_min = -(1<<(coeff_bit_range-1));                                                                                                     \
  |  |  171|   323k|    coeff_max = (1<<(coeff_bit_range-1)) - 1;                                                                                                  \
  |  |  172|   323k|                                                                                                                                               \
  |  |  173|   323k|    clip_coeff = CLIP3(coeff,coeff_min,coeff_max);                                                                                             \
  |  |  ------------------
  |  |  |  |   40|   323k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 323k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 323k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|   323k|                                                                                                                                               \
  |  |  175|   323k|    tmp = clip_coeff * dequant_coeff ;                                                                                                         \
  |  |  176|   323k|    tmp = tmp + add_iq;                                                                                                                        \
  |  |  177|   323k|    tmp = SHR_NEG(tmp,(shift_iq - qp_div));                                                                                                    \
  |  |  ------------------
  |  |  |  |   59|   323k|#define SHR_NEG(val,shift)  ((shift>0)?(val>>shift):(val<<(-shift)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (59:30): [True: 112k, False: 210k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  178|   323k|                                                                                                                                               \
  |  |  179|   323k|    res = CLIP_S16(tmp);                                                                                                                       \
  |  |  ------------------
  |  |  |  |   53|   323k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|   323k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (40:29): [True: 367, False: 322k]
  |  |  |  |  |  |  |  Branch (40:53): [True: 398, False: 322k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  180|   323k|}
  ------------------
  209|   323k|                           ps_tu_sblk_coeff_data->ai2_level[0],
  210|   323k|                           pi2_dequant_matrix[0]
  211|   323k|                                           * g_ihevc_iquant_scales[qp_rem],
  212|   323k|                           shift_iq, qp_div);
  213|   323k|            }
  214|  2.15M|            else
  215|  2.15M|            {
  216|  2.15M|                IQUANT(iquant_out, ps_tu_sblk_coeff_data->ai2_level[0],
  ------------------
  |  |  140|  2.15M|#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|  2.15M|{                                                                                                                                              \
  |  |  142|  2.15M|    WORD32 tmp, add_iq;                                                                                                                        \
  |  |  143|  2.15M|                                                                                                                                               \
  |  |  144|  2.15M|    add_iq = SHL_NEG(1 , (shift_iq - qp_div - 1));  /* To be moved outside in neon. To be computed once per transform call */                  \
  |  |  ------------------
  |  |  |  |   60|  2.15M|#define SHL_NEG(val,shift)  ((shift<0)?(val>>(-shift)):(val<<shift))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:30): [True: 1.94M, False: 208k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  2.15M|                                                                                                                                               \
  |  |  146|  2.15M|    tmp = coeff * dequant_coeff ;                                                                                                              \
  |  |  147|  2.15M|    tmp = tmp + add_iq;                                                                                                                        \
  |  |  148|  2.15M|    tmp = SHR_NEG(tmp,(shift_iq - qp_div));                                                                                                    \
  |  |  ------------------
  |  |  |  |   59|  2.15M|#define SHR_NEG(val,shift)  ((shift>0)?(val>>shift):(val<<(-shift)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (59:30): [True: 208k, False: 1.94M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  149|  2.15M|                                                                                                                                               \
  |  |  150|  2.15M|    res = CLIP_S16(tmp);                                                                                                                       \
  |  |  ------------------
  |  |  |  |   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: 661, False: 2.15M]
  |  |  |  |  |  |  |  Branch (40:53): [True: 717, False: 2.15M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  151|  2.15M|}
  ------------------
  217|  2.15M|                       pi2_dequant_matrix[0] * g_ihevc_iquant_scales[qp_rem],
  218|  2.15M|                       shift_iq, qp_div);
  219|  2.15M|            }
  220|  2.47M|            if(trans_skip)
  ------------------
  |  Branch (220:16): [True: 102k, False: 2.37M]
  ------------------
  221|   102k|                iquant_out = (iquant_out + 16) >> 5;
  222|  2.47M|        }
  223|  10.7k|        else
  224|  10.7k|        {
  225|       |            /* setting the column to zero */
  226|   203k|            for(i = 0; i < trans_size; i++)
  ------------------
  |  Branch (226:24): [True: 192k, False: 10.7k]
  ------------------
  227|   192k|                *(pi2_tu_coeff + i * trans_size) = 0;
  228|       |
  229|  10.7k|            iquant_out = ps_tu_sblk_coeff_data->ai2_level[0];
  230|  10.7k|        }
  231|  2.48M|        *pi2_coeff_value = iquant_out;
  232|  2.48M|        *pi2_tu_coeff = iquant_out;
  233|  2.48M|        *pu4_zero_cols &= ~0x1;
  234|  2.48M|        *pu4_zero_rows &= ~0x1;
  235|  2.48M|        ps_tu_sblk_coeff_data =
  236|  2.48M|                        (void *)&ps_tu_sblk_coeff_data->ai2_level[1];
  237|       |
  238|  2.48M|        STATS_UPDATE_COEFF_COUNT();
  ------------------
  |  |  144|  2.48M|#define STATS_UPDATE_COEFF_COUNT() ;
  ------------------
  239|  2.48M|        STATS_LAST_SBLK_POS_UPDATE(e_trans_type, (trans_skip || trans_quant_bypass),  0, 0);
  ------------------
  |  |  142|  2.48M|#define STATS_LAST_SBLK_POS_UPDATE(e_trans_type, t_skip_or_tq_bypass, sblk_x, sblk_y) ;
  ------------------
  240|  2.48M|        STATS_UPDATE_SBLK_AND_COEFF_HISTOGRAM(e_trans_type, (trans_quant_bypass || trans_skip));
  ------------------
  |  |  143|  2.48M|#define STATS_UPDATE_SBLK_AND_COEFF_HISTOGRAM(e_trans_type, t_skip_or_tq_bypass) ;
  ------------------
  241|  2.48M|        return ((UWORD8 *)ps_tu_sblk_coeff_data);
  242|  2.48M|    }
  243|  5.32M|    else
  244|  5.32M|    {
  245|  5.32M|        *pu4_coeff_type = 0;
  246|       |        /* In case of trans skip, memset has already happened */
  247|  5.32M|        if(!trans_skip)
  ------------------
  |  Branch (247:12): [True: 5.04M, False: 288k]
  ------------------
  248|  5.04M|            memset(pi2_tu_coeff, 0, trans_size * trans_size * sizeof(WORD16));
  249|  5.32M|    }
  250|       |
  251|  16.2M|    for(i = 0; i < u1_num_coded_sblks; i++)
  ------------------
  |  Branch (251:16): [True: 10.8M, False: 5.32M]
  ------------------
  252|  10.8M|    {
  253|  10.8M|        UWORD32 u4_sig_coeff_map;
  254|  10.8M|        subblk_pos_x = ps_tu_sblk_coeff_data->u2_subblk_pos & 0x00FF;
  255|  10.8M|        subblk_pos_y = (ps_tu_sblk_coeff_data->u2_subblk_pos & 0xFF00) >> 8;
  256|       |
  257|  10.8M|        STATS_LAST_SBLK_POS_UPDATE(e_trans_type, (trans_skip || trans_quant_bypass), subblk_pos_x, subblk_pos_y);
  ------------------
  |  |  142|  10.8M|#define STATS_LAST_SBLK_POS_UPDATE(e_trans_type, t_skip_or_tq_bypass, sblk_x, sblk_y) ;
  ------------------
  258|       |
  259|  10.8M|        subblk_pos_x = subblk_pos_x * MIN_TU_SIZE;
  ------------------
  |  |  348|  10.8M|#define MIN_TU_SIZE         4
  ------------------
  260|  10.8M|        subblk_pos_y = subblk_pos_y * MIN_TU_SIZE;
  ------------------
  |  |  348|  10.8M|#define MIN_TU_SIZE         4
  ------------------
  261|       |
  262|  10.8M|        pi2_sblk_ptr = pi2_tu_coeff + subblk_pos_y * trans_size
  263|  10.8M|                        + subblk_pos_x;
  264|       |
  265|       |        //*pu4_zero_cols &= ~(0xF << subblk_pos_x);
  266|       |
  267|  10.8M|        sblk_non_zero_coeff_idx = 0;
  268|  10.8M|        u4_sig_coeff_map = ps_tu_sblk_coeff_data->u2_sig_coeff_map;
  269|       |        //for(sblk_scan_idx = (31 - CLZ(u4_sig_coeff_map)); sblk_scan_idx >= 0; sblk_scan_idx--)
  270|  10.8M|        sblk_scan_idx = 31;
  271|  10.8M|        do
  272|  34.1M|        {
  273|  34.1M|            WORD32 clz = CLZ(u4_sig_coeff_map);
  274|       |
  275|  34.1M|            sblk_scan_idx -= clz;
  276|       |            /* when clz is 31, u4_sig_coeff_map << (clz+1) might result in unknown behaviour in some cases */
  277|       |            /* Hence either use SHL which takes care of handling these issues based on platform or shift in two stages */
  278|  34.1M|            u4_sig_coeff_map = u4_sig_coeff_map << clz;
  279|       |            /* Copying coeffs and storing in reverse order */
  280|  34.1M|            {
  281|  34.1M|                STATS_UPDATE_COEFF_COUNT();
  ------------------
  |  |  144|  34.1M|#define STATS_UPDATE_COEFF_COUNT() ;
  ------------------
  282|  34.1M|                coeff_raster_idx =
  283|  34.1M|                                gau1_ihevc_invscan4x4[u1_scan_type][sblk_scan_idx];
  284|       |
  285|  34.1M|                xs = coeff_raster_idx & 0x3;
  286|  34.1M|                ys = coeff_raster_idx >> 2;
  287|       |
  288|  34.1M|                if(!trans_quant_bypass)
  ------------------
  |  Branch (288:20): [True: 33.9M, False: 238k]
  ------------------
  289|  33.9M|                {
  290|  33.9M|                    if(4 == trans_size)
  ------------------
  |  Branch (290:24): [True: 3.45M, False: 30.4M]
  ------------------
  291|  3.45M|                    {
  292|  3.45M|                        IQUANT_4x4(iquant_out,
  ------------------
  |  |  158|  3.45M|#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|  3.45M|{                                                                                                                                              \
  |  |  160|  3.45M|    WORD32 clip_coeff, tmp;                                                                                                                    \
  |  |  161|  3.45M|    WORD32 coeff_min,coeff_max;                                                                                                                \
  |  |  162|  3.45M|    WORD32 coeff_bit_range;                                                                                                                    \
  |  |  163|  3.45M|    WORD32 add_iq;                                                                                                                             \
  |  |  164|  3.45M|    add_iq = SHL_NEG(1 , (shift_iq - qp_div - 1));  /* To be moved outside in neon. To be computed once per transform call */                  \
  |  |  ------------------
  |  |  |  |   60|  3.45M|#define SHL_NEG(val,shift)  ((shift<0)?(val>>(-shift)):(val<<shift))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:30): [True: 943k, False: 2.51M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  3.45M|                                                                                                                                               \
  |  |  166|  3.45M|    coeff_bit_range = 16;                                                                                                                      \
  |  |  167|  3.45M|    if(qp_div > shift_iq)                                                                                                                      \
  |  |  ------------------
  |  |  |  Branch (167:8): [True: 548k, False: 2.90M]
  |  |  ------------------
  |  |  168|  3.45M|        coeff_bit_range = 10;                                                                                                                  \
  |  |  169|  3.45M|                                                                                                                                               \
  |  |  170|  3.45M|    coeff_min = -(1<<(coeff_bit_range-1));                                                                                                     \
  |  |  171|  3.45M|    coeff_max = (1<<(coeff_bit_range-1)) - 1;                                                                                                  \
  |  |  172|  3.45M|                                                                                                                                               \
  |  |  173|  3.45M|    clip_coeff = CLIP3(coeff,coeff_min,coeff_max);                                                                                             \
  |  |  ------------------
  |  |  |  |   40|  3.45M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 37, False: 3.45M]
  |  |  |  |  |  Branch (40:53): [True: 13, False: 3.45M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|  3.45M|                                                                                                                                               \
  |  |  175|  3.45M|    tmp = clip_coeff * dequant_coeff ;                                                                                                         \
  |  |  176|  3.45M|    tmp = tmp + add_iq;                                                                                                                        \
  |  |  177|  3.45M|    tmp = SHR_NEG(tmp,(shift_iq - qp_div));                                                                                                    \
  |  |  ------------------
  |  |  |  |   59|  3.45M|#define SHR_NEG(val,shift)  ((shift>0)?(val>>shift):(val<<(-shift)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (59:30): [True: 2.51M, False: 942k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  178|  3.45M|                                                                                                                                               \
  |  |  179|  3.45M|    res = CLIP_S16(tmp);                                                                                                                       \
  |  |  ------------------
  |  |  |  |   53|  3.45M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  3.45M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (40:29): [True: 40.9k, False: 3.41M]
  |  |  |  |  |  |  |  Branch (40:53): [True: 33.5k, False: 3.38M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  180|  3.45M|}
  ------------------
  293|  3.45M|                                   ps_tu_sblk_coeff_data->ai2_level[sblk_non_zero_coeff_idx],
  294|  3.45M|                                   pi2_dequant_matrix[(subblk_pos_x + xs)
  295|  3.45M|                                                   + (subblk_pos_y + ys)
  296|  3.45M|                                                   * trans_size]
  297|  3.45M|                                   * g_ihevc_iquant_scales[qp_rem],
  298|  3.45M|                                   shift_iq, qp_div);
  299|  3.45M|                        sblk_non_zero_coeff_idx++;
  300|  3.45M|                    }
  301|  30.4M|                    else
  302|  30.4M|                    {
  303|  30.4M|                        IQUANT(iquant_out,
  ------------------
  |  |  140|  30.4M|#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|  30.4M|{                                                                                                                                              \
  |  |  142|  30.4M|    WORD32 tmp, add_iq;                                                                                                                        \
  |  |  143|  30.4M|                                                                                                                                               \
  |  |  144|  30.4M|    add_iq = SHL_NEG(1 , (shift_iq - qp_div - 1));  /* To be moved outside in neon. To be computed once per transform call */                  \
  |  |  ------------------
  |  |  |  |   60|  30.4M|#define SHL_NEG(val,shift)  ((shift<0)?(val>>(-shift)):(val<<shift))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:30): [True: 22.7M, False: 7.67M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  30.4M|                                                                                                                                               \
  |  |  146|  30.4M|    tmp = coeff * dequant_coeff ;                                                                                                              \
  |  |  147|  30.4M|    tmp = tmp + add_iq;                                                                                                                        \
  |  |  148|  30.4M|    tmp = SHR_NEG(tmp,(shift_iq - qp_div));                                                                                                    \
  |  |  ------------------
  |  |  |  |   59|  30.4M|#define SHR_NEG(val,shift)  ((shift>0)?(val>>shift):(val<<(-shift)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (59:30): [True: 7.68M, False: 22.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  149|  30.4M|                                                                                                                                               \
  |  |  150|  30.4M|    res = CLIP_S16(tmp);                                                                                                                       \
  |  |  ------------------
  |  |  |  |   53|  30.4M|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  30.4M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (40:29): [True: 61.2k, False: 30.4M]
  |  |  |  |  |  |  |  Branch (40:53): [True: 62.8k, False: 30.3M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  151|  30.4M|}
  ------------------
  304|  30.4M|                               ps_tu_sblk_coeff_data->ai2_level[sblk_non_zero_coeff_idx],
  305|  30.4M|                               pi2_dequant_matrix[(subblk_pos_x + xs)
  306|  30.4M|                                               + (subblk_pos_y + ys)
  307|  30.4M|                                               * trans_size]
  308|  30.4M|                               * g_ihevc_iquant_scales[qp_rem],
  309|  30.4M|                               shift_iq, qp_div);
  310|  30.4M|                        sblk_non_zero_coeff_idx++;
  311|  30.4M|                    }
  312|       |
  313|  33.9M|                    if(trans_skip)
  ------------------
  |  Branch (313:24): [True: 1.23M, False: 32.6M]
  ------------------
  314|  1.23M|                        iquant_out = (iquant_out + 16) >> 5;
  315|  33.9M|                }
  316|   238k|                else
  317|   238k|                {
  318|   238k|                    iquant_out = ps_tu_sblk_coeff_data->ai2_level[sblk_non_zero_coeff_idx++];
  319|   238k|                }
  320|  34.1M|                *pu4_zero_cols &= ~(0x1 << (subblk_pos_x + xs));
  321|  34.1M|                *pu4_zero_rows &= ~(0x1 << (subblk_pos_y + ys));
  322|  34.1M|                *(pi2_sblk_ptr + xs + ys * trans_size) = iquant_out;
  323|  34.1M|            }
  324|  34.1M|            sblk_scan_idx--;
  325|  34.1M|            u4_sig_coeff_map <<= 1;
  326|       |
  327|  34.1M|        }while(u4_sig_coeff_map);
  ------------------
  |  Branch (327:16): [True: 23.2M, False: 10.8M]
  ------------------
  328|       |        /* Updating the sblk pointer */
  329|  10.8M|        ps_tu_sblk_coeff_data =
  330|  10.8M|                        (void *)&ps_tu_sblk_coeff_data->ai2_level[sblk_non_zero_coeff_idx];
  331|  10.8M|    }
  332|       |
  333|  5.32M|    STATS_UPDATE_SBLK_AND_COEFF_HISTOGRAM(e_trans_type, (trans_quant_bypass || trans_skip));
  ------------------
  |  |  143|  5.32M|#define STATS_UPDATE_SBLK_AND_COEFF_HISTOGRAM(e_trans_type, t_skip_or_tq_bypass) ;
  ------------------
  334|       |
  335|  5.32M|    pu1_new_tu_coeff_data = (UWORD8 *)ps_tu_sblk_coeff_data;
  336|       |
  337|  5.32M|    return pu1_new_tu_coeff_data;
  338|  7.81M|}
ihevcd_get_intra_nbr_flag:
  347|  8.92M|{
  348|  8.92M|    sps_t *ps_sps;
  349|  8.92M|    UWORD8 u1_bot_lt_avail, u1_left_avail, u1_top_avail, u1_top_rt_avail,
  350|  8.92M|                    u1_top_lt_avail;
  351|  8.92M|    WORD32 x_cur, y_cur, x_nbr, y_nbr;
  352|  8.92M|    UWORD8 *pu1_nbr_intra_flag;
  353|  8.92M|    UWORD8 *pu1_pic_intra_flag;
  354|  8.92M|    UWORD8 top_right, top, top_left, left, bot_left;
  355|  8.92M|    WORD32 intra_pos;
  356|  8.92M|    WORD32 num_8_blks, num_8_blks_in_bits;
  357|  8.92M|    WORD32 numbytes_row = (i2_pic_width_in_luma_samples + 63) / 64;
  358|  8.92M|    WORD32 cur_x, cur_y;
  359|  8.92M|    WORD32 i;
  360|  8.92M|    WORD32 nbr_flags;
  361|       |
  362|  8.92M|    ps_sps = ps_proc->ps_sps;
  363|  8.92M|    cur_x = ps_tu->b4_pos_x;
  364|  8.92M|    cur_y = ps_tu->b4_pos_y;
  365|       |
  366|  8.92M|    u1_bot_lt_avail = (pu4_intra_nbr_avail[1 + cur_y + trans_size / MIN_TU_SIZE]
  ------------------
  |  |  348|  8.92M|#define MIN_TU_SIZE         4
  ------------------
  367|  8.92M|                    >> (31 - (1 + cur_x - 1))) & 1;
  368|  8.92M|    u1_left_avail = (pu4_intra_nbr_avail[1 + cur_y] >> (31 - (1 + cur_x - 1)))
  369|  8.92M|                    & 1;
  370|  8.92M|    u1_top_avail = (pu4_intra_nbr_avail[1 + cur_y - 1] >> (31 - (1 + cur_x)))
  371|  8.92M|                    & 1;
  372|  8.92M|    u1_top_rt_avail = (pu4_intra_nbr_avail[1 + cur_y - 1]
  373|  8.92M|                    >> (31 - (1 + cur_x + trans_size / MIN_TU_SIZE))) & 1;
  ------------------
  |  |  348|  8.92M|#define MIN_TU_SIZE         4
  ------------------
  374|  8.92M|    u1_top_lt_avail = (pu4_intra_nbr_avail[1 + cur_y - 1]
  375|  8.92M|                    >> (31 - (1 + cur_x - 1))) & 1;
  376|       |
  377|  8.92M|    x_cur = ps_proc->i4_ctb_x * ctb_size + cur_x * MIN_TU_SIZE;
  ------------------
  |  |  348|  8.92M|#define MIN_TU_SIZE         4
  ------------------
  378|  8.92M|    y_cur = ps_proc->i4_ctb_y * ctb_size + cur_y * MIN_TU_SIZE;
  ------------------
  |  |  348|  8.92M|#define MIN_TU_SIZE         4
  ------------------
  379|       |
  380|  8.92M|    pu1_pic_intra_flag = ps_proc->pu1_pic_intra_flag;
  381|       |
  382|       |    /* WORD32 nbr_flags as below  MSB --> LSB */
  383|       |    /*    Top-Left | Top-Right | Top | Left | Bottom-Left
  384|       |     *       1         4         4     4         4
  385|       |     */
  386|  8.92M|    bot_left = 0;
  387|  8.92M|    left = 0;
  388|  8.92M|    top_right = 0;
  389|  8.92M|    top = 0;
  390|  8.92M|    top_left = 0;
  391|       |
  392|  8.92M|    num_8_blks = trans_size > 4 ? trans_size / 8 : 1;
  ------------------
  |  Branch (392:18): [True: 7.57M, False: 1.35M]
  ------------------
  393|  8.92M|    num_8_blks_in_bits = ((1 << num_8_blks) - 1);
  394|       |
  395|  8.92M|    if(i1_constrained_intra_pred_flag)
  ------------------
  |  Branch (395:8): [True: 6.00M, False: 2.92M]
  ------------------
  396|  6.00M|    {
  397|       |        /* TODO: constrained intra pred not tested */
  398|  6.00M|        if(u1_bot_lt_avail)
  ------------------
  |  Branch (398:12): [True: 1.76M, False: 4.24M]
  ------------------
  399|  1.76M|        {
  400|  1.76M|            x_nbr = x_cur - 1;
  401|  1.76M|            y_nbr = y_cur + trans_size;
  402|       |
  403|  1.76M|            pu1_nbr_intra_flag = pu1_pic_intra_flag + y_nbr / 8 * numbytes_row
  404|  1.76M|                            + x_nbr / 64;
  405|  1.76M|            intra_pos = ((x_nbr / 8) % 8);
  406|  5.72M|            for(i = 0; i < num_8_blks; i++)
  ------------------
  |  Branch (406:24): [True: 3.96M, False: 1.76M]
  ------------------
  407|  3.96M|            {
  408|  3.96M|                bot_left |= ((*(pu1_nbr_intra_flag + i * numbytes_row)
  409|  3.96M|                                >> intra_pos) & 1) << i;
  410|  3.96M|            }
  411|  1.76M|            bot_left &= num_8_blks_in_bits;
  412|  1.76M|        }
  413|  6.00M|        if(u1_left_avail)
  ------------------
  |  Branch (413:12): [True: 5.96M, False: 47.3k]
  ------------------
  414|  5.96M|        {
  415|  5.96M|            x_nbr = x_cur - 1;
  416|  5.96M|            y_nbr = y_cur;
  417|       |
  418|  5.96M|            pu1_nbr_intra_flag = pu1_pic_intra_flag + y_nbr / 8 * numbytes_row
  419|  5.96M|                            + x_nbr / 64;
  420|  5.96M|            intra_pos = ((x_nbr / 8) % 8);
  421|       |
  422|  20.0M|            for(i = 0; i < num_8_blks; i++)
  ------------------
  |  Branch (422:24): [True: 14.0M, False: 5.96M]
  ------------------
  423|  14.0M|            {
  424|  14.0M|                left |= ((*(pu1_nbr_intra_flag + i * numbytes_row) >> intra_pos)
  425|  14.0M|                                & 1) << i;
  426|  14.0M|            }
  427|  5.96M|            left &= num_8_blks_in_bits;
  428|  5.96M|        }
  429|  6.00M|        if(u1_top_avail)
  ------------------
  |  Branch (429:12): [True: 5.64M, False: 364k]
  ------------------
  430|  5.64M|        {
  431|  5.64M|            x_nbr = x_cur;
  432|  5.64M|            y_nbr = y_cur - 1;
  433|       |
  434|  5.64M|            pu1_nbr_intra_flag = pu1_pic_intra_flag + y_nbr / 8 * numbytes_row
  435|  5.64M|                            + x_nbr / 64;
  436|  5.64M|            intra_pos = ((x_nbr / 8) % 8);
  437|       |
  438|  5.64M|            top = (*pu1_nbr_intra_flag >> intra_pos);
  439|  5.64M|            top &= num_8_blks_in_bits;
  440|       |            /*
  441|       |             for(i=0;i<num_8_blks;i++)
  442|       |             {
  443|       |             top |= ( (*pu1_nbr_intra_flag >> (intra_pos+i)) & 1) << i;
  444|       |             }
  445|       |             */
  446|  5.64M|        }
  447|  6.00M|        if(u1_top_rt_avail)
  ------------------
  |  Branch (447:12): [True: 3.83M, False: 2.16M]
  ------------------
  448|  3.83M|        {
  449|  3.83M|            x_nbr = x_cur + trans_size;
  450|  3.83M|            y_nbr = y_cur - 1;
  451|       |
  452|  3.83M|            pu1_nbr_intra_flag = pu1_pic_intra_flag + y_nbr / 8 * numbytes_row
  453|  3.83M|                            + x_nbr / 64;
  454|  3.83M|            intra_pos = ((x_nbr / 8) % 8);
  455|       |
  456|  3.83M|            top_right = (*pu1_nbr_intra_flag >> intra_pos);
  457|  3.83M|            top_right &= num_8_blks_in_bits;
  458|       |            /*
  459|       |             for(i=0;i<num_8_blks;i++)
  460|       |             {
  461|       |             top_right |= ( (*pu1_nbr_intra_flag >> (intra_pos+i)) & 1) << i;
  462|       |             }
  463|       |             */
  464|  3.83M|        }
  465|  6.00M|        if(u1_top_lt_avail)
  ------------------
  |  Branch (465:12): [True: 5.59M, False: 408k]
  ------------------
  466|  5.59M|        {
  467|  5.59M|            x_nbr = x_cur - 1;
  468|  5.59M|            y_nbr = y_cur - 1;
  469|       |
  470|  5.59M|            pu1_nbr_intra_flag = pu1_pic_intra_flag + y_nbr / 8 * numbytes_row
  471|  5.59M|                            + x_nbr / 64;
  472|  5.59M|            intra_pos = ((x_nbr / 8) % 8);
  473|       |
  474|  5.59M|            top_left = (*pu1_nbr_intra_flag >> intra_pos) & 1;
  475|  5.59M|        }
  476|  6.00M|    }
  477|  2.92M|    else
  478|  2.92M|    {
  479|  2.92M|        if(u1_top_avail)
  ------------------
  |  Branch (479:12): [True: 2.81M, False: 109k]
  ------------------
  480|  2.81M|            top = 0xF;
  481|  2.92M|        if(u1_top_rt_avail)
  ------------------
  |  Branch (481:12): [True: 1.92M, False: 992k]
  ------------------
  482|  1.92M|            top_right = 0xF;
  483|  2.92M|        if(u1_bot_lt_avail)
  ------------------
  |  Branch (483:12): [True: 848k, False: 2.07M]
  ------------------
  484|   848k|            bot_left = 0xF;
  485|  2.92M|        if(u1_left_avail)
  ------------------
  |  Branch (485:12): [True: 2.88M, False: 36.6k]
  ------------------
  486|  2.88M|            left = 0xF;
  487|  2.92M|        if(u1_top_lt_avail)
  ------------------
  |  Branch (487:12): [True: 2.77M, False: 147k]
  ------------------
  488|  2.77M|            top_left = 0x1;
  489|  2.92M|    }
  490|       |
  491|       |    /* Handling incomplete CTBs */
  492|  8.92M|    {
  493|  8.92M|        WORD32 pu_size_limit = MIN(trans_size, 8);
  ------------------
  |  |   43|  8.92M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.35M, False: 7.57M]
  |  |  ------------------
  ------------------
  494|  8.92M|        WORD32 cols_remaining = ps_sps->i2_pic_width_in_luma_samples
  495|  8.92M|                        - (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size)
  496|  8.92M|                        - (ps_tu->b4_pos_x * MIN_TU_SIZE)
  ------------------
  |  |  348|  8.92M|#define MIN_TU_SIZE         4
  ------------------
  497|  8.92M|                        - (1 << (ps_tu->b3_size + 2));
  498|       |        /* ctb_size_top gives number of valid pixels remaining in the current row */
  499|  8.92M|        WORD32 ctb_size_top = MIN(ctb_size, cols_remaining);
  ------------------
  |  |   43|  8.92M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 8.55M, False: 373k]
  |  |  ------------------
  ------------------
  500|  8.92M|        WORD32 ctb_size_top_bits = (1 << (ctb_size_top / pu_size_limit)) - 1;
  501|       |
  502|  8.92M|        WORD32 rows_remaining = ps_sps->i2_pic_height_in_luma_samples
  503|  8.92M|                        - (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size)
  504|  8.92M|                        - (ps_tu->b4_pos_y * MIN_TU_SIZE)
  ------------------
  |  |  348|  8.92M|#define MIN_TU_SIZE         4
  ------------------
  505|  8.92M|                        - (1 << (ps_tu->b3_size + 2));
  506|       |        /* ctb_size_bot gives number of valid pixels remaining in the current column */
  507|  8.92M|        WORD32 ctb_size_bot = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  8.92M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 8.26M, False: 665k]
  |  |  ------------------
  ------------------
  508|  8.92M|        WORD32 ctb_size_bot_bits = (1 << (ctb_size_bot / pu_size_limit)) - 1;
  509|       |
  510|  8.92M|        top_right &= ctb_size_top_bits;
  511|  8.92M|        bot_left &= ctb_size_bot_bits;
  512|  8.92M|    }
  513|       |
  514|       |    /*    Top-Left | Top-Right | Top | Left | Bottom-Left
  515|       |     *      1         4         4     4         4
  516|       |     */
  517|       |
  518|       |    /*
  519|       |     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)
  520|       |     | gau4_ihevcd_4_bit_reverse[bot_left];
  521|       |     */
  522|  8.92M|    nbr_flags = (top_left << 16) | (top_right << 12) | (top << 8) | (gau4_ihevcd_4_bit_reverse[left] << 4)
  523|  8.92M|                    | gau4_ihevcd_4_bit_reverse[bot_left];
  524|       |
  525|       |
  526|  8.92M|    return nbr_flags;
  527|       |
  528|  8.92M|}
ihevcd_iquant_itrans_recon_ctb:
  531|  7.49M|{
  532|  7.49M|    WORD16 *pi2_scaling_mat;
  533|  7.49M|    UWORD8 *pu1_y_dst_ctb;
  534|  7.49M|    UWORD8 *pu1_uv_dst_ctb;
  535|  7.49M|    WORD32 ctb_size;
  536|  7.49M|    codec_t *ps_codec;
  537|  7.49M|    slice_header_t *ps_slice_hdr;
  538|  7.49M|    tu_t *ps_tu;
  539|  7.49M|    WORD16 *pi2_ctb_coeff;
  540|  7.49M|    WORD32 tu_cnt;
  541|  7.49M|    WORD16 *pi2_tu_coeff;
  542|  7.49M|    WORD16 *pi2_tmp;
  543|  7.49M|    WORD32 pic_strd;
  544|  7.49M|    WORD32 luma_nbr_flags;
  545|  7.49M|    WORD32 luma_nbr_flags_4x4[4] = { 0 };
  546|  7.49M|    WORD32 chroma_nbr_flags = 0;
  547|  7.49M|    UWORD8 u1_luma_pred_mode_first_tu = 0;
  548|       |    /* Pointers for generating 2d coeffs from coeff-map */
  549|  7.49M|    UWORD8 *pu1_tu_coeff_data;
  550|       |    /* nbr avail map for CTB */
  551|       |    /* 1st bit points to neighbor (left/top_left/bot_left) */
  552|       |    /* 1Tb starts at 2nd bit from msb of 2nd value in array, followed by number of min_tu's in that ctb */
  553|  7.49M|    UWORD32 au4_intra_nbr_avail[MAX_CTB_SIZE / MIN_TU_SIZE
  554|  7.49M|                    + 2 /* Top nbr + bot nbr */]; UWORD32
  555|  7.49M|                    top_avail_bits;
  556|  7.49M|    sps_t *ps_sps;
  557|  7.49M|    pps_t *ps_pps;
  558|  7.49M|    WORD32 intra_flag;
  559|  7.49M|    UWORD8 *pu1_pic_intra_flag;
  560|       |    /*************************************************************************/
  561|       |    /* Contanis scaling matrix offset in the following order in a 1D buffer  */
  562|       |    /* Intra 4 x 4 Y, 4 x 4 U, 4 x 4 V                                       */
  563|       |    /* Inter 4 x 4 Y, 4 x 4 U, 4 x 4 V                                       */
  564|       |    /* Intra 8 x 8 Y, 8 x 8 U, 8 x 8 V                                       */
  565|       |    /* Inter 8 x 8 Y, 8 x 8 U, 8 x 8 V                                       */
  566|       |    /* Intra 16x16 Y, 16x16 U, 16x16 V                                       */
  567|       |    /* Inter 16x16 Y, 16x16 U, 16x16 V                                       */
  568|       |    /* Intra 32x32 Y                                                         */
  569|       |    /* Inter 32x32 Y                                                         */
  570|       |    /*************************************************************************/
  571|       |    /* Only first 20 entries are used. Array is extended to avoid out of bound
  572|       |       reads. Skip CUs (64x64) read this table, but don't really use the value */
  573|  7.49M|    static const WORD32 scaling_mat_offset[] =
  574|  7.49M|      { 0, 16, 32, 48, 64, 80, 96, 160, 224, 288, 352, 416, 480, 736, 992,
  575|  7.49M|        1248, 1504, 1760, 2016, 3040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
  576|       |
  577|  7.49M|    PROFILE_DISABLE_IQ_IT_RECON_INTRA_PRED();
  ------------------
  |  |   63|  7.49M|#define PROFILE_DISABLE_IQ_IT_RECON_INTRA_PRED() ;
  ------------------
  578|       |
  579|  7.49M|    ps_sps = ps_proc->ps_sps;
  580|  7.49M|    ps_pps = ps_proc->ps_pps;
  581|  7.49M|    ps_slice_hdr = ps_proc->ps_slice_hdr;
  582|  7.49M|    ps_codec = ps_proc->ps_codec;
  583|       |
  584|  7.49M|    pu1_y_dst_ctb = ps_proc->pu1_cur_ctb_luma;
  585|  7.49M|    pu1_uv_dst_ctb = ps_proc->pu1_cur_ctb_chroma;
  586|       |
  587|  7.49M|    pi2_ctb_coeff = ps_proc->pi2_invscan_out;
  588|       |
  589|  7.49M|    ctb_size = (1 << ps_sps->i1_log2_ctb_size);
  590|  7.49M|    pu1_tu_coeff_data = (UWORD8 *)ps_proc->pv_tu_coeff_data;
  591|       |
  592|  7.49M|    pic_strd = ps_codec->i4_strd;
  593|       |
  594|  7.49M|    pi2_tmp = ps_proc->pi2_itrans_intrmd_buf;
  595|       |
  596|  7.49M|    pi2_tu_coeff = pi2_ctb_coeff;
  597|       |
  598|  7.49M|    ps_tu = ps_proc->ps_tu;
  599|       |
  600|  7.49M|    if((1 == ps_sps->i1_scaling_list_enable_flag) && (1 == ps_pps->i1_pps_scaling_list_data_present_flag))
  ------------------
  |  Branch (600:8): [True: 7.08M, False: 411k]
  |  Branch (600:54): [True: 4.91k, False: 7.07M]
  ------------------
  601|  4.91k|    {
  602|  4.91k|        pi2_scaling_mat = ps_pps->pi2_scaling_mat;
  603|  4.91k|    }
  604|  7.48M|    else
  605|  7.48M|    {
  606|  7.48M|        pi2_scaling_mat = ps_sps->pi2_scaling_mat;
  607|  7.48M|    }
  608|       |
  609|  7.49M|    {
  610|       |        /* Updating the initial availability map */
  611|  7.49M|        WORD32 i;
  612|  7.49M|        UWORD8 u1_left_ctb_avail, u1_top_lt_ctb_avail, u1_top_rt_ctb_avail,
  613|  7.49M|                        u1_top_ctb_avail;
  614|       |
  615|  7.49M|        u1_left_ctb_avail = ps_proc->u1_left_ctb_avail;
  616|  7.49M|        u1_top_lt_ctb_avail = ps_proc->u1_top_lt_ctb_avail;
  617|  7.49M|        u1_top_ctb_avail = ps_proc->u1_top_ctb_avail;
  618|  7.49M|        u1_top_rt_ctb_avail = ps_proc->u1_top_rt_ctb_avail;
  619|       |
  620|       |        /* Initializing the availability array */
  621|  7.49M|        memset(au4_intra_nbr_avail, 0,
  622|  7.49M|               (MAX_CTB_SIZE / MIN_TU_SIZE + 2) * sizeof(UWORD32));
  ------------------
  |  |  341|  7.49M|#define MAX_CTB_SIZE        64
  ------------------
                             (MAX_CTB_SIZE / MIN_TU_SIZE + 2) * sizeof(UWORD32));
  ------------------
  |  |  348|  7.49M|#define MIN_TU_SIZE         4
  ------------------
  623|       |        /* Initializing the availability array with CTB level availability flags */
  624|  7.49M|        {
  625|  7.49M|            WORD32 rows_remaining = ps_sps->i2_pic_height_in_luma_samples - (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size);
  626|  7.49M|            WORD32 ctb_size_left = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  7.49M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 7.20M, False: 283k]
  |  |  ------------------
  ------------------
  627|  64.4M|            for(i = 0; i < ctb_size_left / MIN_TU_SIZE; i++)
  ------------------
  |  |  348|  64.4M|#define MIN_TU_SIZE         4
  ------------------
  |  Branch (627:24): [True: 56.9M, False: 7.49M]
  ------------------
  628|  56.9M|            {
  629|  56.9M|                au4_intra_nbr_avail[i + 1] = ((UWORD32)u1_left_ctb_avail << 31);
  630|  56.9M|            }
  631|  7.49M|        }
  632|  7.49M|        au4_intra_nbr_avail[0] |= (((UWORD32)u1_top_rt_ctb_avail << 31)
  633|  7.49M|                        >> (1 + ctb_size / MIN_TU_SIZE)); /* 1+ctb_size/4 position bit pos from msb */
  ------------------
  |  |  348|  7.49M|#define MIN_TU_SIZE         4
  ------------------
  634|       |
  635|  7.49M|        au4_intra_nbr_avail[0] |= ((UWORD32)u1_top_lt_ctb_avail << 31);
  636|       |
  637|  7.49M|        {
  638|  7.49M|            WORD32 cols_remaining = ps_sps->i2_pic_width_in_luma_samples - (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size);
  639|  7.49M|            WORD32 ctb_size_top = MIN(ctb_size, cols_remaining);
  ------------------
  |  |   43|  7.49M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 7.01M, False: 473k]
  |  |  ------------------
  ------------------
  640|  7.49M|            WORD32 shift = (31 - (ctb_size / MIN_TU_SIZE));
  ------------------
  |  |  348|  7.49M|#define MIN_TU_SIZE         4
  ------------------
  641|       |
  642|       |            /* ctb_size_top gives number of valid pixels remaining in the current row */
  643|       |            /* Since we need pattern of 1's starting from the MSB, an additional shift */
  644|       |            /* is needed */
  645|  7.49M|            shift += ((ctb_size - ctb_size_top) / MIN_TU_SIZE);
  ------------------
  |  |  348|  7.49M|#define MIN_TU_SIZE         4
  ------------------
  646|       |
  647|  7.49M|            top_avail_bits = ((1 << (ctb_size_top / MIN_TU_SIZE)) - 1)
  ------------------
  |  |  348|  7.49M|#define MIN_TU_SIZE         4
  ------------------
  648|  7.49M|                            << shift;
  649|  7.49M|        }
  650|  7.49M|        au4_intra_nbr_avail[0] |= (
  651|  7.49M|                        (u1_top_ctb_avail == 1) ? top_avail_bits : 0x0);
  ------------------
  |  Branch (651:25): [True: 7.17M, False: 315k]
  ------------------
  652|       |        /* Starting from msb 2nd bit to (1+ctb_size/4) bit, set 1 if top avail,or 0 */
  653|       |
  654|  7.49M|    }
  655|       |
  656|       |    /* Applying Inverse transform on all the TU's in CTB */
  657|   110M|    for(tu_cnt = 0; tu_cnt < ps_proc->i4_ctb_tu_cnt; tu_cnt++, ps_tu++)
  ------------------
  |  Branch (657:21): [True: 102M, False: 7.49M]
  ------------------
  658|   102M|    {
  659|   102M|        WORD32 transform_skip_flag = 0;
  660|   102M|        WORD32 transform_skip_flag_v = 0;
  661|   102M|        WORD32 num_comp, c_idx, func_idx;
  662|   102M|        WORD32 src_strd, pred_strd, dst_strd;
  663|   102M|        WORD32 qp_div = 0, qp_rem = 0;
  664|   102M|        WORD32 qp_div_v = 0, qp_rem_v = 0;
  665|   102M|        UWORD32 zero_cols = 0, zero_cols_v = 0;
  666|   102M|        UWORD32 zero_rows = 0, zero_rows_v = 0;
  667|   102M|        UWORD32 coeff_type = 0, coeff_type_v = 0;
  668|   102M|        WORD16 i2_coeff_value, i2_coeff_value_v;
  669|   102M|        WORD32 trans_size = 0;
  670|   102M|        TRANSFORM_TYPE e_trans_type;
  671|   102M|        WORD32 log2_y_trans_size_minus_2, log2_uv_trans_size_minus_2;
  672|   102M|        WORD32 log2_trans_size;
  673|   102M|        WORD32 chroma_qp_idx;
  674|   102M|        WORD16 *pi2_src = NULL, *pi2_src_v = NULL;
  675|   102M|        UWORD8 *pu1_pred = NULL, *pu1_pred_v = NULL;
  676|   102M|        UWORD8 *pu1_dst = NULL, *pu1_dst_v = NULL;
  677|   102M|        WORD16 *pi2_dequant_matrix = NULL, *pi2_dequant_matrix_v = NULL;
  678|   102M|        WORD32 tu_x, tu_y;
  679|   102M|        WORD32 tu_y_offset, tu_uv_offset;
  680|   102M|        WORD8 i1_chroma_pic_qp_offset, i1_chroma_slice_qp_offset;
  681|   102M|        UWORD8 u1_cbf = 0, u1_cbf_v = 0, u1_luma_pred_mode, u1_chroma_pred_mode;
  682|   102M|        WORD32 offset;
  683|   102M|        WORD32 pcm_flag;
  684|   102M|        WORD32  chroma_yuv420sp_vu = (ps_codec->e_ref_chroma_fmt == IV_YUV_420SP_VU);
  685|       |        /* If 420SP_VU is chroma format, pred and dst pointer   */
  686|       |        /* will be added +1 to point to U                       */
  687|   102M|        WORD32 chroma_yuv420sp_vu_u_offset = 1 * chroma_yuv420sp_vu;
  688|       |        /* If 420SP_VU is chroma format, pred and dst pointer   */
  689|       |        /* will be added U offset of +1 and subtracted 2        */
  690|       |        /* to point to V                                        */
  691|   102M|        WORD32 chroma_yuv420sp_vu_v_offset = -2 * chroma_yuv420sp_vu;
  692|       |
  693|   102M|        tu_x = ps_tu->b4_pos_x * 4; /* Converting minTU unit to pixel unit */
  694|   102M|        tu_y = ps_tu->b4_pos_y * 4; /* Converting minTU unit to pixel unit */
  695|   102M|        {
  696|   102M|            WORD32 tu_abs_x = (ps_proc->i4_ctb_x << ps_sps->i1_log2_ctb_size) + (tu_x);
  697|   102M|            WORD32 tu_abs_y = (ps_proc->i4_ctb_y << ps_sps->i1_log2_ctb_size) + (tu_y);
  698|       |
  699|   102M|            WORD32 numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
  700|       |
  701|   102M|            pu1_pic_intra_flag = ps_proc->pu1_pic_intra_flag;
  702|   102M|            pu1_pic_intra_flag += (tu_abs_y >> 3) * numbytes_row;
  703|   102M|            pu1_pic_intra_flag += (tu_abs_x >> 6);
  704|       |
  705|   102M|            intra_flag = *pu1_pic_intra_flag;
  706|   102M|            intra_flag &= (1 << ((tu_abs_x >> 3) % 8));
  707|   102M|        }
  708|       |
  709|   102M|        u1_luma_pred_mode = ps_tu->b6_luma_intra_mode;
  710|   102M|        u1_chroma_pred_mode = ps_tu->b3_chroma_intra_mode_idx;
  711|       |
  712|   102M|        if(u1_chroma_pred_mode != 7)
  ------------------
  |  Branch (712:12): [True: 8.03M, False: 94.5M]
  ------------------
  713|  8.03M|            num_comp = 2; /* Y and UV */
  714|  94.5M|        else
  715|  94.5M|            num_comp = 1; /* Y */
  716|       |
  717|       |
  718|   102M|        pcm_flag = 0;
  719|       |
  720|   102M|        if((intra_flag) && (u1_luma_pred_mode == INTRA_PRED_NONE))
  ------------------
  |  |  511|  8.92M|#define INTRA_PRED_NONE  63
  ------------------
  |  Branch (720:12): [True: 8.92M, False: 93.6M]
  |  Branch (720:28): [True: 7, False: 8.92M]
  ------------------
  721|      7|        {
  722|      7|            UWORD8 *pu1_buf;
  723|      7|            UWORD8 *pu1_y_dst = pu1_y_dst_ctb;
  724|      7|            UWORD8 *pu1_uv_dst = pu1_uv_dst_ctb;
  725|      7|            WORD32 i, j;
  726|      7|            tu_sblk_coeff_data_t *ps_tu_sblk_coeff_data;
  727|      7|            WORD32 cb_size = 1 << (ps_tu->b3_size + 2);
  728|       |
  729|       |            /* trans_size is used to update availability after reconstruction */
  730|      7|            trans_size = cb_size;
  731|       |
  732|      7|            pcm_flag = 1;
  733|       |
  734|      7|            tu_y_offset = tu_x + tu_y * pic_strd;
  735|      7|            pu1_y_dst += tu_x + tu_y * pic_strd;
  736|      7|            pu1_uv_dst += tu_x + (tu_y >> 1) * pic_strd;
  737|       |
  738|       |            /* First byte points to number of coded blocks */
  739|      7|            pu1_tu_coeff_data++;
  740|       |
  741|       |            /* Next byte points to scan type */
  742|      7|            pu1_tu_coeff_data++;
  743|       |
  744|      7|            ps_tu_sblk_coeff_data = (tu_sblk_coeff_data_t *)pu1_tu_coeff_data;
  745|       |
  746|      7|            pu1_buf = (UWORD8 *)&ps_tu_sblk_coeff_data->ai2_level[0];
  747|      7|            {
  748|       |
  749|     63|                for(i = 0; i < cb_size; i++)
  ------------------
  |  Branch (749:28): [True: 56, False: 7]
  ------------------
  750|     56|                {
  751|       |                    //pu1_y_dst[i * pic_strd + j] = *pu1_buf++;
  752|     56|                    memcpy(&pu1_y_dst[i * pic_strd], pu1_buf, cb_size);
  753|     56|                    pu1_buf += cb_size;
  754|     56|                }
  755|       |
  756|      7|                pu1_uv_dst = pu1_uv_dst + chroma_yuv420sp_vu_u_offset;
  757|       |
  758|       |                /* U */
  759|     35|                for(i = 0; i < cb_size / 2; i++)
  ------------------
  |  Branch (759:28): [True: 28, False: 7]
  ------------------
  760|     28|                {
  761|    140|                    for(j = 0; j < cb_size / 2; j++)
  ------------------
  |  Branch (761:32): [True: 112, False: 28]
  ------------------
  762|    112|                    {
  763|    112|                        pu1_uv_dst[i * pic_strd + 2 * j] = *pu1_buf++;
  764|    112|                    }
  765|     28|                }
  766|       |
  767|      7|                pu1_uv_dst = pu1_uv_dst + 1 + chroma_yuv420sp_vu_v_offset;
  768|       |
  769|       |                /* V */
  770|     35|                for(i = 0; i < cb_size / 2; i++)
  ------------------
  |  Branch (770:28): [True: 28, False: 7]
  ------------------
  771|     28|                {
  772|    140|                    for(j = 0; j < cb_size / 2; j++)
  ------------------
  |  Branch (772:32): [True: 112, False: 28]
  ------------------
  773|    112|                    {
  774|    112|                        pu1_uv_dst[i * pic_strd + 2 * j] = *pu1_buf++;
  775|    112|                    }
  776|     28|                }
  777|      7|            }
  778|       |
  779|      7|            pu1_tu_coeff_data = pu1_buf;
  780|       |
  781|      7|        }
  782|       |
  783|       |
  784|       |
  785|       |
  786|       |
  787|   212M|        for(c_idx = 0; c_idx < num_comp; c_idx++)
  ------------------
  |  Branch (787:24): [True: 110M, False: 102M]
  ------------------
  788|   110M|        {
  789|   110M|            if(0 == pcm_flag)
  ------------------
  |  Branch (789:16): [True: 110M, False: 18.4E]
  ------------------
  790|   110M|            {
  791|       |                /* Initializing variables */
  792|   110M|                pred_strd = pic_strd;
  793|   110M|                dst_strd = pic_strd;
  794|       |
  795|   110M|                if(c_idx == 0) /* Y */
  ------------------
  |  Branch (795:20): [True: 102M, False: 8.00M]
  ------------------
  796|   102M|                {
  797|   102M|                    log2_y_trans_size_minus_2 = ps_tu->b3_size;
  798|   102M|                    trans_size = 1 << (log2_y_trans_size_minus_2 + 2);
  799|   102M|                    log2_trans_size = log2_y_trans_size_minus_2 + 2;
  800|       |
  801|   102M|                    tu_y_offset = tu_x + tu_y * pic_strd;
  802|       |
  803|   102M|                    pi2_src = pi2_tu_coeff;
  804|   102M|                    pu1_pred = pu1_y_dst_ctb + tu_y_offset;
  805|   102M|                    pu1_dst = pu1_y_dst_ctb + tu_y_offset;
  806|       |
  807|       |                    /* Calculating scaling matrix offset */
  808|   102M|                    offset = log2_y_trans_size_minus_2 * 6
  809|   102M|                                    + (!intra_flag)
  810|   102M|                                    * ((log2_y_trans_size_minus_2
  ------------------
  |  Branch (810:40): [True: 2.79M, False: 99.5M]
  ------------------
  811|   102M|                                                    == 3) ? 1 : 3)
  812|   102M|                                    + c_idx;
  813|   102M|                    pi2_dequant_matrix = pi2_scaling_mat
  814|   102M|                                    + scaling_mat_offset[offset];
  815|       |
  816|   102M|                    src_strd = trans_size;
  817|       |
  818|       |                    /* 4x4 transform Luma in INTRA mode is DST */
  819|   102M|                    if(log2_y_trans_size_minus_2 == 0 && intra_flag)
  ------------------
  |  Branch (819:24): [True: 1.57M, False: 100M]
  |  Branch (819:58): [True: 1.35M, False: 223k]
  ------------------
  820|  1.35M|                    {
  821|  1.35M|                        func_idx = log2_y_trans_size_minus_2;
  822|  1.35M|                        e_trans_type = DST_4x4;
  823|  1.35M|                    }
  824|   100M|                    else
  825|   100M|                    {
  826|   100M|                        func_idx = log2_y_trans_size_minus_2 + 1;
  827|   100M|                        e_trans_type = (TRANSFORM_TYPE)(log2_y_trans_size_minus_2 + 1);
  828|   100M|                    }
  829|       |
  830|   102M|                    qp_div = ps_tu->b7_qp / 6;
  831|   102M|                    qp_rem = ps_tu->b7_qp % 6;
  832|       |
  833|   102M|                    u1_cbf = ps_tu->b1_y_cbf;
  834|       |
  835|   102M|                    transform_skip_flag = pu1_tu_coeff_data[1] & 1;
  836|       |                    /* Unpacking coeffs */
  837|   102M|                    if(1 == u1_cbf)
  ------------------
  |  Branch (837:24): [True: 5.42M, False: 96.9M]
  ------------------
  838|  5.42M|                    {
  839|  5.42M|                        pu1_tu_coeff_data = ihevcd_unpack_coeffs(
  840|  5.42M|                                        pi2_src, log2_y_trans_size_minus_2 + 2,
  841|  5.42M|                                        pu1_tu_coeff_data, pi2_dequant_matrix,
  842|  5.42M|                                        qp_rem, qp_div, e_trans_type,
  843|  5.42M|                                        ps_tu->b1_transquant_bypass, &zero_cols,
  844|  5.42M|                                        &zero_rows, &coeff_type,
  845|  5.42M|                                        &i2_coeff_value);
  846|  5.42M|                    }
  847|   102M|                }
  848|  8.00M|                else /* UV interleaved */
  849|  8.00M|                {
  850|       |                    /* Chroma :If Transform size is 4x4, keep 4x4 else do transform on (trans_size/2 x trans_size/2) */
  851|  8.00M|                    if(ps_tu->b3_size == 0)
  ------------------
  |  Branch (851:24): [True: 395k, False: 7.61M]
  ------------------
  852|   395k|                    {
  853|       |                        /* 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) */
  854|   395k|                        log2_uv_trans_size_minus_2 = ps_tu->b3_size;
  855|   395k|                        tu_uv_offset = (tu_x - 4) + ((tu_y - 4) / 2) * pic_strd;
  856|   395k|                    }
  857|  7.61M|                    else
  858|  7.61M|                    {
  859|  7.61M|                        log2_uv_trans_size_minus_2 = ps_tu->b3_size - 1;
  860|  7.61M|                        tu_uv_offset = tu_x + (tu_y >> 1) * pic_strd;
  861|  7.61M|                    }
  862|  8.00M|                    trans_size = 1 << (log2_uv_trans_size_minus_2 + 2);
  863|  8.00M|                    log2_trans_size = log2_uv_trans_size_minus_2 + 2;
  864|       |
  865|  8.00M|                    pi2_src = pi2_tu_coeff;
  866|  8.00M|                    pi2_src_v = pi2_tu_coeff + trans_size * trans_size;
  867|  8.00M|                    pu1_pred = pu1_uv_dst_ctb + tu_uv_offset + chroma_yuv420sp_vu_u_offset; /* Pointing to start byte of U*/
  868|  8.00M|                    pu1_pred_v = pu1_pred + 1 + chroma_yuv420sp_vu_v_offset; /* Pointing to start byte of V*/
  869|  8.00M|                    pu1_dst = pu1_uv_dst_ctb + tu_uv_offset + chroma_yuv420sp_vu_u_offset; /* Pointing to start byte of U*/
  870|  8.00M|                    pu1_dst_v = pu1_dst + 1 + chroma_yuv420sp_vu_v_offset; /* Pointing to start byte of V*/
  871|       |
  872|       |                    /*TODO: Add support for choosing different tables for U and V,
  873|       |                     * change this to a single array to handle flat/default/custom, intra/inter, luma/chroma and various sizes
  874|       |                     */
  875|       |                    /* Calculating scaling matrix offset */
  876|       |                    /* ((log2_uv_trans_size_minus_2 == 3) ? 1:3) condition check is not needed, since
  877|       |                     * max uv trans size is 16x16
  878|       |                     */
  879|  8.00M|                    offset = log2_uv_trans_size_minus_2 * 6
  880|  8.00M|                                    + (!intra_flag) * 3 + c_idx;
  881|  8.00M|                    pi2_dequant_matrix = pi2_scaling_mat
  882|  8.00M|                                    + scaling_mat_offset[offset];
  883|  8.00M|                    pi2_dequant_matrix_v = pi2_scaling_mat
  884|  8.00M|                                    + scaling_mat_offset[offset + 1];
  885|       |
  886|  8.00M|                    src_strd = trans_size;
  887|       |
  888|  8.00M|                    func_idx = 1 + 4 + log2_uv_trans_size_minus_2; /* DST func + Y funcs + cur func index*/
  889|       |
  890|       |                    /* Handle error cases where 64x64 TU is signalled which results in 32x32 chroma.
  891|       |                     * By limiting func_idx to 7, max of 16x16 chroma is called */
  892|  8.00M|                    func_idx = MIN(func_idx, 7);
  ------------------
  |  |   43|  8.00M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 5.27M, False: 2.72M]
  |  |  ------------------
  ------------------
  893|       |
  894|  8.00M|                    e_trans_type = (TRANSFORM_TYPE)(log2_uv_trans_size_minus_2 + 1);
  895|       |                    /* QP for U */
  896|  8.00M|                    i1_chroma_pic_qp_offset = ps_pps->i1_pic_cb_qp_offset;
  897|  8.00M|                    i1_chroma_slice_qp_offset = ps_slice_hdr->i1_slice_cb_qp_offset;
  898|  8.00M|                    u1_cbf = ps_tu->b1_cb_cbf;
  899|       |
  900|  8.00M|                    chroma_qp_idx = ps_tu->b7_qp + i1_chroma_pic_qp_offset
  901|  8.00M|                                    + i1_chroma_slice_qp_offset;
  902|  8.00M|                    chroma_qp_idx = CLIP3(chroma_qp_idx, 0, 57);
  ------------------
  |  |   40|  8.00M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 8.00M]
  |  |  |  Branch (40:53): [True: 2.17k, False: 8.00M]
  |  |  ------------------
  ------------------
  903|  8.00M|                    qp_div = gai2_ihevcd_chroma_qp[chroma_qp_idx] / 6;
  904|  8.00M|                    qp_rem = gai2_ihevcd_chroma_qp[chroma_qp_idx] % 6;
  905|       |
  906|       |                    /* QP for V */
  907|  8.00M|                    i1_chroma_pic_qp_offset = ps_pps->i1_pic_cr_qp_offset;
  908|  8.00M|                    i1_chroma_slice_qp_offset = ps_slice_hdr->i1_slice_cr_qp_offset;
  909|  8.00M|                    u1_cbf_v = ps_tu->b1_cr_cbf;
  910|       |
  911|  8.00M|                    chroma_qp_idx = ps_tu->b7_qp + i1_chroma_pic_qp_offset
  912|  8.00M|                                    + i1_chroma_slice_qp_offset;
  913|  8.00M|                    chroma_qp_idx = CLIP3(chroma_qp_idx, 0, 57);
  ------------------
  |  |   40|  8.00M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 8.00M]
  |  |  |  Branch (40:53): [True: 3.72k, False: 8.00M]
  |  |  ------------------
  ------------------
  914|  8.00M|                    qp_div_v = gai2_ihevcd_chroma_qp[chroma_qp_idx] / 6;
  915|  8.00M|                    qp_rem_v = gai2_ihevcd_chroma_qp[chroma_qp_idx] % 6;
  916|       |
  917|       |                    /* Unpacking coeffs */
  918|  8.00M|                    transform_skip_flag = pu1_tu_coeff_data[1] & 1;
  919|  8.00M|                    if(1 == u1_cbf)
  ------------------
  |  Branch (919:24): [True: 1.19M, False: 6.80M]
  ------------------
  920|  1.19M|                    {
  921|  1.19M|                        pu1_tu_coeff_data = ihevcd_unpack_coeffs(
  922|  1.19M|                                        pi2_src, log2_uv_trans_size_minus_2 + 2,
  923|  1.19M|                                        pu1_tu_coeff_data, pi2_dequant_matrix,
  924|  1.19M|                                        qp_rem, qp_div, e_trans_type,
  925|  1.19M|                                        ps_tu->b1_transquant_bypass, &zero_cols,
  926|  1.19M|                                        &zero_rows, &coeff_type,
  927|  1.19M|                                        &i2_coeff_value);
  928|  1.19M|                    }
  929|       |
  930|  8.00M|                    transform_skip_flag_v = pu1_tu_coeff_data[1] & 1;
  931|  8.00M|                    if(1 == u1_cbf_v)
  ------------------
  |  Branch (931:24): [True: 1.19M, False: 6.80M]
  ------------------
  932|  1.19M|                    {
  933|  1.19M|                        pu1_tu_coeff_data = ihevcd_unpack_coeffs(
  934|  1.19M|                                        pi2_src_v, log2_uv_trans_size_minus_2 + 2,
  935|  1.19M|                                        pu1_tu_coeff_data, pi2_dequant_matrix_v,
  936|  1.19M|                                        qp_rem_v, qp_div_v, e_trans_type,
  937|  1.19M|                                        ps_tu->b1_transquant_bypass, &zero_cols_v,
  938|  1.19M|                                        &zero_rows_v, &coeff_type_v, &i2_coeff_value_v);
  939|  1.19M|                    }
  940|  8.00M|                }
  941|       |                /***************************************************************/
  942|       |                /******************  Intra Prediction **************************/
  943|       |                /***************************************************************/
  944|   110M|                if(intra_flag) /* Intra */
  ------------------
  |  Branch (944:20): [True: 16.8M, False: 93.5M]
  ------------------
  945|  16.8M|                {
  946|       |                    /* While (MAX_TU_SIZE * 2 * 2) + 1 is the actaul size needed,
  947|       |                       au1_ref_sub_out size is kept as multiple of 8,
  948|       |                       so that SIMD functions can load 64 bits. Also some SIMD
  949|       |                       modules read few bytes before the start of the array, so
  950|       |                       allocate 16 extra bytes at the start */
  951|  16.8M|                    UWORD8 au1_ref_sub_out[16 + (MAX_TU_SIZE * 2 * 2) + 8] = {0};
  952|  16.8M|                    UWORD8 *pu1_ref_sub_out = &au1_ref_sub_out[16];
  953|  16.8M|                    UWORD8 *pu1_top_left, *pu1_top, *pu1_left;
  954|  16.8M|                    WORD32 luma_pred_func_idx, chroma_pred_func_idx;
  955|       |
  956|       |                    /* Get the neighbour availability flags */
  957|       |                    /* Done for only Y */
  958|  16.8M|                    if(c_idx == 0)
  ------------------
  |  Branch (958:24): [True: 8.93M, False: 7.89M]
  ------------------
  959|  8.93M|                    {
  960|       |                        /* Get neighbor availability for Y only */
  961|  8.93M|                        luma_nbr_flags = ihevcd_get_intra_nbr_flag(ps_proc,
  962|  8.93M|                                                                   ps_tu,
  963|  8.93M|                                                                   au4_intra_nbr_avail,
  964|  8.93M|                                                                   ps_sps->i2_pic_width_in_luma_samples,
  965|  8.93M|                                                                   ps_pps->i1_constrained_intra_pred_flag,
  966|  8.93M|                                                                   trans_size,
  967|  8.93M|                                                                   ctb_size);
  968|       |
  969|  8.93M|                        if(trans_size == 4)
  ------------------
  |  Branch (969:28): [True: 1.35M, False: 7.57M]
  ------------------
  970|  1.35M|                            luma_nbr_flags_4x4[(ps_tu->b4_pos_x % 2) + (ps_tu->b4_pos_y % 2) * 2] = luma_nbr_flags;
  971|       |
  972|  8.93M|                        if((ps_tu->b4_pos_x % 2 == 0) && (ps_tu->b4_pos_y % 2 == 0))
  ------------------
  |  Branch (972:28): [True: 8.25M, False: 673k]
  |  Branch (972:58): [True: 7.91M, False: 339k]
  ------------------
  973|  7.91M|                        {
  974|  7.91M|                            chroma_nbr_flags = luma_nbr_flags;
  975|  7.91M|                        }
  976|       |
  977|       |                        /* Initializing nbr pointers */
  978|  8.93M|                        pu1_top = pu1_pred - pic_strd;
  979|  8.93M|                        pu1_left = pu1_pred - 1;
  980|  8.93M|                        pu1_top_left = pu1_pred - pic_strd - 1;
  981|       |
  982|       |                        /* call reference array substitution */
  983|  8.93M|                        if(luma_nbr_flags == 0x1ffff)
  ------------------
  |  Branch (983:28): [True: 1.07M, False: 7.85M]
  ------------------
  984|  1.07M|                            ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_subst_all_avlble_fptr(
  985|  1.07M|                                            pu1_top_left,
  986|  1.07M|                                            pu1_top, pu1_left, pred_strd, trans_size, luma_nbr_flags, pu1_ref_sub_out, 1);
  987|  7.85M|                        else
  988|  7.85M|                            ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr(
  989|  7.85M|                                            pu1_top_left,
  990|  7.85M|                                            pu1_top, pu1_left, pred_strd, trans_size, luma_nbr_flags, pu1_ref_sub_out, 1);
  991|       |
  992|       |                        /* call reference filtering */
  993|  8.93M|                        ps_codec->s_func_selector.ihevc_intra_pred_ref_filtering_fptr(
  994|  8.93M|                                        pu1_ref_sub_out, trans_size,
  995|  8.93M|                                        pu1_ref_sub_out,
  996|  8.93M|                                        u1_luma_pred_mode, ps_sps->i1_strong_intra_smoothing_enable_flag);
  997|       |
  998|       |                        /* use the look up to get the function idx */
  999|  8.93M|                        luma_pred_func_idx = g_i4_ip_funcs[u1_luma_pred_mode];
 1000|       |
 1001|       |                        /* call the intra prediction function */
 1002|  8.93M|                        ps_codec->apf_intra_pred_luma[luma_pred_func_idx](pu1_ref_sub_out, 1, pu1_pred, pred_strd, trans_size, u1_luma_pred_mode);
 1003|  8.93M|                    }
 1004|  7.89M|                    else
 1005|  7.89M|                    {
 1006|       |                        /* In case of yuv420sp_vu, prediction happens as usual.         */
 1007|       |                        /* So point the pu1_pred pointer to original prediction pointer */
 1008|  7.89M|                        UWORD8 *pu1_pred_orig = pu1_pred - chroma_yuv420sp_vu_u_offset;
 1009|       |
 1010|       |                        /*    Top-Left | Top-Right | Top | Left | Bottom-Left
 1011|       |                         *      1         4         4     4         4
 1012|       |                         *
 1013|       |                         * Generating chroma_nbr_flags depending upon the transform size */
 1014|  7.89M|                        if(ps_tu->b3_size == 0)
  ------------------
  |  Branch (1014:28): [True: 339k, False: 7.55M]
  ------------------
 1015|   339k|                        {
 1016|       |                            /* Take TL,T,L flags of First luma 4x4 block */
 1017|   339k|                            chroma_nbr_flags = (luma_nbr_flags_4x4[0] & 0x10FF0);
 1018|       |                            /* Take TR flags of Second luma 4x4 block */
 1019|   339k|                            chroma_nbr_flags |= (luma_nbr_flags_4x4[1] & 0x0F000);
 1020|       |                            /* Take BL flags of Third luma 4x4 block */
 1021|   339k|                            chroma_nbr_flags |= (luma_nbr_flags_4x4[2] & 0x0000F);
 1022|   339k|                        }
 1023|       |
 1024|       |                        /* Initializing nbr pointers */
 1025|  7.89M|                        pu1_top = pu1_pred_orig - pic_strd;
 1026|  7.89M|                        pu1_left = pu1_pred_orig - 2;
 1027|  7.89M|                        pu1_top_left = pu1_pred_orig - pic_strd - 2;
 1028|       |
 1029|       |                        /* Chroma pred  mode derivation from luma pred mode */
 1030|  7.89M|                        {
 1031|  7.89M|                            tu_t *ps_tu_tmp = ps_tu;
 1032|  21.1M|                            while(!ps_tu_tmp->b1_first_tu_in_cu)
  ------------------
  |  Branch (1032:35): [True: 13.2M, False: 7.89M]
  ------------------
 1033|  13.2M|                            {
 1034|  13.2M|                                ps_tu_tmp--;
 1035|  13.2M|                            }
 1036|  7.89M|                            u1_luma_pred_mode_first_tu = ps_tu_tmp->b6_luma_intra_mode;
 1037|  7.89M|                        }
 1038|  7.89M|                        if(4 == u1_chroma_pred_mode)
  ------------------
  |  Branch (1038:28): [True: 7.06M, False: 830k]
  ------------------
 1039|  7.06M|                            u1_chroma_pred_mode = u1_luma_pred_mode_first_tu;
 1040|   830k|                        else
 1041|   830k|                        {
 1042|   830k|                            u1_chroma_pred_mode = gau1_intra_pred_chroma_modes[u1_chroma_pred_mode];
 1043|       |
 1044|   830k|                            if(u1_chroma_pred_mode ==
  ------------------
  |  Branch (1044:32): [True: 182k, False: 648k]
  ------------------
 1045|   830k|                                                            u1_luma_pred_mode_first_tu)
 1046|   182k|                            {
 1047|   182k|                                u1_chroma_pred_mode = INTRA_ANGULAR(34);
  ------------------
  |  |  507|   182k|#define INTRA_ANGULAR(x) (x)
  ------------------
 1048|   182k|                            }
 1049|   830k|                        }
 1050|       |
 1051|       |                        /* call the chroma reference array substitution */
 1052|  7.89M|                        ps_codec->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr(
 1053|  7.89M|                                        pu1_top_left,
 1054|  7.89M|                                        pu1_top, pu1_left, pic_strd, trans_size, chroma_nbr_flags, pu1_ref_sub_out, 1);
 1055|       |
 1056|       |                        /* use the look up to get the function idx */
 1057|  7.89M|                        chroma_pred_func_idx =
 1058|  7.89M|                                        g_i4_ip_funcs[u1_chroma_pred_mode];
 1059|       |
 1060|       |                        /* call the intra prediction function */
 1061|  7.89M|                        ps_codec->apf_intra_pred_chroma[chroma_pred_func_idx](pu1_ref_sub_out, 1, pu1_pred_orig, pred_strd, trans_size, u1_chroma_pred_mode);
 1062|  7.89M|                    }
 1063|  16.8M|                }
 1064|       |
 1065|       |                /* Updating number of transform types */
 1066|   110M|                STATS_UPDATE_ALL_TRANS(e_trans_type, c_idx);
  ------------------
  |  |  138|   110M|#define STATS_UPDATE_ALL_TRANS(e_trans_type, c_idx) ;
  ------------------
 1067|       |
 1068|       |                /* IQ, IT and Recon for Y if c_idx == 0, and U if c_idx !=0 */
 1069|   110M|                if(1 == u1_cbf)
  ------------------
  |  Branch (1069:20): [True: 6.61M, False: 103M]
  ------------------
 1070|  6.61M|                {
 1071|  6.61M|                    if(ps_tu->b1_transquant_bypass || transform_skip_flag)
  ------------------
  |  Branch (1071:24): [True: 26.0k, False: 6.58M]
  |  Branch (1071:55): [True: 279k, False: 6.30M]
  ------------------
 1072|   306k|                    {
 1073|       |                        /* Recon */
 1074|   306k|                        ps_codec->apf_recon[func_idx](pi2_src, pu1_pred, pu1_dst,
 1075|   306k|                                                      src_strd, pred_strd, dst_strd,
 1076|   306k|                                                      zero_cols);
 1077|   306k|                    }
 1078|  6.30M|                    else
 1079|  6.30M|                    {
 1080|       |
 1081|       |                        /* Updating coded number of transform types(excluding trans skip and trans quant skip) */
 1082|  6.30M|                        STATS_UPDATE_CODED_TRANS(e_trans_type, c_idx, 0);
  ------------------
  |  |  139|  6.30M|#define STATS_UPDATE_CODED_TRANS(e_trans_type, c_idx, update_type) ;
  ------------------
 1083|       |
 1084|       |                        /* iQuant , iTrans and Recon */
 1085|  6.30M|                        if((0 == coeff_type))
  ------------------
  |  Branch (1085:28): [True: 4.47M, False: 1.83M]
  ------------------
 1086|  4.47M|                        {
 1087|  4.47M|                            ps_codec->apf_itrans_recon[func_idx](pi2_src, pi2_tmp,
 1088|  4.47M|                                                                 pu1_pred, pu1_dst,
 1089|  4.47M|                                                                 src_strd, pred_strd,
 1090|  4.47M|                                                                 dst_strd, zero_cols,
 1091|  4.47M|                                                                 zero_rows);
 1092|  4.47M|                        }
 1093|  1.83M|                        else /* DC only */
 1094|  1.83M|                        {
 1095|  1.83M|                            STATS_UPDATE_CODED_TRANS(e_trans_type, c_idx, 1);
  ------------------
  |  |  139|  1.83M|#define STATS_UPDATE_CODED_TRANS(e_trans_type, c_idx, update_type) ;
  ------------------
 1096|  1.83M|                            ps_codec->apf_itrans_recon_dc[c_idx](pu1_pred, pu1_dst,
 1097|  1.83M|                                                                 pred_strd, dst_strd,
 1098|  1.83M|                                                                 log2_trans_size,
 1099|  1.83M|                                                                 i2_coeff_value);
 1100|  1.83M|                        }
 1101|  6.30M|                    }
 1102|  6.61M|                }
 1103|       |                /* IQ, IT and Recon for V */
 1104|   110M|                if(c_idx != 0)
  ------------------
  |  Branch (1104:20): [True: 8.03M, False: 102M]
  ------------------
 1105|  8.03M|                {
 1106|  8.03M|                    if(1 == u1_cbf_v)
  ------------------
  |  Branch (1106:24): [True: 1.19M, False: 6.83M]
  ------------------
 1107|  1.19M|                    {
 1108|  1.19M|                        if(ps_tu->b1_transquant_bypass || transform_skip_flag_v)
  ------------------
  |  Branch (1108:28): [True: 3.97k, False: 1.19M]
  |  Branch (1108:59): [True: 116k, False: 1.07M]
  ------------------
 1109|   120k|                        {
 1110|       |                            /* Recon */
 1111|   120k|                            ps_codec->apf_recon[func_idx](pi2_src_v, pu1_pred_v,
 1112|   120k|                                                          pu1_dst_v, src_strd,
 1113|   120k|                                                          pred_strd, dst_strd,
 1114|   120k|                                                          zero_cols_v);
 1115|   120k|                        }
 1116|  1.07M|                        else
 1117|  1.07M|                        {
 1118|       |                            /* Updating number of transform types */
 1119|  1.07M|                            STATS_UPDATE_CODED_TRANS(e_trans_type, c_idx, 0);
  ------------------
  |  |  139|  1.07M|#define STATS_UPDATE_CODED_TRANS(e_trans_type, c_idx, update_type) ;
  ------------------
 1120|       |
 1121|       |                            /* iQuant , iTrans and Recon */
 1122|  1.07M|                            if((0 == coeff_type_v))
  ------------------
  |  Branch (1122:32): [True: 545k, False: 533k]
  ------------------
 1123|   545k|                            {
 1124|   545k|                                ps_codec->apf_itrans_recon[func_idx](pi2_src_v,
 1125|   545k|                                                                     pi2_tmp,
 1126|   545k|                                                                     pu1_pred_v,
 1127|   545k|                                                                     pu1_dst_v,
 1128|   545k|                                                                     src_strd,
 1129|   545k|                                                                     pred_strd,
 1130|   545k|                                                                     dst_strd,
 1131|   545k|                                                                     zero_cols_v,
 1132|   545k|                                                                     zero_rows_v);
 1133|   545k|                            }
 1134|   533k|                            else  /* DC only */
 1135|   533k|                            {
 1136|   533k|                                STATS_UPDATE_CODED_TRANS(e_trans_type, c_idx, 1);
  ------------------
  |  |  139|   533k|#define STATS_UPDATE_CODED_TRANS(e_trans_type, c_idx, update_type) ;
  ------------------
 1137|   533k|                                ps_codec->apf_itrans_recon_dc[c_idx](pu1_pred_v, pu1_dst_v,
 1138|   533k|                                                                     pred_strd, dst_strd,
 1139|   533k|                                                                     log2_trans_size,
 1140|   533k|                                                                     i2_coeff_value_v);
 1141|   533k|                            }
 1142|  1.07M|                        }
 1143|  1.19M|                    }
 1144|  8.03M|                }
 1145|   110M|            }
 1146|       |
 1147|       |            /* Neighbor availability inside CTB */
 1148|       |            /* 1bit per 4x4. Indicates whether that 4x4 block has been reconstructed(avialable) */
 1149|       |            /* Used for neighbor availability in intra pred */
 1150|   110M|            if(c_idx == 0)
  ------------------
  |  Branch (1150:16): [True: 102M, False: 7.77M]
  ------------------
 1151|   102M|            {
 1152|   102M|                WORD32 i;
 1153|   102M|                WORD32 trans_in_min_tu;
 1154|   102M|                UWORD32 cur_tu_in_bits;
 1155|   102M|                UWORD32 cur_tu_avail_flag;
 1156|       |
 1157|   102M|                trans_in_min_tu = trans_size / MIN_TU_SIZE;
  ------------------
  |  |  348|   102M|#define MIN_TU_SIZE         4
  ------------------
 1158|   102M|                cur_tu_in_bits = (1 << trans_in_min_tu) - 1;
 1159|   102M|                cur_tu_in_bits = cur_tu_in_bits << (32 - trans_in_min_tu);
 1160|       |
 1161|   102M|                cur_tu_avail_flag = cur_tu_in_bits >> (ps_tu->b4_pos_x + 1);
 1162|       |
 1163|   329M|                for(i = 0; i < trans_in_min_tu; i++)
  ------------------
  |  Branch (1163:28): [True: 227M, False: 102M]
  ------------------
 1164|   227M|                    au4_intra_nbr_avail[1 + ps_tu->b4_pos_y + i] |=
 1165|   227M|                                    cur_tu_avail_flag;
 1166|   102M|            }
 1167|   110M|        }
 1168|   102M|    }
 1169|  7.49M|    ps_proc->pv_tu_coeff_data = pu1_tu_coeff_data;
 1170|       |
 1171|  7.49M|    return ps_proc->i4_ctb_tu_cnt;
 1172|  7.49M|}

ihevcd_itrans_recon_dc_luma:
   92|  1.22M|{
   93|  1.22M|    WORD32 row, col;
   94|  1.22M|    WORD32 add, shift;
   95|  1.22M|    WORD32 dc_value, quant_out;
   96|  1.22M|    WORD32 trans_size;
   97|       |
   98|  1.22M|    trans_size = (1 << log2_trans_size);
   99|       |
  100|  1.22M|    quant_out = i2_coeff_value;
  101|       |
  102|  1.22M|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|  1.22M|#define IT_SHIFT_STAGE_1 7
  ------------------
  103|  1.22M|    add = 1 << (shift - 1);
  104|  1.22M|    dc_value = CLIP_S16((quant_out * 64 + 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  105|  1.22M|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|  1.22M|#define IT_SHIFT_STAGE_2 12
  ------------------
  106|  1.22M|    add = 1 << (shift - 1);
  107|  1.22M|    dc_value = CLIP_S16((dc_value * 64 + 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  108|       |
  109|  20.7M|    for(row = 0; row < trans_size; row++)
  ------------------
  |  Branch (109:18): [True: 19.5M, False: 1.22M]
  ------------------
  110|   381M|        for(col = 0; col < trans_size; col++)
  ------------------
  |  Branch (110:22): [True: 361M, False: 19.5M]
  ------------------
  111|   361M|            pu1_dst[row * dst_strd + col] = CLIP_U8((pu1_pred[row * pred_strd + col] + dc_value));
  ------------------
  |  |   40|   361M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|   361M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 133M, False: 227M]
  |  |  |  |  |  Branch (40:53): [True: 4.71M, False: 223M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  112|       |
  113|  1.22M|}
ihevcd_itrans_recon_dc_chroma:
  122|   926k|{
  123|   926k|    WORD32 row, col;
  124|   926k|    WORD32 add, shift;
  125|   926k|    WORD32 dc_value, quant_out;
  126|   926k|    WORD32 trans_size;
  127|       |
  128|       |
  129|   926k|    trans_size = (1 << log2_trans_size);
  130|       |
  131|   926k|    quant_out = i2_coeff_value;
  132|       |
  133|   926k|    shift = IT_SHIFT_STAGE_1;
  ------------------
  |  |  425|   926k|#define IT_SHIFT_STAGE_1 7
  ------------------
  134|   926k|    add = 1 << (shift - 1);
  135|   926k|    dc_value = CLIP_S16((quant_out * 64 + add) >> shift);
  ------------------
  |  |   53|   926k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   926k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 926k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 926k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  136|   926k|    shift = IT_SHIFT_STAGE_2;
  ------------------
  |  |  426|   926k|#define IT_SHIFT_STAGE_2 12
  ------------------
  137|   926k|    add = 1 << (shift - 1);
  138|   926k|    dc_value = CLIP_S16((dc_value * 64 + add) >> shift);
  ------------------
  |  |   53|   926k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   926k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 0, False: 926k]
  |  |  |  |  |  Branch (40:53): [True: 0, False: 926k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|       |
  140|  9.41M|    for(row = 0; row < trans_size; row++)
  ------------------
  |  Branch (140:18): [True: 8.48M, False: 926k]
  ------------------
  141|   102M|        for(col = 0; col < trans_size; col++)
  ------------------
  |  Branch (141:22): [True: 94.3M, False: 8.48M]
  ------------------
  142|  94.3M|            pu1_dst[row * dst_strd + (col << 1)] = CLIP_U8((pu1_pred[row * pred_strd + (col << 1)] + dc_value));
  ------------------
  |  |   40|  94.3M|#define CLIP_U8(x) CLIP3((x), 0,     255);
  |  |  ------------------
  |  |  |  |   40|  94.3M|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 20.6M, False: 73.6M]
  |  |  |  |  |  Branch (40:53): [True: 236k, False: 73.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  143|       |
  144|   926k|}

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

ihevcd_compare_pu_t:
   95|   420k|{
   96|   420k|    WORD32 l0_match = 0, l1_match = 0;
   97|   420k|    pu_mv_t *ps_mv_1, *ps_mv_2;
   98|   420k|    WORD32 pred_mode_1, pred_mode_2;
   99|       |
  100|   420k|    ps_mv_1 = &ps_pu_1->mv;
  101|   420k|    ps_mv_2 = &ps_pu_2->mv;
  102|       |
  103|   420k|    pred_mode_1 = ps_pu_1->b2_pred_mode;
  104|   420k|    pred_mode_2 = ps_pu_2->b2_pred_mode;
  105|       |
  106|   420k|    if(pred_mode_1 == pred_mode_2)
  ------------------
  |  Branch (106:8): [True: 277k, False: 143k]
  ------------------
  107|   277k|    {
  108|   277k|        if(pred_mode_1 != PRED_L1)
  ------------------
  |  Branch (108:12): [True: 233k, False: 43.3k]
  ------------------
  109|   233k|        {
  110|   233k|            if(ps_mv_1->i1_l0_ref_idx == ps_mv_2->i1_l0_ref_idx)
  ------------------
  |  Branch (110:16): [True: 210k, False: 23.0k]
  ------------------
  111|   210k|            {
  112|   210k|                if(0 == memcmp(&ps_mv_1->s_l0_mv, &ps_mv_2->s_l0_mv, sizeof(mv_t)))
  ------------------
  |  Branch (112:20): [True: 156k, False: 54.1k]
  ------------------
  113|   156k|                {
  114|   156k|                    l0_match = 1;
  115|   156k|                }
  116|   210k|            }
  117|   233k|        }
  118|   277k|        if(pred_mode_1 != PRED_L0)
  ------------------
  |  Branch (118:12): [True: 165k, False: 111k]
  ------------------
  119|   165k|        {
  120|   165k|            if(ps_mv_1->i1_l1_ref_idx == ps_mv_2->i1_l1_ref_idx)
  ------------------
  |  Branch (120:16): [True: 149k, False: 15.1k]
  ------------------
  121|   149k|            {
  122|   149k|                if(0 == memcmp(&ps_mv_1->s_l1_mv, &ps_mv_2->s_l1_mv, sizeof(mv_t)))
  ------------------
  |  Branch (122:20): [True: 128k, False: 21.6k]
  ------------------
  123|   128k|                {
  124|   128k|                    l1_match = 1;
  125|   128k|                }
  126|   149k|            }
  127|   165k|        }
  128|   277k|        if(pred_mode_1 == PRED_BI)
  ------------------
  |  Branch (128:12): [True: 121k, False: 155k]
  ------------------
  129|   121k|            return (l1_match && l0_match);
  ------------------
  |  Branch (129:21): [True: 98.8k, False: 22.7k]
  |  Branch (129:33): [True: 82.8k, False: 16.0k]
  ------------------
  130|   155k|        else if(pred_mode_1 == PRED_L0)
  ------------------
  |  Branch (130:17): [True: 112k, False: 43.3k]
  ------------------
  131|   112k|            return l0_match;
  132|  43.3k|        else
  133|  43.3k|            return l1_match;
  134|   277k|    }
  135|       |
  136|   143k|    return 0;
  137|   420k|}
ihevcd_collocated_mvp:
  146|   210k|{
  147|   210k|    sps_t *ps_sps = ps_mv_ctxt->ps_sps;
  148|   210k|    slice_header_t *ps_slice_hdr = ps_mv_ctxt->ps_slice_hdr;
  149|   210k|    ref_list_t *ps_ref_list[2];
  150|   210k|    mv_buf_t *ps_mv_buf_col;
  151|   210k|    WORD32 xp_col, yp_col;
  152|   210k|    WORD32 col_ctb_x, col_ctb_y;
  153|   210k|    mv_t as_mv_col[2];
  154|   210k|    WORD32 log2_ctb_size;
  155|   210k|    WORD32 ctb_size;
  156|   210k|    WORD32 avail_col;
  157|   210k|    WORD32 col_ctb_idx, pu_cnt;
  158|   210k|    WORD32 au4_list_col[2];
  159|   210k|    WORD32 num_minpu_in_ctb;
  160|   210k|    UWORD8 *pu1_pic_pu_map_ctb;
  161|   210k|    pu_t *ps_col_pu;
  162|   210k|    WORD32 part_pos_y;
  163|       |
  164|       |
  165|   210k|    part_pos_y = ps_pu->b4_pos_y << 2;
  166|       |
  167|   210k|    log2_ctb_size = ps_sps->i1_log2_ctb_size;
  168|   210k|    ctb_size = (1 << log2_ctb_size);
  169|       |
  170|   210k|    avail_col = 1;
  171|       |
  172|       |    /* Initializing reference list */
  173|   210k|    ps_ref_list[0] = ps_slice_hdr->as_ref_pic_list0;
  174|   210k|    ps_ref_list[1] = ps_slice_hdr->as_ref_pic_list1;
  175|   210k|    if(PSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (175:8): [True: 5.63k, False: 205k]
  ------------------
  176|  5.63k|        ps_ref_list[1] = ps_slice_hdr->as_ref_pic_list0;
  177|       |
  178|   210k|    if((ps_slice_hdr->i1_slice_type == BSLICE) && (ps_slice_hdr->i1_collocated_from_l0_flag == 0))
  ------------------
  |  Branch (178:8): [True: 205k, False: 5.63k]
  |  Branch (178:51): [True: 129k, False: 75.0k]
  ------------------
  179|   129k|    {
  180|       |        /* L1 */
  181|   129k|        ps_mv_buf_col = (mv_buf_t *)ps_ref_list[1][ps_slice_hdr->i1_collocated_ref_idx].pv_mv_buf;
  182|       |
  183|   129k|    }
  184|  80.7k|    else
  185|  80.7k|    {
  186|       |        /* L0 */
  187|  80.7k|        ps_mv_buf_col = (mv_buf_t *)ps_ref_list[0][ps_slice_hdr->i1_collocated_ref_idx].pv_mv_buf;
  188|       |
  189|  80.7k|    }
  190|   210k|    num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  357|   210k|#define MIN_PU_SIZE         4
  ------------------
                  num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  357|   210k|#define MIN_PU_SIZE         4
  ------------------
  191|       |
  192|   210k|    if(((part_pos_y >> log2_ctb_size) == (y_col >> log2_ctb_size))
  ------------------
  |  Branch (192:8): [True: 184k, False: 26.2k]
  ------------------
  193|   210k|                    && ((x_col + (ps_mv_ctxt->i4_ctb_x << log2_ctb_size)) < ps_sps->i2_pic_width_in_luma_samples)
  ------------------
  |  Branch (193:24): [True: 181k, False: 3.17k]
  ------------------
  194|   210k|                    && (((y_col + (ps_mv_ctxt->i4_ctb_y << log2_ctb_size))
  ------------------
  |  Branch (194:24): [True: 173k, False: 7.60k]
  ------------------
  195|   181k|                                    < ps_sps->i2_pic_height_in_luma_samples)))
  196|   173k|    {
  197|   173k|        xp_col = ((x_col >> 4) << 4);
  198|   173k|        yp_col = ((y_col >> 4) << 4);
  199|   173k|        col_ctb_x = ps_mv_ctxt->i4_ctb_x + (xp_col >> log2_ctb_size);
  200|   173k|        col_ctb_y = ps_mv_ctxt->i4_ctb_y + (yp_col >> log2_ctb_size);
  201|   173k|        col_ctb_idx = col_ctb_x + (col_ctb_y)*(ps_sps->i2_pic_wd_in_ctb);
  202|   173k|        pu_cnt = ps_mv_buf_col->pu4_pic_pu_idx[col_ctb_idx];
  203|   173k|        pu1_pic_pu_map_ctb = ps_mv_buf_col->pu1_pic_pu_map
  204|   173k|                        + col_ctb_idx * num_minpu_in_ctb;
  205|   173k|        if(xp_col == ctb_size)
  ------------------
  |  Branch (205:12): [True: 17.8k, False: 155k]
  ------------------
  206|  17.8k|            xp_col = 0;
  207|   173k|        pu_cnt += pu1_pic_pu_map_ctb[(yp_col >> 2)
  208|   173k|                        * (ctb_size / MIN_PU_SIZE) + (xp_col >> 2)];
  ------------------
  |  |  357|   173k|#define MIN_PU_SIZE         4
  ------------------
  209|   173k|        ps_col_pu = &ps_mv_buf_col->ps_pic_pu[pu_cnt];
  210|   173k|    }
  211|  36.9k|    else
  212|  36.9k|        avail_col = 0;
  213|       |
  214|   210k|    if((avail_col == 0) || (ps_col_pu->b1_intra_flag == 1)
  ------------------
  |  Branch (214:8): [True: 36.9k, False: 173k]
  |  Branch (214:28): [True: 43.4k, False: 130k]
  ------------------
  215|   210k|                    || (ps_slice_hdr->i1_slice_temporal_mvp_enable_flag == 0))
  ------------------
  |  Branch (215:24): [True: 23.2k, False: 107k]
  ------------------
  216|   103k|    {
  217|   103k|        pu4_avail_col_flag[0] = 0;
  218|   103k|        pu4_avail_col_flag[1] = 0;
  219|   103k|        ps_mv_col[0].i2_mvx = 0;
  220|   103k|        ps_mv_col[0].i2_mvy = 0;
  221|   103k|        ps_mv_col[1].i2_mvx = 0;
  222|   103k|        ps_mv_col[1].i2_mvy = 0;
  223|   103k|    }
  224|   106k|    else
  225|   106k|    {
  226|   106k|        WORD32 au4_ref_idx_col[2];
  227|   106k|        WORD32 pred_flag_l0, pred_flag_l1;
  228|   106k|        pred_flag_l0 = (ps_col_pu->b2_pred_mode != PRED_L1);
  229|   106k|        pred_flag_l1 = (ps_col_pu->b2_pred_mode != PRED_L0);
  230|       |
  231|   106k|        if(pred_flag_l0 == 0)
  ------------------
  |  Branch (231:12): [True: 5.53k, False: 101k]
  ------------------
  232|  5.53k|        {
  233|  5.53k|            as_mv_col[0] = ps_col_pu->mv.s_l1_mv;
  234|  5.53k|            au4_ref_idx_col[0] = ps_col_pu->mv.i1_l1_ref_idx;
  235|  5.53k|            au4_list_col[0] = 1; /* L1 */
  236|       |
  237|  5.53k|            as_mv_col[1] = ps_col_pu->mv.s_l1_mv;
  238|  5.53k|            au4_ref_idx_col[1] = ps_col_pu->mv.i1_l1_ref_idx;
  239|  5.53k|            au4_list_col[1] = 1; /* L1 */
  240|  5.53k|        }
  241|   101k|        else
  242|   101k|        {
  243|   101k|            if(pred_flag_l1 == 0)
  ------------------
  |  Branch (243:16): [True: 67.4k, False: 34.0k]
  ------------------
  244|  67.4k|            {
  245|  67.4k|                as_mv_col[0] = ps_col_pu->mv.s_l0_mv;
  246|  67.4k|                au4_ref_idx_col[0] = ps_col_pu->mv.i1_l0_ref_idx;
  247|  67.4k|                au4_list_col[0] = 0; /* L1 */
  248|       |
  249|  67.4k|                as_mv_col[1] = ps_col_pu->mv.s_l0_mv;
  250|  67.4k|                au4_ref_idx_col[1] = ps_col_pu->mv.i1_l0_ref_idx;
  251|  67.4k|                au4_list_col[1] = 0; /* L1 */
  252|  67.4k|            }
  253|  34.0k|            else
  254|  34.0k|            {
  255|  34.0k|                if(1 == ps_slice_hdr->i1_low_delay_flag)
  ------------------
  |  Branch (255:20): [True: 13.4k, False: 20.5k]
  ------------------
  256|  13.4k|                {
  257|  13.4k|                    as_mv_col[0] = ps_col_pu->mv.s_l0_mv;
  258|  13.4k|                    au4_ref_idx_col[0] = ps_col_pu->mv.i1_l0_ref_idx;
  259|  13.4k|                    au4_list_col[0] = 0; /* L0 */
  260|       |
  261|  13.4k|                    as_mv_col[1] = ps_col_pu->mv.s_l1_mv;
  262|  13.4k|                    au4_ref_idx_col[1] = ps_col_pu->mv.i1_l1_ref_idx;
  263|  13.4k|                    au4_list_col[1] = 1; /* L1 */
  264|  13.4k|                }
  265|  20.5k|                else
  266|  20.5k|                {
  267|  20.5k|                    if(0 == ps_slice_hdr->i1_collocated_from_l0_flag)
  ------------------
  |  Branch (267:24): [True: 18.0k, False: 2.45k]
  ------------------
  268|  18.0k|                    {
  269|  18.0k|                        as_mv_col[0] = ps_col_pu->mv.s_l0_mv;
  270|  18.0k|                        au4_ref_idx_col[0] = ps_col_pu->mv.i1_l0_ref_idx;
  271|       |
  272|  18.0k|                        as_mv_col[1] = ps_col_pu->mv.s_l0_mv;
  273|  18.0k|                        au4_ref_idx_col[1] = ps_col_pu->mv.i1_l0_ref_idx;
  274|  18.0k|                    }
  275|  2.45k|                    else
  276|  2.45k|                    {
  277|  2.45k|                        as_mv_col[0] = ps_col_pu->mv.s_l1_mv;
  278|  2.45k|                        au4_ref_idx_col[0] = ps_col_pu->mv.i1_l1_ref_idx;
  279|       |
  280|  2.45k|                        as_mv_col[1] = ps_col_pu->mv.s_l1_mv;
  281|  2.45k|                        au4_ref_idx_col[1] = ps_col_pu->mv.i1_l1_ref_idx;
  282|  2.45k|                    }
  283|       |
  284|  20.5k|                    au4_list_col[0] = ps_slice_hdr->i1_collocated_from_l0_flag; /* L"collocated_from_l0_flag" */
  285|  20.5k|                    au4_list_col[1] = ps_slice_hdr->i1_collocated_from_l0_flag; /* L"collocated_from_l0_flag" */
  286|  20.5k|                }
  287|  34.0k|            }
  288|   101k|        }
  289|   106k|        avail_col = 1;
  290|   106k|        {
  291|   106k|            WORD32 cur_poc, col_poc, col_ref_poc_l0, cur_ref_poc;
  292|   106k|            WORD32 col_ref_poc_l0_lt, cur_ref_poc_lt;
  293|   106k|            WORD32 ref_idx_l0, ref_idx_l1;
  294|   106k|            WORD32 slice_idx;
  295|   106k|            pic_buf_t *ps_pic_buf;
  296|       |
  297|   106k|            if(use_pu_ref_idx)
  ------------------
  |  Branch (297:16): [True: 18.6k, False: 88.3k]
  ------------------
  298|  18.6k|            {
  299|  18.6k|                ref_idx_l0 = ps_pu->mv.i1_l0_ref_idx;
  300|  18.6k|                ref_idx_l1 = ps_pu->mv.i1_l1_ref_idx;
  301|  18.6k|            }
  302|  88.3k|            else
  303|  88.3k|            {
  304|  88.3k|                ref_idx_l0 = 0;
  305|  88.3k|                ref_idx_l1 = 0;
  306|  88.3k|            }
  307|       |
  308|   106k|            col_poc = ps_mv_buf_col->i4_abs_poc;
  309|   106k|            cur_poc = ps_slice_hdr->i4_abs_pic_order_cnt;
  310|       |
  311|   106k|            slice_idx = *(ps_mv_buf_col->pu1_pic_slice_map + col_ctb_x + col_ctb_y * ps_sps->i2_pic_wd_in_ctb);
  312|   106k|            slice_idx &= (MAX_SLICE_HDR_CNT - 1);
  ------------------
  |  |  153|   106k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|   106k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  313|   106k|            if(au4_list_col[0] == 0)
  ------------------
  |  Branch (313:16): [True: 98.9k, False: 7.98k]
  ------------------
  314|  98.9k|            {
  315|  98.9k|                col_ref_poc_l0 =
  316|  98.9k|                                ps_mv_buf_col->ai4_l0_collocated_poc[slice_idx][au4_ref_idx_col[0]];
  317|  98.9k|                col_ref_poc_l0_lt =
  318|  98.9k|                                (ps_mv_buf_col->ai1_l0_collocated_poc_lt[slice_idx][au4_ref_idx_col[0]] == LONG_TERM_REF);
  319|  98.9k|            }
  320|  7.98k|            else
  321|  7.98k|            {
  322|  7.98k|                col_ref_poc_l0 =
  323|  7.98k|                                ps_mv_buf_col->ai4_l1_collocated_poc[slice_idx][au4_ref_idx_col[0]];
  324|  7.98k|                col_ref_poc_l0_lt =
  325|  7.98k|                                (ps_mv_buf_col->ai1_l1_collocated_poc_lt[slice_idx][au4_ref_idx_col[0]] == LONG_TERM_REF);
  326|  7.98k|            }
  327|       |            /* L0 collocated mv */
  328|   106k|            ps_pic_buf = (pic_buf_t *)((ps_ref_list[0][ref_idx_l0].pv_pic_buf));
  329|   106k|            cur_ref_poc = ps_pic_buf->i4_abs_poc;
  330|   106k|            cur_ref_poc_lt = (ps_pic_buf->u1_used_as_ref == LONG_TERM_REF);
  331|       |
  332|   106k|            if(cur_ref_poc_lt == col_ref_poc_l0_lt)
  ------------------
  |  Branch (332:16): [True: 105k, False: 1.04k]
  ------------------
  333|   105k|            {
  334|   105k|                pu4_avail_col_flag[0] = 1;
  335|       |
  336|   105k|                if(cur_ref_poc_lt || ((col_poc - col_ref_poc_l0) == (cur_poc - cur_ref_poc)))
  ------------------
  |  Branch (336:20): [True: 382, False: 105k]
  |  Branch (336:38): [True: 15.0k, False: 90.5k]
  ------------------
  337|  15.3k|                {
  338|  15.3k|                    ps_mv_col[0] = as_mv_col[0];
  339|  15.3k|                }
  340|  90.5k|                else
  341|  90.5k|                {
  342|  90.5k|                    ps_mv_col[0] = as_mv_col[0];
  343|  90.5k|                    if(col_ref_poc_l0 != col_poc)
  ------------------
  |  Branch (343:24): [True: 60.6k, False: 29.8k]
  ------------------
  344|  60.6k|                        ihevcd_scale_collocated_mv((mv_t *)(&ps_mv_col[0]), cur_ref_poc,
  345|  60.6k|                                                   col_ref_poc_l0, col_poc, cur_poc);
  346|  90.5k|                }
  347|   105k|            }
  348|  1.04k|            else
  349|  1.04k|            {
  350|  1.04k|                pu4_avail_col_flag[0] = 0;
  351|  1.04k|                ps_mv_col[0].i2_mvx = 0;
  352|  1.04k|                ps_mv_col[0].i2_mvy = 0;
  353|  1.04k|            }
  354|   106k|            if((BSLICE == ps_slice_hdr->i1_slice_type))
  ------------------
  |  Branch (354:16): [True: 105k, False: 1.35k]
  ------------------
  355|   105k|            {
  356|   105k|                WORD32 col_ref_poc_l1_lt, col_ref_poc_l1;
  357|       |
  358|   105k|                if(au4_list_col[1] == 0)
  ------------------
  |  Branch (358:20): [True: 84.0k, False: 21.5k]
  ------------------
  359|  84.0k|                {
  360|  84.0k|                    col_ref_poc_l1 =
  361|  84.0k|                                    ps_mv_buf_col->ai4_l0_collocated_poc[slice_idx][au4_ref_idx_col[1]];
  362|  84.0k|                    col_ref_poc_l1_lt =
  363|  84.0k|                                    (ps_mv_buf_col->ai1_l0_collocated_poc_lt[slice_idx][au4_ref_idx_col[1]] == LONG_TERM_REF);
  364|  84.0k|                }
  365|  21.5k|                else
  366|  21.5k|                {
  367|  21.5k|                    col_ref_poc_l1 =
  368|  21.5k|                                    ps_mv_buf_col->ai4_l1_collocated_poc[slice_idx][au4_ref_idx_col[1]];
  369|  21.5k|                    col_ref_poc_l1_lt =
  370|  21.5k|                                    (ps_mv_buf_col->ai1_l1_collocated_poc_lt[slice_idx][au4_ref_idx_col[1]] == LONG_TERM_REF);
  371|  21.5k|                }
  372|       |
  373|       |                /* L1 collocated mv */
  374|   105k|                ps_pic_buf = (pic_buf_t *)((ps_ref_list[1][ref_idx_l1].pv_pic_buf));
  375|   105k|                cur_ref_poc = ps_pic_buf->i4_abs_poc;
  376|   105k|                cur_ref_poc_lt = (ps_pic_buf->u1_used_as_ref == LONG_TERM_REF);
  377|       |
  378|   105k|                if(cur_ref_poc_lt == col_ref_poc_l1_lt)
  ------------------
  |  Branch (378:20): [True: 104k, False: 934]
  ------------------
  379|   104k|                {
  380|   104k|                    pu4_avail_col_flag[1] = 1;
  381|       |
  382|   104k|                    if(cur_ref_poc_lt || ((col_poc - col_ref_poc_l1) == (cur_poc - cur_ref_poc)))
  ------------------
  |  Branch (382:24): [True: 18.4E, False: 104k]
  |  Branch (382:42): [True: 15.0k, False: 89.6k]
  ------------------
  383|  15.0k|                    {
  384|  15.0k|                        ps_mv_col[1] = as_mv_col[1];
  385|  15.0k|                    }
  386|  89.6k|                    else
  387|  89.6k|                    {
  388|  89.6k|                        ps_mv_col[1] = as_mv_col[1];
  389|  89.6k|                        if(col_ref_poc_l1 != col_poc)
  ------------------
  |  Branch (389:28): [True: 60.6k, False: 28.9k]
  ------------------
  390|  60.6k|                            ihevcd_scale_collocated_mv((mv_t *)&ps_mv_col[1], cur_ref_poc,
  391|  60.6k|                                                       col_ref_poc_l1, col_poc, cur_poc);
  392|  89.6k|                    }
  393|   104k|                }
  394|    934|                else
  395|    934|                {
  396|    934|                    pu4_avail_col_flag[1] = 0;
  397|    934|                    ps_mv_col[1].i2_mvx = 0;
  398|    934|                    ps_mv_col[1].i2_mvy = 0;
  399|    934|                }
  400|   105k|            }
  401|  1.35k|            else
  402|  1.35k|            {
  403|  1.35k|                pu4_avail_col_flag[1] = 0;
  404|  1.35k|            }
  405|   106k|        }
  406|   106k|    }
  407|   210k|}
ihevcd_mv_merge:
  479|  7.53M|{
  480|       |    /******************************************************/
  481|       |    /*      Spatial Merge Candidates                      */
  482|       |    /******************************************************/
  483|  7.53M|    slice_header_t *ps_slice_hdr;
  484|  7.53M|    pu_t as_pu_merge_list[MAX_NUM_MERGE_CAND];
  485|  7.53M|    pps_t *ps_pps;
  486|  7.53M|    ref_list_t *ps_ref_list[2];
  487|  7.53M|    WORD32 sum_avail_a0_a1_b0_b1 = 0; /*Sum of availability of A0, A1, B0, B1*/
  488|  7.53M|    WORD32 nbr_x, nbr_y;
  489|  7.53M|    WORD32 nbr_avail[MAX_NUM_MV_NBR];
  490|  7.53M|    WORD32 merge_shift;
  491|  7.53M|    WORD32 nbr_pu_idx;
  492|  7.53M|    pu_t *ps_nbr_pu[MAX_NUM_MV_NBR];
  493|  7.53M|    WORD32 max_num_merge_cand;
  494|  7.53M|    WORD32 candidate_cnt;
  495|  7.53M|    WORD32 pos_x_merge_shift, pos_y_merge_shift;
  496|       |
  497|  7.53M|    ps_slice_hdr = ps_mv_ctxt->ps_slice_hdr;
  498|  7.53M|    ps_pps = ps_mv_ctxt->ps_pps;
  499|       |    /* Initializing reference list */
  500|  7.53M|    ps_ref_list[0] = ps_slice_hdr->as_ref_pic_list0;
  501|  7.53M|    ps_ref_list[1] = ps_slice_hdr->as_ref_pic_list1;
  502|  7.53M|    if(PSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (502:8): [True: 262k, False: 7.27M]
  ------------------
  503|   262k|        ps_ref_list[1] = ps_slice_hdr->as_ref_pic_list0;
  504|       |
  505|  7.53M|    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|  7.53M|    merge_shift = ps_pps->i1_log2_parallel_merge_level;
  522|       |
  523|       |    /* Availability check */
  524|       |    /* A1 */
  525|  7.53M|    nbr_x = part_pos_x - 1;
  526|  7.53M|    nbr_y = part_pos_y + part_ht - 1; /* A1 */
  527|       |
  528|  7.53M|    nbr_pu_idx = *(pu4_left_pu_idx + ((nbr_y - part_pos_y) >> 2) * left_nbr_4x4_strd);
  529|  7.53M|    ps_nbr_pu[NBR_A1] = ps_mv_ctxt->ps_pic_pu + nbr_pu_idx;
  530|       |
  531|  7.53M|    nbr_avail[NBR_A1] = l_avail
  ------------------
  |  Branch (531:25): [True: 7.26M, False: 264k]
  ------------------
  532|  7.53M|                    && (!ps_nbr_pu[NBR_A1]->b1_intra_flag); /* A1 */
  ------------------
  |  Branch (532:24): [True: 7.25M, False: 9.75k]
  ------------------
  533|       |
  534|  7.53M|    pos_x_merge_shift = (part_pos_x >> merge_shift);
  535|  7.53M|    pos_y_merge_shift = (part_pos_y >> merge_shift);
  536|  7.53M|    max_num_merge_cand = ps_pu->b3_merge_idx + 1;
  537|       |
  538|  7.53M|    {
  539|  7.53M|        if(nbr_avail[NBR_A1])
  ------------------
  |  Branch (539:12): [True: 7.27M, False: 259k]
  ------------------
  540|  7.27M|        {
  541|       |            /* if at same merge level */
  542|  7.27M|            if(pos_x_merge_shift == (nbr_x >> merge_shift) &&
  ------------------
  |  Branch (542:16): [True: 28.5k, False: 7.24M]
  ------------------
  543|  7.27M|               (pos_y_merge_shift == (nbr_y >> merge_shift)))
  ------------------
  |  Branch (543:16): [True: 28.5k, False: 18.4E]
  ------------------
  544|  28.5k|            {
  545|  28.5k|                nbr_avail[NBR_A1] = 0;
  546|  28.5k|            }
  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|  7.24M|            else if((single_mcl_flag == 0) && (part_idx == 1) &&
  ------------------
  |  Branch (554:21): [True: 7.24M, False: 18.4E]
  |  Branch (554:47): [True: 110k, False: 7.13M]
  ------------------
  555|  7.24M|                            ((part_mode == PART_Nx2N) || (part_mode == PART_nLx2N) ||
  ------------------
  |  Branch (555:30): [True: 49.3k, False: 61.0k]
  |  Branch (555:58): [True: 15.2k, False: 45.8k]
  ------------------
  556|   110k|                                            (part_mode == PART_nRx2N)))
  ------------------
  |  Branch (556:45): [True: 2.99k, False: 42.8k]
  ------------------
  557|  67.5k|            {
  558|  67.5k|                nbr_avail[NBR_A1] = 0;
  559|  67.5k|            }
  560|  7.27M|            sum_avail_a0_a1_b0_b1 += nbr_avail[NBR_A1];
  561|  7.27M|            if(nbr_avail[NBR_A1])
  ------------------
  |  Branch (561:16): [True: 7.17M, False: 99.9k]
  ------------------
  562|  7.17M|            {
  563|  7.17M|                as_pu_merge_list[candidate_cnt] = *ps_nbr_pu[NBR_A1];
  564|  7.17M|                candidate_cnt++;
  565|  7.17M|                if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (565:20): [True: 7.07M, False: 104k]
  ------------------
  566|  7.07M|                {
  567|  7.07M|                    ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  568|  7.07M|                    ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  569|  7.07M|                    return;
  570|  7.07M|                }
  571|  7.17M|            }
  572|  7.27M|        }
  573|  7.53M|    }
  574|       |
  575|       |    /* B1 */
  576|   463k|    nbr_x = part_pos_x + part_wd - 1;
  577|   463k|    nbr_y = part_pos_y - 1;
  578|       |
  579|   463k|    nbr_pu_idx = *(pu4_top_pu_idx + ((nbr_x - part_pos_x) >> 2));
  580|   463k|    ps_nbr_pu[NBR_B1] = ps_mv_ctxt->ps_pic_pu + nbr_pu_idx;
  581|       |
  582|   463k|    nbr_avail[NBR_B1] = t_avail
  ------------------
  |  Branch (582:25): [True: 575k, False: 18.4E]
  ------------------
  583|   575k|                    && (!ps_nbr_pu[NBR_B1]->b1_intra_flag); /* B1 */
  ------------------
  |  Branch (583:24): [True: 570k, False: 4.58k]
  ------------------
  584|       |
  585|   463k|    {
  586|   463k|        WORD32 avail_flag;
  587|   463k|        avail_flag = nbr_avail[NBR_B1];
  588|       |
  589|   463k|        if(nbr_avail[NBR_B1])
  ------------------
  |  Branch (589:12): [True: 570k, False: 18.4E]
  ------------------
  590|   570k|        {
  591|       |            /* if at same merge level */
  592|   570k|            if(pos_x_merge_shift == (nbr_x >> merge_shift) &&
  ------------------
  |  Branch (592:16): [True: 84.6k, False: 485k]
  ------------------
  593|   570k|               (pos_y_merge_shift == (nbr_y >> merge_shift)))
  ------------------
  |  Branch (593:16): [True: 19.3k, False: 65.3k]
  ------------------
  594|  19.3k|            {
  595|  19.3k|                nbr_avail[NBR_B1] = 0;
  596|  19.3k|                avail_flag = 0;
  597|  19.3k|            }
  598|       |
  599|       |            /* if single MCL is 0 , second part of 2 part in CU */
  600|   551k|            else if((single_mcl_flag == 0) && (part_idx == 1) &&
  ------------------
  |  Branch (600:21): [True: 551k, False: 36]
  |  Branch (600:47): [True: 83.0k, False: 468k]
  ------------------
  601|   551k|                            ((part_mode == PART_2NxN) || (part_mode == PART_2NxnU) ||
  ------------------
  |  Branch (601:30): [True: 16.0k, False: 66.9k]
  |  Branch (601:58): [True: 1.01k, False: 65.9k]
  ------------------
  602|  83.0k|                                            (part_mode == PART_2NxnD)))
  ------------------
  |  Branch (602:45): [True: 1.02k, False: 64.9k]
  ------------------
  603|  18.1k|            {
  604|  18.1k|                nbr_avail[NBR_B1] = 0;
  605|  18.1k|                avail_flag = 0;
  606|  18.1k|            }
  607|       |
  608|   532k|            else if(nbr_avail[NBR_A1])
  ------------------
  |  Branch (608:21): [True: 160k, False: 372k]
  ------------------
  609|   160k|            {
  610|   160k|                avail_flag = !ihevcd_compare_pu_t(ps_nbr_pu[NBR_A1], ps_nbr_pu[NBR_B1]);
  611|   160k|            }
  612|       |
  613|   570k|            sum_avail_a0_a1_b0_b1 += avail_flag;
  614|   570k|            if(avail_flag)
  ------------------
  |  Branch (614:16): [True: 485k, False: 85.3k]
  ------------------
  615|   485k|            {
  616|   485k|                as_pu_merge_list[candidate_cnt] = *ps_nbr_pu[NBR_B1];
  617|   485k|                candidate_cnt++;
  618|   485k|                if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (618:20): [True: 414k, False: 70.4k]
  ------------------
  619|   414k|                {
  620|   414k|                    ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  621|   414k|                    ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  622|   414k|                    return;
  623|   414k|                }
  624|   485k|            }
  625|   570k|        }
  626|   463k|    }
  627|       |    /* B0 */
  628|  48.9k|    nbr_x = part_pos_x + part_wd;
  629|  48.9k|    nbr_y = part_pos_y - 1;
  630|       |
  631|  48.9k|    nbr_pu_idx = *(pu4_top_pu_idx + ((nbr_x - part_pos_x) >> 2));
  632|  48.9k|    ps_nbr_pu[NBR_B0] = ps_mv_ctxt->ps_pic_pu + nbr_pu_idx;
  633|       |
  634|  48.9k|    nbr_avail[NBR_B0] = tr_avail
  ------------------
  |  Branch (634:25): [True: 101k, False: 18.4E]
  ------------------
  635|   101k|                    && (!ps_nbr_pu[NBR_B0]->b1_intra_flag); /* B0 */
  ------------------
  |  Branch (635:24): [True: 98.6k, False: 2.43k]
  ------------------
  636|       |
  637|  48.9k|    {
  638|  48.9k|        WORD32 avail_flag;
  639|  48.9k|        avail_flag = nbr_avail[NBR_B0];
  640|       |
  641|       |        /* if at same merge level */
  642|  48.9k|        if(nbr_avail[NBR_B0])
  ------------------
  |  Branch (642:12): [True: 98.6k, False: 18.4E]
  ------------------
  643|  98.6k|        {
  644|  98.6k|            if(pos_x_merge_shift == (nbr_x >> merge_shift) &&
  ------------------
  |  Branch (644:16): [True: 11.5k, False: 87.1k]
  ------------------
  645|  98.6k|               (pos_y_merge_shift == (nbr_y >> merge_shift)))
  ------------------
  |  Branch (645:16): [True: 11.5k, False: 35]
  ------------------
  646|  11.5k|            {
  647|  11.5k|                nbr_avail[NBR_B0] = 0;
  648|  11.5k|                avail_flag = 0;
  649|  11.5k|            }
  650|  87.1k|            else if(nbr_avail[NBR_B1])
  ------------------
  |  Branch (650:21): [True: 83.9k, False: 3.23k]
  ------------------
  651|  83.9k|            {
  652|  83.9k|                avail_flag = !ihevcd_compare_pu_t(ps_nbr_pu[NBR_B1], ps_nbr_pu[NBR_B0]);
  653|  83.9k|            }
  654|       |
  655|  98.6k|            sum_avail_a0_a1_b0_b1 += avail_flag;
  656|  98.6k|            if(avail_flag)
  ------------------
  |  Branch (656:16): [True: 42.8k, False: 55.8k]
  ------------------
  657|  42.8k|            {
  658|  42.8k|                as_pu_merge_list[candidate_cnt] = *ps_nbr_pu[NBR_B0];
  659|  42.8k|                candidate_cnt++;
  660|  42.8k|                if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (660:20): [True: 24.5k, False: 18.2k]
  ------------------
  661|  24.5k|                {
  662|  24.5k|                    ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  663|  24.5k|                    ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  664|  24.5k|                    return;
  665|  24.5k|                }
  666|  42.8k|            }
  667|  98.6k|        }
  668|  48.9k|    }
  669|       |    /* A0 */
  670|  24.3k|    nbr_x = part_pos_x - 1;
  671|  24.3k|    nbr_y = part_pos_y + part_ht; /* A0 */
  672|       |
  673|  24.3k|    nbr_pu_idx = *(pu4_left_pu_idx + ((nbr_y - part_pos_y) >> 2) * left_nbr_4x4_strd);
  674|  24.3k|    ps_nbr_pu[NBR_A0] = ps_mv_ctxt->ps_pic_pu + nbr_pu_idx;
  675|       |
  676|  24.3k|    nbr_avail[NBR_A0] = lb_avail
  ------------------
  |  Branch (676:25): [True: 37.0k, False: 18.4E]
  ------------------
  677|  37.0k|                    && (!ps_nbr_pu[NBR_A0]->b1_intra_flag); /* A0 */
  ------------------
  |  Branch (677:24): [True: 35.6k, False: 1.35k]
  ------------------
  678|  24.3k|    {
  679|  24.3k|        WORD32 avail_flag;
  680|  24.3k|        avail_flag = nbr_avail[NBR_A0];
  681|       |
  682|  24.3k|        if(nbr_avail[NBR_A0])
  ------------------
  |  Branch (682:12): [True: 35.6k, False: 18.4E]
  ------------------
  683|  35.6k|        {
  684|       |            /* if at same merge level */
  685|  35.6k|            if(pos_x_merge_shift == (nbr_x >> merge_shift) &&
  ------------------
  |  Branch (685:16): [True: 236, False: 35.4k]
  ------------------
  686|  35.6k|                            (pos_y_merge_shift == (nbr_y >> merge_shift)))
  ------------------
  |  Branch (686:29): [True: 236, False: 0]
  ------------------
  687|    236|            {
  688|    236|                nbr_avail[NBR_A0] = 0;
  689|    236|                avail_flag = 0;
  690|    236|            }
  691|  35.4k|            else if(nbr_avail[NBR_A1])
  ------------------
  |  Branch (691:21): [True: 34.8k, False: 570]
  ------------------
  692|  34.8k|            {
  693|  34.8k|                avail_flag = !ihevcd_compare_pu_t(ps_nbr_pu[NBR_A1], ps_nbr_pu[NBR_A0]);
  694|  34.8k|            }
  695|       |
  696|  35.6k|            sum_avail_a0_a1_b0_b1 += avail_flag;
  697|  35.6k|            if(avail_flag)
  ------------------
  |  Branch (697:16): [True: 15.4k, False: 20.2k]
  ------------------
  698|  15.4k|            {
  699|  15.4k|                as_pu_merge_list[candidate_cnt] = *ps_nbr_pu[NBR_A0];
  700|  15.4k|                candidate_cnt++;
  701|  15.4k|                if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (701:20): [True: 8.96k, False: 6.43k]
  ------------------
  702|  8.96k|                {
  703|  8.96k|                    ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  704|  8.96k|                    ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  705|  8.96k|                    return;
  706|  8.96k|                }
  707|  15.4k|            }
  708|  35.6k|        }
  709|  24.3k|    }
  710|       |    /* B2 */
  711|       |
  712|  15.3k|    nbr_x = part_pos_x - 1;
  713|  15.3k|    nbr_y = part_pos_y - 1; /* B2 */
  714|       |
  715|  15.3k|    nbr_pu_idx = *(pu4_top_pu_idx + ((nbr_x - part_pos_x) >> 2));
  716|  15.3k|    ps_nbr_pu[NBR_B2] = ps_mv_ctxt->ps_pic_pu + nbr_pu_idx;
  717|       |
  718|  15.3k|    nbr_avail[NBR_B2] = tl_avail
  ------------------
  |  Branch (718:25): [True: 122k, False: 18.4E]
  ------------------
  719|   122k|                    && (!ps_nbr_pu[NBR_B2]->b1_intra_flag); /* B2 */
  ------------------
  |  Branch (719:24): [True: 119k, False: 3.62k]
  ------------------
  720|       |
  721|  15.3k|    {
  722|  15.3k|        WORD32 avail_flag;
  723|  15.3k|        avail_flag = nbr_avail[NBR_B2];
  724|       |
  725|  15.3k|        if(nbr_avail[NBR_B2])
  ------------------
  |  Branch (725:12): [True: 119k, False: 18.4E]
  ------------------
  726|   119k|        {
  727|       |            /* if at same merge level */
  728|   119k|            if(pos_x_merge_shift == (nbr_x >> merge_shift) &&
  ------------------
  |  Branch (728:16): [True: 15.8k, False: 103k]
  ------------------
  729|   119k|                            (pos_y_merge_shift == (nbr_y >> merge_shift)))
  ------------------
  |  Branch (729:29): [True: 15.8k, False: 38]
  ------------------
  730|  15.8k|            {
  731|  15.8k|                nbr_avail[NBR_B2] = 0;
  732|  15.8k|                avail_flag = 0;
  733|  15.8k|            }
  734|   103k|            else if(4 == sum_avail_a0_a1_b0_b1)
  ------------------
  |  Branch (734:21): [True: 978, False: 102k]
  ------------------
  735|    978|            {
  736|    978|                avail_flag = 0;
  737|    978|            }
  738|       |
  739|   102k|            else
  740|   102k|            {
  741|   102k|                if(nbr_avail[NBR_A1])
  ------------------
  |  Branch (741:20): [True: 89.3k, False: 12.9k]
  ------------------
  742|  89.3k|                {
  743|  89.3k|                    avail_flag = !ihevcd_compare_pu_t(ps_nbr_pu[NBR_A1], ps_nbr_pu[NBR_B2]);
  744|  89.3k|                }
  745|       |
  746|   102k|                if(avail_flag && nbr_avail[NBR_B1])
  ------------------
  |  Branch (746:20): [True: 57.4k, False: 44.8k]
  |  Branch (746:34): [True: 51.9k, False: 5.49k]
  ------------------
  747|  51.9k|                {
  748|  51.9k|                    avail_flag = !ihevcd_compare_pu_t(ps_nbr_pu[NBR_B1], ps_nbr_pu[NBR_B2]);
  749|  51.9k|                }
  750|   102k|            }
  751|       |
  752|   119k|            if(avail_flag)
  ------------------
  |  Branch (752:16): [True: 35.7k, False: 83.3k]
  ------------------
  753|  35.7k|            {
  754|  35.7k|                as_pu_merge_list[candidate_cnt] = *ps_nbr_pu[NBR_B2];
  755|  35.7k|                candidate_cnt++;
  756|  35.7k|                if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (756:20): [True: 20.8k, False: 14.8k]
  ------------------
  757|  20.8k|                {
  758|  20.8k|                    ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  759|  20.8k|                    ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  760|  20.8k|                    return;
  761|  20.8k|                }
  762|  35.7k|            }
  763|   119k|        }
  764|  15.3k|    }
  765|       |
  766|       |    /***********************************************************/
  767|       |    /*          Collocated MV prediction                       */
  768|       |    /***********************************************************/
  769|  18.4E|    {
  770|  18.4E|        mv_t as_mv_col[2];
  771|  18.4E|        WORD32 avail_col_flag[2] = { 0 }, x_col, y_col;
  772|  18.4E|        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|  18.4E|        x_col = part_pos_x + part_wd;
  777|  18.4E|        y_col = part_pos_y + part_ht;
  778|  18.4E|        ihevcd_collocated_mvp(ps_mv_ctxt, ps_pu, as_mv_col, avail_col_flag, 0, x_col, y_col);
  779|       |
  780|  18.4E|        avail_col_l0 = avail_col_flag[0];
  781|  18.4E|        avail_col_l1 = avail_col_flag[1];
  782|       |
  783|  18.4E|        if(avail_col_l0 || avail_col_l1)
  ------------------
  |  Branch (783:12): [True: 18.4E, False: 52.4k]
  |  Branch (783:28): [True: 18.4E, False: 52.4k]
  ------------------
  784|  64.3k|        {
  785|  64.3k|            as_pu_merge_list[candidate_cnt].mv.s_l0_mv = as_mv_col[0];
  786|  64.3k|            as_pu_merge_list[candidate_cnt].mv.s_l1_mv = as_mv_col[1];
  787|  64.3k|        }
  788|       |
  789|  18.4E|        if(avail_col_l0 == 0 || avail_col_l1 == 0)
  ------------------
  |  Branch (789:12): [True: 18.4E, False: 64.4k]
  |  Branch (789:33): [True: 377, False: 64.0k]
  ------------------
  790|  52.8k|        {
  791|       |            /* Checking Collocated MV availability at Center of PU */
  792|  52.8k|            x_col = part_pos_x + (part_wd >> 1);
  793|  52.8k|            y_col = part_pos_y + (part_ht >> 1);
  794|  52.8k|            ihevcd_collocated_mvp(ps_mv_ctxt, ps_pu, as_mv_col, avail_col_flag, 0, x_col, y_col);
  795|       |
  796|  52.8k|            if(avail_col_l0 == 0)
  ------------------
  |  Branch (796:16): [True: 52.4k, False: 369]
  ------------------
  797|  52.4k|            {
  798|  52.4k|                as_pu_merge_list[candidate_cnt].mv.s_l0_mv = as_mv_col[0];
  799|  52.4k|            }
  800|  52.8k|            if(avail_col_l1 == 0)
  ------------------
  |  Branch (800:16): [True: 52.8k, False: 18.4E]
  ------------------
  801|  52.8k|            {
  802|  52.8k|                as_pu_merge_list[candidate_cnt].mv.s_l1_mv = as_mv_col[1];
  803|  52.8k|            }
  804|       |
  805|  52.8k|            avail_col_l0 |= avail_col_flag[0];
  806|  52.8k|            avail_col_l1 |= avail_col_flag[1];
  807|  52.8k|        }
  808|       |
  809|  18.4E|        as_pu_merge_list[candidate_cnt].mv.i1_l0_ref_idx = 0;
  810|  18.4E|        as_pu_merge_list[candidate_cnt].mv.i1_l1_ref_idx = 0;
  811|  18.4E|        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: 86.9k, False: 18.4E]
  |  Branch (811:72): [True: 86.1k, False: 830]
  ------------------
  812|       |
  813|  18.4E|        candidate_cnt += (avail_col_l0 || avail_col_l1);
  ------------------
  |  Branch (813:27): [True: 18.4E, False: 29.9k]
  |  Branch (813:43): [True: 0, False: 29.9k]
  ------------------
  814|       |
  815|  18.4E|        if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (815:12): [True: 52.7k, False: 18.4E]
  ------------------
  816|  52.7k|        {
  817|  52.7k|            ps_pu[0].mv = as_pu_merge_list[candidate_cnt - 1].mv;
  818|  52.7k|            ps_pu[0].b2_pred_mode = as_pu_merge_list[candidate_cnt - 1].b2_pred_mode;
  819|  52.7k|            return;
  820|  52.7k|        }
  821|       |
  822|  18.4E|    }
  823|  18.4E|    {
  824|  18.4E|        WORD32 slice_type;
  825|       |
  826|  18.4E|        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|  18.4E|        if(slice_type == BSLICE)
  ------------------
  |  Branch (832:12): [True: 61.9k, False: 18.4E]
  ------------------
  833|  61.9k|        {
  834|  61.9k|            if((candidate_cnt > 1) && (candidate_cnt < MAX_NUM_MERGE_CAND))
  ------------------
  |  |  463|  39.5k|#define MAX_NUM_MERGE_CAND 5
  ------------------
  |  Branch (834:16): [True: 39.5k, False: 22.4k]
  |  Branch (834:39): [True: 39.5k, False: 18.4E]
  ------------------
  835|  39.5k|            {
  836|  39.5k|                WORD32 priority_list0[12] =
  837|  39.5k|                    { 0, 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3 };
  838|  39.5k|                WORD32 priority_list1[12] =
  839|  39.5k|                    { 1, 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2 };
  840|  39.5k|                WORD32 l0_cand, l1_cand;
  841|  39.5k|                WORD32 bi_pred_idx = 0;
  842|  39.5k|                WORD32 total_bi_pred_cand =
  843|  39.5k|                                candidate_cnt * (candidate_cnt - 1);
  844|       |
  845|   102k|                while(bi_pred_idx < total_bi_pred_cand)
  ------------------
  |  Branch (845:23): [True: 102k, False: 18.4E]
  ------------------
  846|   102k|                {
  847|   102k|                    l0_cand = priority_list0[bi_pred_idx];
  848|   102k|                    l1_cand = priority_list1[bi_pred_idx];
  849|       |
  850|   102k|                    if((as_pu_merge_list[l0_cand].b2_pred_mode != PRED_L1)
  ------------------
  |  Branch (850:24): [True: 92.1k, False: 10.2k]
  ------------------
  851|   102k|                                    && (as_pu_merge_list[l1_cand].b2_pred_mode
  ------------------
  |  Branch (851:40): [True: 62.2k, False: 29.8k]
  ------------------
  852|  92.1k|                                                    != PRED_L0))
  853|  62.2k|                    {
  854|  62.2k|                        WORD8 i1_l0_ref_idx, i1_l1_ref_idx;
  855|  62.2k|                        mv_t s_l0_mv, s_l1_mv;
  856|  62.2k|                        pic_buf_t *ps_pic_buf_l0, *ps_pic_buf_l1;
  857|       |
  858|  62.2k|                        i1_l0_ref_idx = as_pu_merge_list[l0_cand].mv.i1_l0_ref_idx;
  859|  62.2k|                        i1_l1_ref_idx = as_pu_merge_list[l1_cand].mv.i1_l1_ref_idx;
  860|  62.2k|                        ps_pic_buf_l0 = (pic_buf_t *)((ps_ref_list[0][i1_l0_ref_idx].pv_pic_buf));
  861|  62.2k|                        ps_pic_buf_l1 = (pic_buf_t *)((ps_ref_list[1][i1_l1_ref_idx].pv_pic_buf));
  862|  62.2k|                        s_l0_mv = as_pu_merge_list[l0_cand].mv.s_l0_mv;
  863|  62.2k|                        s_l1_mv = as_pu_merge_list[l1_cand].mv.s_l1_mv;
  864|       |
  865|  62.2k|                        if((ps_pic_buf_l0->i4_abs_poc != ps_pic_buf_l1->i4_abs_poc)
  ------------------
  |  Branch (865:28): [True: 13.3k, False: 48.9k]
  ------------------
  866|  62.2k|                                        || (s_l0_mv.i2_mvx != s_l1_mv.i2_mvx)
  ------------------
  |  Branch (866:44): [True: 17.0k, False: 31.8k]
  ------------------
  867|  62.2k|                                        || (s_l0_mv.i2_mvy != s_l1_mv.i2_mvy))
  ------------------
  |  Branch (867:44): [True: 4.53k, False: 27.3k]
  ------------------
  868|  34.9k|                        {
  869|  34.9k|                            candidate_cnt++;
  870|  34.9k|                            if(candidate_cnt == max_num_merge_cand)
  ------------------
  |  Branch (870:32): [True: 22.1k, False: 12.8k]
  ------------------
  871|  22.1k|                            {
  872|  22.1k|                                ps_pu[0].mv.s_l0_mv = s_l0_mv;
  873|  22.1k|                                ps_pu[0].mv.s_l1_mv = s_l1_mv;
  874|  22.1k|                                ps_pu[0].mv.i1_l0_ref_idx = i1_l0_ref_idx;
  875|  22.1k|                                ps_pu[0].mv.i1_l1_ref_idx = i1_l1_ref_idx;
  876|  22.1k|                                ps_pu[0].b2_pred_mode = PRED_BI;
  877|  22.1k|                                return;
  878|  22.1k|                            }
  879|  34.9k|                        }
  880|  62.2k|                    }
  881|       |
  882|  80.2k|                    bi_pred_idx++;
  883|       |
  884|  80.2k|                    if((bi_pred_idx == total_bi_pred_cand)
  ------------------
  |  Branch (884:24): [True: 17.4k, False: 62.7k]
  ------------------
  885|  80.2k|                                    || (candidate_cnt == MAX_NUM_MERGE_CAND))
  ------------------
  |  |  463|  62.7k|#define MAX_NUM_MERGE_CAND 5
  ------------------
  |  Branch (885:40): [True: 4, False: 62.7k]
  ------------------
  886|  17.4k|                    {
  887|  17.4k|                        break;
  888|  17.4k|                    }
  889|  80.2k|                }
  890|  39.5k|            }
  891|  61.9k|        }
  892|       |
  893|       |        /******************************************************/
  894|       |        /*      Zero merge candidates                         */
  895|       |        /******************************************************/
  896|       |//        if(candidate_cnt < max_num_merge_cand)
  897|  18.4E|        {
  898|  18.4E|            WORD32 num_ref_idx;
  899|  18.4E|            WORD32 zero_idx;
  900|       |
  901|  18.4E|            zero_idx = max_num_merge_cand - candidate_cnt - 1;
  902|       |
  903|  18.4E|            if(slice_type == PSLICE)
  ------------------
  |  Branch (903:16): [True: 2.09k, False: 18.4E]
  ------------------
  904|  2.09k|                num_ref_idx = ps_slice_hdr->i1_num_ref_idx_l0_active;
  905|  18.4E|            else
  906|       |                /* Slice type B */
  907|  18.4E|                num_ref_idx = MIN(ps_slice_hdr->i1_num_ref_idx_l0_active, ps_slice_hdr->i1_num_ref_idx_l1_active);
  ------------------
  |  |   43|  18.4E|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 3.76k, False: 18.4E]
  |  |  ------------------
  ------------------
  908|       |
  909|  18.4E|            if(zero_idx >= num_ref_idx)
  ------------------
  |  Branch (909:16): [True: 7.25k, False: 18.4E]
  ------------------
  910|  7.25k|                zero_idx = 0;
  911|       |
  912|  18.4E|            ps_pu[0].mv.i1_l0_ref_idx = zero_idx;
  913|  18.4E|            if(slice_type == PSLICE)
  ------------------
  |  Branch (913:16): [True: 2.09k, False: 18.4E]
  ------------------
  914|  2.09k|            {
  915|  2.09k|                ps_pu[0].mv.i1_l1_ref_idx = 0;
  916|  2.09k|                ps_pu[0].b2_pred_mode = PRED_L0;
  917|  2.09k|            }
  918|  18.4E|            else /* Slice type B */
  919|  18.4E|            {
  920|  18.4E|                ps_pu[0].mv.i1_l1_ref_idx = zero_idx;
  921|  18.4E|                ps_pu[0].b2_pred_mode = PRED_BI;
  922|  18.4E|            }
  923|       |
  924|  18.4E|            ps_pu[0].mv.s_l0_mv.i2_mvx = 0;
  925|  18.4E|            ps_pu[0].mv.s_l0_mv.i2_mvy = 0;
  926|  18.4E|            ps_pu[0].mv.s_l1_mv.i2_mvx = 0;
  927|  18.4E|            ps_pu[0].mv.s_l1_mv.i2_mvy = 0;
  928|       |
  929|  18.4E|            candidate_cnt++;
  930|  18.4E|        }
  931|  18.4E|    }
  932|       |
  933|      0|    return;
  934|  18.4E|}

ihevcd_scale_mv:
  107|  45.6k|{
  108|  45.6k|    WORD32 td, tb, tx;
  109|  45.6k|    WORD32 dist_scale_factor;
  110|  45.6k|    WORD32 mvx, mvy;
  111|       |
  112|  45.6k|    td = CLIP_S8(cur_poc - nbr_ref_poc);
  ------------------
  |  |   41|  45.6k|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|  45.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 578, False: 45.0k]
  |  |  |  |  |  Branch (40:53): [True: 831, False: 44.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|  45.6k|    tb = CLIP_S8(cur_poc - cur_ref_poc);
  ------------------
  |  |   41|  45.6k|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|  45.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 354, False: 45.3k]
  |  |  |  |  |  Branch (40:53): [True: 2.45k, False: 42.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  114|       |
  115|  45.6k|    if(0 != td)
  ------------------
  |  Branch (115:8): [True: 45.2k, False: 412]
  ------------------
  116|  45.2k|    {
  117|  45.2k|        tx = (16384 + (abs(td) >> 1)) / td;
  118|       |
  119|  45.2k|        dist_scale_factor = (tb * tx + 32) >> 6;
  120|  45.2k|        dist_scale_factor = CLIP3(dist_scale_factor, -4096, 4095);
  ------------------
  |  |   40|  45.2k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 255, False: 45.0k]
  |  |  |  Branch (40:53): [True: 2.42k, False: 42.5k]
  |  |  ------------------
  ------------------
  121|       |
  122|  45.2k|        mvx = ps_mv->i2_mvx;
  123|  45.2k|        mvy = ps_mv->i2_mvy;
  124|       |
  125|  45.2k|        mvx = SIGN(dist_scale_factor * mvx)
  ------------------
  |  |   44|  45.2k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 35.9k, False: 9.33k]
  |  |  |  Branch (44:34): [True: 9.78k, False: 26.1k]
  |  |  ------------------
  ------------------
  126|  45.2k|                        * ((abs(dist_scale_factor * mvx) + 127) >> 8);
  127|  45.2k|        mvy = SIGN(dist_scale_factor * mvy)
  ------------------
  |  |   44|  45.2k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 34.4k, False: 10.8k]
  |  |  |  Branch (44:34): [True: 9.31k, False: 25.1k]
  |  |  ------------------
  ------------------
  128|  45.2k|                        * ((abs(dist_scale_factor * mvy) + 127) >> 8);
  129|       |
  130|  45.2k|        ps_mv->i2_mvx = CLIP_S16(mvx);
  ------------------
  |  |   53|  45.2k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  45.2k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 230, False: 45.0k]
  |  |  |  |  |  Branch (40:53): [True: 137, False: 44.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  131|  45.2k|        ps_mv->i2_mvy = CLIP_S16(mvy);
  ------------------
  |  |   53|  45.2k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|  45.2k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1, False: 45.2k]
  |  |  |  |  |  Branch (40:53): [True: 20, False: 45.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  132|  45.2k|    }
  133|  45.6k|}
ihevcd_scale_collocated_mv:
  169|   121k|{
  170|   121k|    WORD32 td, tb, tx;
  171|   121k|    WORD32 dist_scale_factor;
  172|   121k|    WORD32 mvx, mvy;
  173|       |
  174|   121k|    td = CLIP_S8(col_poc - col_ref_poc);
  ------------------
  |  |   41|   121k|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|   121k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 17.6k, False: 103k]
  |  |  |  |  |  Branch (40:53): [True: 1.37k, False: 102k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  175|   121k|    tb = CLIP_S8(cur_poc - cur_ref_poc);
  ------------------
  |  |   41|   121k|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|   121k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 353, False: 120k]
  |  |  |  |  |  Branch (40:53): [True: 712, False: 120k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  176|       |
  177|   121k|    tx = (16384 + (abs(td) >> 1)) / td;
  178|       |
  179|   121k|    dist_scale_factor = (tb * tx + 32) >> 6;
  180|   121k|    dist_scale_factor = CLIP3(dist_scale_factor, -4096, 4095);
  ------------------
  |  |   40|   121k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 207, False: 121k]
  |  |  |  Branch (40:53): [True: 0, False: 121k]
  |  |  ------------------
  ------------------
  181|       |
  182|   121k|    mvx = ps_mv->i2_mvx;
  183|   121k|    mvy = ps_mv->i2_mvy;
  184|       |
  185|   121k|    mvx = SIGN(dist_scale_factor * mvx)
  ------------------
  |  |   44|   121k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 105k, False: 16.1k]
  |  |  |  Branch (44:34): [True: 16.8k, False: 88.2k]
  |  |  ------------------
  ------------------
  186|   121k|                    * ((abs(dist_scale_factor * mvx) + 127) >> 8);
  187|   121k|    mvy = SIGN(dist_scale_factor * mvy)
  ------------------
  |  |   44|   121k|#define SIGN(x)     ((x) >= 0 ? ((x)>0 ? 1: 0) : -1)
  |  |  ------------------
  |  |  |  Branch (44:22): [True: 106k, False: 15.0k]
  |  |  |  Branch (44:34): [True: 14.3k, False: 91.8k]
  |  |  ------------------
  ------------------
  188|   121k|                    * ((abs(dist_scale_factor * mvy) + 127) >> 8);
  189|       |
  190|   121k|    ps_mv->i2_mvx = CLIP_S16(mvx);
  ------------------
  |  |   53|   121k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   121k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1.32k, False: 119k]
  |  |  |  |  |  Branch (40:53): [True: 282, False: 119k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|   121k|    ps_mv->i2_mvy = CLIP_S16(mvy);
  ------------------
  |  |   53|   121k|#define CLIP_S16(x) CLIP3((x), -32768,   32767);
  |  |  ------------------
  |  |  |  |   40|   121k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 151, False: 121k]
  |  |  |  |  |  Branch (40:53): [True: 35, False: 121k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|   121k|}
GET_MV_NBR_ST:
  226|   335k|{
  227|   335k|    WORD32 i, nbr_pred_lx;
  228|   335k|    pic_buf_t *ps_nbr_pic_buf_lx;
  229|       |    /* Short Term */
  230|       |    /* L0 */
  231|   335k|    if(0 == lx)
  ------------------
  |  Branch (231:8): [True: 234k, False: 101k]
  ------------------
  232|   234k|    {
  233|   300k|        for(i = 0; i < num_nbrs; i++)
  ------------------
  |  Branch (233:20): [True: 251k, False: 48.6k]
  ------------------
  234|   251k|        {
  235|   251k|            nbr_pred_lx = (PRED_L1 != aps_nbr_pu[i]->b2_pred_mode);
  236|   251k|            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|   251k|            CHECK_NBR_MV_ST(pi4_avail_flag, ps_cur_pic_buf_lx->i4_abs_poc, nbr_pred_lx,
  ------------------
  |  |  195|   251k|                        ps_mv, ps_nbr_mv )                                                  \
  |  |  196|   251k|{                                                                                           \
  |  |  197|   251k|    if((u1_nbr_pred_flag) && (cur_ref_poc == nbr_ref_poc))                                  \
  |  |  ------------------
  |  |  |  Branch (197:8): [True: 184k, False: 66.7k]
  |  |  |  Branch (197:30): [True: 159k, False: 25.6k]
  |  |  ------------------
  |  |  198|   251k|    {                                                                                       \
  |  |  199|   159k|        *pi4_avail_flag = 1;                                                                \
  |  |  200|   159k|        *ps_mv = *ps_nbr_mv;                                                                \
  |  |  201|   159k|        break ;                                                                             \
  |  |  202|   159k|    }                                                                                       \
  |  |  203|   251k|}
  ------------------
  238|   251k|                            ps_nbr_pic_buf_lx->i4_abs_poc, ps_mv, &aps_nbr_pu[i]->mv.s_l0_mv);
  239|  92.4k|            nbr_pred_lx = (PRED_L0 != aps_nbr_pu[i]->b2_pred_mode);
  240|       |
  241|  92.4k|            nbr_pred_lx = (PRED_L0 != aps_nbr_pu[i]->b2_pred_mode);
  242|  92.4k|            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|  92.4k|            CHECK_NBR_MV_ST(pi4_avail_flag, ps_cur_pic_buf_lx->i4_abs_poc, nbr_pred_lx,
  ------------------
  |  |  195|  92.4k|                        ps_mv, ps_nbr_mv )                                                  \
  |  |  196|  92.4k|{                                                                                           \
  |  |  197|  92.4k|    if((u1_nbr_pred_flag) && (cur_ref_poc == nbr_ref_poc))                                  \
  |  |  ------------------
  |  |  |  Branch (197:8): [True: 76.7k, False: 15.6k]
  |  |  |  Branch (197:30): [True: 26.9k, False: 49.7k]
  |  |  ------------------
  |  |  198|  92.4k|    {                                                                                       \
  |  |  199|  26.9k|        *pi4_avail_flag = 1;                                                                \
  |  |  200|  26.9k|        *ps_mv = *ps_nbr_mv;                                                                \
  |  |  201|  26.9k|        break ;                                                                             \
  |  |  202|  26.9k|    }                                                                                       \
  |  |  203|  92.4k|}
  ------------------
  244|  92.4k|                            ps_nbr_pic_buf_lx->i4_abs_poc, ps_mv, &aps_nbr_pu[i]->mv.s_l1_mv);
  245|  65.4k|        }
  246|   234k|    }
  247|       |    /* L1 */
  248|   101k|    else
  249|   101k|    {
  250|   129k|        for(i = 0; i < num_nbrs; i++)
  ------------------
  |  Branch (250:20): [True: 108k, False: 20.7k]
  ------------------
  251|   108k|        {
  252|   108k|            nbr_pred_lx = (PRED_L0 != aps_nbr_pu[i]->b2_pred_mode);
  253|   108k|            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|   108k|            CHECK_NBR_MV_ST(pi4_avail_flag, ps_cur_pic_buf_lx->i4_abs_poc, nbr_pred_lx,
  ------------------
  |  |  195|   108k|                        ps_mv, ps_nbr_mv )                                                  \
  |  |  196|   108k|{                                                                                           \
  |  |  197|   108k|    if((u1_nbr_pred_flag) && (cur_ref_poc == nbr_ref_poc))                                  \
  |  |  ------------------
  |  |  |  Branch (197:8): [True: 71.5k, False: 36.8k]
  |  |  |  Branch (197:30): [True: 59.0k, False: 12.5k]
  |  |  ------------------
  |  |  198|   108k|    {                                                                                       \
  |  |  199|  59.0k|        *pi4_avail_flag = 1;                                                                \
  |  |  200|  59.0k|        *ps_mv = *ps_nbr_mv;                                                                \
  |  |  201|  59.0k|        break ;                                                                             \
  |  |  202|  59.0k|    }                                                                                       \
  |  |  203|   108k|}
  ------------------
  255|   108k|                            ps_nbr_pic_buf_lx->i4_abs_poc, ps_mv, &aps_nbr_pu[i]->mv.s_l1_mv);
  256|       |
  257|  49.4k|            nbr_pred_lx = (PRED_L1 != aps_nbr_pu[i]->b2_pred_mode);
  258|  49.4k|            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|  49.4k|            CHECK_NBR_MV_ST(pi4_avail_flag, ps_cur_pic_buf_lx->i4_abs_poc, nbr_pred_lx,
  ------------------
  |  |  195|  49.4k|                        ps_mv, ps_nbr_mv )                                                  \
  |  |  196|  49.4k|{                                                                                           \
  |  |  197|  49.4k|    if((u1_nbr_pred_flag) && (cur_ref_poc == nbr_ref_poc))                                  \
  |  |  ------------------
  |  |  |  Branch (197:8): [True: 41.4k, False: 7.95k]
  |  |  |  Branch (197:30): [True: 21.5k, False: 19.9k]
  |  |  ------------------
  |  |  198|  49.4k|    {                                                                                       \
  |  |  199|  21.5k|        *pi4_avail_flag = 1;                                                                \
  |  |  200|  21.5k|        *ps_mv = *ps_nbr_mv;                                                                \
  |  |  201|  21.5k|        break ;                                                                             \
  |  |  202|  21.5k|    }                                                                                       \
  |  |  203|  49.4k|}
  ------------------
  260|  49.4k|                            ps_nbr_pic_buf_lx->i4_abs_poc, ps_mv, &aps_nbr_pu[i]->mv.s_l0_mv);
  261|  27.8k|        }
  262|   101k|    }
  263|   335k|}
GET_MV_NBR_LT:
  266|  59.3k|{
  267|  59.3k|    WORD32 i, nbr_pred_lx;
  268|  59.3k|    pic_buf_t *ps_nbr_pic_buf_lx;
  269|       |    /* Long Term*/
  270|       |    /* L0 */
  271|  59.3k|    if(0 == lx)
  ------------------
  |  Branch (271:8): [True: 41.5k, False: 17.7k]
  ------------------
  272|  41.5k|    {
  273|  18.4E|        for(i = 0; i < num_nbrs; i++)
  ------------------
  |  Branch (273:20): [True: 32.5k, False: 9.08k]
  ------------------
  274|  32.5k|        {
  275|  32.5k|            nbr_pred_lx = (PRED_L1 != aps_nbr_pu[i]->b2_pred_mode);
  276|  32.5k|            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|  32.5k|            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|  32.5k|                      ps_mv, ps_nbr_mv )                                                     \
  |  |  207|  32.5k|{                                                                                            \
  |  |  208|  32.5k|    WORD32 cur_lt, nbr_lt;                                                                   \
  |  |  209|  32.5k|    cur_lt = (LONG_TERM_REF == (u1_cur_ref_lt));                                             \
  |  |  210|  32.5k|    nbr_lt = (LONG_TERM_REF == (u1_nbr_ref_lt));                                             \
  |  |  211|  32.5k|    if((u1_nbr_pred_flag) && (cur_lt == nbr_lt))                                             \
  |  |  ------------------
  |  |  |  Branch (211:8): [True: 11.6k, False: 20.8k]
  |  |  |  Branch (211:30): [True: 11.6k, False: 0]
  |  |  ------------------
  |  |  212|  32.5k|    {                                                                                        \
  |  |  213|  11.6k|        *pi4_avail_flag = 1;                                                                 \
  |  |  214|  11.6k|        *ps_mv = *ps_nbr_mv;                                                                 \
  |  |  215|  11.6k|        if(SHORT_TERM_REF == u1_nbr_ref_lt)                                                  \
  |  |  ------------------
  |  |  |  Branch (215:12): [True: 11.4k, False: 204]
  |  |  ------------------
  |  |  216|  11.6k|        {                                                                                    \
  |  |  217|  11.4k|            ihevcd_scale_mv(ps_mv, cur_ref_poc, nbr_ref_poc,                                 \
  |  |  218|  11.4k|                                                cur_poc);                                    \
  |  |  219|  11.4k|        }                                                                                    \
  |  |  220|  11.6k|        break ;                                                                              \
  |  |  221|  11.6k|    }                                                                                        \
  |  |  222|  32.5k|}
  ------------------
  278|  32.5k|                            nbr_pred_lx,
  279|  32.5k|                            ps_nbr_pic_buf_lx->u1_used_as_ref, ps_nbr_pic_buf_lx->i4_abs_poc,
  280|  32.5k|                            ps_mv, &aps_nbr_pu[i]->mv.s_l0_mv);
  281|       |
  282|  20.8k|            nbr_pred_lx = (PRED_L0 != aps_nbr_pu[i]->b2_pred_mode);
  283|  20.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|  20.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|  20.8k|                      ps_mv, ps_nbr_mv )                                                     \
  |  |  207|  20.8k|{                                                                                            \
  |  |  208|  20.8k|    WORD32 cur_lt, nbr_lt;                                                                   \
  |  |  209|  20.8k|    cur_lt = (LONG_TERM_REF == (u1_cur_ref_lt));                                             \
  |  |  210|  20.8k|    nbr_lt = (LONG_TERM_REF == (u1_nbr_ref_lt));                                             \
  |  |  211|  20.8k|    if((u1_nbr_pred_flag) && (cur_lt == nbr_lt))                                             \
  |  |  ------------------
  |  |  |  Branch (211:8): [True: 20.8k, False: 18.4E]
  |  |  |  Branch (211:30): [True: 20.8k, False: 0]
  |  |  ------------------
  |  |  212|  20.8k|    {                                                                                        \
  |  |  213|  20.8k|        *pi4_avail_flag = 1;                                                                 \
  |  |  214|  20.8k|        *ps_mv = *ps_nbr_mv;                                                                 \
  |  |  215|  20.8k|        if(SHORT_TERM_REF == u1_nbr_ref_lt)                                                  \
  |  |  ------------------
  |  |  |  Branch (215:12): [True: 20.8k, False: 22]
  |  |  ------------------
  |  |  216|  20.8k|        {                                                                                    \
  |  |  217|  20.8k|            ihevcd_scale_mv(ps_mv, cur_ref_poc, nbr_ref_poc,                                 \
  |  |  218|  20.8k|                                                cur_poc);                                    \
  |  |  219|  20.8k|        }                                                                                    \
  |  |  220|  20.8k|        break ;                                                                              \
  |  |  221|  20.8k|    }                                                                                        \
  |  |  222|  20.8k|}
  ------------------
  285|  20.8k|                            nbr_pred_lx,
  286|  20.8k|                            ps_nbr_pic_buf_lx->u1_used_as_ref, ps_nbr_pic_buf_lx->i4_abs_poc,
  287|  18.4E|                            ps_mv, &aps_nbr_pu[i]->mv.s_l1_mv);
  288|  18.4E|        }
  289|  41.5k|    }
  290|       |    /* L1 */
  291|  17.7k|    else
  292|  17.7k|    {
  293|  17.7k|        for(i = 0; i < num_nbrs; i++)
  ------------------
  |  Branch (293:20): [True: 13.4k, False: 4.31k]
  ------------------
  294|  13.4k|        {
  295|  13.4k|            nbr_pred_lx = (PRED_L0 != aps_nbr_pu[i]->b2_pred_mode);
  296|  13.4k|            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|  13.4k|            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|  13.4k|                      ps_mv, ps_nbr_mv )                                                     \
  |  |  207|  13.4k|{                                                                                            \
  |  |  208|  13.4k|    WORD32 cur_lt, nbr_lt;                                                                   \
  |  |  209|  13.4k|    cur_lt = (LONG_TERM_REF == (u1_cur_ref_lt));                                             \
  |  |  210|  13.4k|    nbr_lt = (LONG_TERM_REF == (u1_nbr_ref_lt));                                             \
  |  |  211|  13.4k|    if((u1_nbr_pred_flag) && (cur_lt == nbr_lt))                                             \
  |  |  ------------------
  |  |  |  Branch (211:8): [True: 5.68k, False: 7.77k]
  |  |  |  Branch (211:30): [True: 5.68k, False: 0]
  |  |  ------------------
  |  |  212|  13.4k|    {                                                                                        \
  |  |  213|  5.68k|        *pi4_avail_flag = 1;                                                                 \
  |  |  214|  5.68k|        *ps_mv = *ps_nbr_mv;                                                                 \
  |  |  215|  5.68k|        if(SHORT_TERM_REF == u1_nbr_ref_lt)                                                  \
  |  |  ------------------
  |  |  |  Branch (215:12): [True: 5.64k, False: 43]
  |  |  ------------------
  |  |  216|  5.68k|        {                                                                                    \
  |  |  217|  5.64k|            ihevcd_scale_mv(ps_mv, cur_ref_poc, nbr_ref_poc,                                 \
  |  |  218|  5.64k|                                                cur_poc);                                    \
  |  |  219|  5.64k|        }                                                                                    \
  |  |  220|  5.68k|        break ;                                                                              \
  |  |  221|  5.68k|    }                                                                                        \
  |  |  222|  13.4k|}
  ------------------
  298|  13.4k|                            nbr_pred_lx,
  299|  13.4k|                            ps_nbr_pic_buf_lx->u1_used_as_ref, ps_nbr_pic_buf_lx->i4_abs_poc,
  300|  13.4k|                            ps_mv, &aps_nbr_pu[i]->mv.s_l1_mv);
  301|       |
  302|  7.77k|            nbr_pred_lx = (PRED_L1 != aps_nbr_pu[i]->b2_pred_mode);
  303|  7.77k|            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|  7.77k|            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|  7.77k|                      ps_mv, ps_nbr_mv )                                                     \
  |  |  207|  7.77k|{                                                                                            \
  |  |  208|  7.77k|    WORD32 cur_lt, nbr_lt;                                                                   \
  |  |  209|  7.77k|    cur_lt = (LONG_TERM_REF == (u1_cur_ref_lt));                                             \
  |  |  210|  7.77k|    nbr_lt = (LONG_TERM_REF == (u1_nbr_ref_lt));                                             \
  |  |  211|  7.77k|    if((u1_nbr_pred_flag) && (cur_lt == nbr_lt))                                             \
  |  |  ------------------
  |  |  |  Branch (211:8): [True: 7.77k, False: 0]
  |  |  |  Branch (211:30): [True: 7.77k, False: 0]
  |  |  ------------------
  |  |  212|  7.77k|    {                                                                                        \
  |  |  213|  7.77k|        *pi4_avail_flag = 1;                                                                 \
  |  |  214|  7.77k|        *ps_mv = *ps_nbr_mv;                                                                 \
  |  |  215|  7.77k|        if(SHORT_TERM_REF == u1_nbr_ref_lt)                                                  \
  |  |  ------------------
  |  |  |  Branch (215:12): [True: 7.74k, False: 24]
  |  |  ------------------
  |  |  216|  7.77k|        {                                                                                    \
  |  |  217|  7.74k|            ihevcd_scale_mv(ps_mv, cur_ref_poc, nbr_ref_poc,                                 \
  |  |  218|  7.74k|                                                cur_poc);                                    \
  |  |  219|  7.74k|        }                                                                                    \
  |  |  220|  7.77k|        break ;                                                                              \
  |  |  221|  7.77k|    }                                                                                        \
  |  |  222|  7.77k|}
  ------------------
  305|  7.77k|                            nbr_pred_lx,
  306|  7.77k|                            ps_nbr_pic_buf_lx->u1_used_as_ref, ps_nbr_pic_buf_lx->i4_abs_poc,
  307|  7.77k|                            ps_mv, &aps_nbr_pu[i]->mv.s_l0_mv);
  308|      0|        }
  309|  17.7k|    }
  310|  59.3k|}
ihevcd_mv_pred:
  366|   169k|{
  367|   169k|    slice_header_t *ps_slice_hdr;
  368|   169k|    ref_list_t *ps_ref_pic_list[2];
  369|   169k|    pu_t *ps_pic_pu;
  370|   169k|    WORD32 max_l0_mvp_cand, max_l1_mvp_cand;
  371|   169k|    WORD32 l0_done_flag, l1_done_flag;
  372|   169k|    WORD32 num_l0_mvp_cand, num_l1_mvp_cand;
  373|   169k|    WORD32 is_scaled_flag_list /* Indicates whether A0 or A1 is available */;
  374|   169k|    WORD32 avail_a_flag[2];
  375|   169k|    mv_t as_mv_a[2];
  376|   169k|    WORD32 part_pos_x;
  377|   169k|    WORD32 part_pos_y;
  378|   169k|    WORD32 part_wd;
  379|   169k|    WORD32 part_ht;
  380|   169k|    pic_buf_t *ps_cur_pic_buf_l0, *ps_cur_pic_buf_l1;
  381|   169k|    WORD32 nbr_avail[3]; /*[A0/A1] */ /* [B0/B1/B2] */
  382|   169k|    pu_t *aps_nbr_pu[3];  /*[A0/A1] */ /* [B0/B1/B2] */
  383|   169k|    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|   169k|    ps_slice_hdr = ps_mv_ctxt->ps_slice_hdr;
  401|   169k|    ps_pic_pu = ps_mv_ctxt->ps_pic_pu;
  402|   169k|    max_l0_mvp_cand = ps_pu->b1_l0_mvp_idx + 1;
  403|   169k|    max_l1_mvp_cand = ps_pu->b1_l1_mvp_idx + 1;
  404|   169k|    num_l0_mvp_cand = 0;
  405|   169k|    num_l1_mvp_cand = 0;
  406|       |
  407|       |    /* Initializing reference list */
  408|   169k|    ps_ref_pic_list[0] = ps_slice_hdr->as_ref_pic_list0;
  409|   169k|    ps_ref_pic_list[1] = ps_slice_hdr->as_ref_pic_list1;
  410|   169k|    if(PSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (410:8): [True: 184, False: 169k]
  ------------------
  411|    184|        ps_ref_pic_list[1] = ps_slice_hdr->as_ref_pic_list0;
  412|       |
  413|   169k|    ps_cur_pic_buf_l0 = (pic_buf_t *)((ps_ref_pic_list[0][ps_pu->mv.i1_l0_ref_idx].pv_pic_buf));
  414|   169k|    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|   169k|    is_scaled_flag_list = 0;
  417|       |
  418|   169k|    part_pos_x = ps_pu->b4_pos_x << 2;
  419|   169k|    part_pos_y = ps_pu->b4_pos_y << 2;
  420|   169k|    part_wd = (ps_pu->b4_wd + 1) << 2;
  421|   169k|    part_ht = (ps_pu->b4_ht + 1) << 2;
  422|       |
  423|       |    /************************************************************/
  424|       |    /* Calculating of motion vector A from neighbors A0 and A1  */
  425|       |    /************************************************************/
  426|   169k|    {
  427|   169k|        nbr_avail[0] = 0;
  428|   169k|        nbr_avail[1] = 0;
  429|       |
  430|       |        /* Pointers to A0 and A1 */
  431|   169k|        {
  432|   169k|            WORD32 y_a0, y_a1;
  433|   169k|            WORD32 pu_idx_a0, pu_idx_a1;
  434|       |
  435|       |            /* TODO: y_a0, y_a1 is coded assuming left nbr pointer starts at PU */
  436|   169k|            y_a0 = (part_ht >> 2);
  437|   169k|            y_a1 = ((part_ht - 1) >> 2);
  438|       |
  439|   169k|            pu_idx_a0 = *(pu4_left_pu_idx + (y_a0 * left_nbr_4x4_strd));
  440|   169k|            pu_idx_a1 = *(pu4_left_pu_idx + (y_a1 * left_nbr_4x4_strd));
  441|       |
  442|   169k|            if(lb_avail && (!ps_pic_pu[pu_idx_a0].b1_intra_flag))
  ------------------
  |  Branch (442:16): [True: 62.8k, False: 106k]
  |  Branch (442:28): [True: 61.3k, False: 1.48k]
  ------------------
  443|  61.3k|            {
  444|  61.3k|                aps_nbr_pu[num_nbrs] = &ps_pic_pu[pu_idx_a0];
  445|  61.3k|                num_nbrs++;
  446|  61.3k|                nbr_avail[0] = 1;
  447|  61.3k|            }
  448|   169k|            if(l_avail && (!ps_pic_pu[pu_idx_a1].b1_intra_flag))
  ------------------
  |  Branch (448:16): [True: 164k, False: 5.20k]
  |  Branch (448:27): [True: 161k, False: 2.95k]
  ------------------
  449|   161k|            {
  450|   161k|                aps_nbr_pu[num_nbrs] = &ps_pic_pu[pu_idx_a1];
  451|   161k|                num_nbrs++;
  452|   161k|                nbr_avail[1] = 1;
  453|   161k|            }
  454|   169k|        }
  455|       |        /* Setting is scaled flag based on availability of A0 and A1 */
  456|   169k|        if((nbr_avail[0] == 1) || (nbr_avail[1]))
  ------------------
  |  Branch (456:12): [True: 61.2k, False: 108k]
  |  Branch (456:35): [True: 100k, False: 7.87k]
  ------------------
  457|   161k|        {
  458|   161k|            is_scaled_flag_list = 1;
  459|   161k|        }
  460|       |
  461|   169k|        avail_a_flag[0] = 0;
  462|   169k|        avail_a_flag[1] = 0;
  463|       |
  464|       |        /* L0 */
  465|   169k|        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|   169k|        if(0 == avail_a_flag[0])
  ------------------
  |  Branch (466:12): [True: 37.6k, False: 131k]
  ------------------
  467|  37.6k|        {
  468|  37.6k|            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|  37.6k|        }
  470|       |
  471|       |        /* L1 */
  472|   169k|        if(PRED_L0 != ps_pu->b2_pred_mode)
  ------------------
  |  Branch (472:12): [True: 72.9k, False: 96.5k]
  ------------------
  473|  72.9k|        {
  474|  72.9k|            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|  72.9k|            if(0 == avail_a_flag[1])
  ------------------
  |  Branch (475:16): [True: 15.7k, False: 57.2k]
  ------------------
  476|  15.7k|            {
  477|  15.7k|                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|  15.7k|            }
  479|  72.9k|        }
  480|       |
  481|   169k|        l0_done_flag = (PRED_L1 == ps_pu->b2_pred_mode);
  482|   169k|        l1_done_flag = (PRED_L0 == ps_pu->b2_pred_mode);
  483|       |
  484|   169k|        if(avail_a_flag[0])
  ------------------
  |  Branch (484:12): [True: 161k, False: 7.82k]
  ------------------
  485|   161k|        {
  486|   161k|            num_l0_mvp_cand++;
  487|   161k|            if(max_l0_mvp_cand == num_l0_mvp_cand)
  ------------------
  |  Branch (487:16): [True: 124k, False: 37.1k]
  ------------------
  488|   124k|            {
  489|   124k|                ps_pred_mv->s_l0_mv = as_mv_a[0];
  490|   124k|                l0_done_flag = 1;
  491|   124k|            }
  492|   161k|        }
  493|   169k|        if(avail_a_flag[1])
  ------------------
  |  Branch (493:12): [True: 69.2k, False: 100k]
  ------------------
  494|  69.2k|        {
  495|  69.2k|            num_l1_mvp_cand++;
  496|  69.2k|            if(max_l1_mvp_cand == num_l1_mvp_cand)
  ------------------
  |  Branch (496:16): [True: 46.3k, False: 22.9k]
  ------------------
  497|  46.3k|            {
  498|  46.3k|                ps_pred_mv->s_l1_mv = as_mv_a[1];
  499|  46.3k|                l1_done_flag = 1;
  500|  46.3k|            }
  501|  69.2k|        }
  502|   169k|        if(l0_done_flag && l1_done_flag)
  ------------------
  |  Branch (502:12): [True: 126k, False: 43.0k]
  |  Branch (502:28): [True: 104k, False: 22.1k]
  ------------------
  503|   104k|            return;
  504|   169k|    }
  505|       |
  506|       |    /************************************************************/
  507|       |    /* Calculating of motion vector B from neighbors B0 and B1  */
  508|       |    /************************************************************/
  509|  65.1k|    {
  510|  65.1k|        WORD32 avail_b_flag[2];
  511|  65.1k|        mv_t as_mv_b[2];
  512|       |
  513|       |        /* Pointers to B0, B1 and B2 */
  514|  65.1k|        {
  515|  65.1k|            WORD32 x_b0, x_b1, x_b2;
  516|  65.1k|            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|  65.1k|            x_b0 = (part_pos_x + part_wd);
  521|  65.1k|            x_b1 = (part_pos_x + part_wd - 1);
  522|  65.1k|            x_b2 = (part_pos_x - 1);
  523|       |            /* Getting offset back to given pointer */
  524|  65.1k|            x_b0 = x_b0 - part_pos_x;
  525|  65.1k|            x_b1 = x_b1 - part_pos_x;
  526|  65.1k|            x_b2 = x_b2 - part_pos_x;
  527|       |
  528|       |            /* Below derivation are based on top pointer */
  529|       |            /* is pointing first pixel of PU             */
  530|  65.1k|            pu_idx_b0 = *(pu4_top_pu_idx + (x_b0 >> 2));
  531|  65.1k|            pu_idx_b0 = pu_idx_b0 * tr_avail;
  532|  65.1k|            pu_idx_b1 = *(pu4_top_pu_idx + (x_b1 >> 2));
  533|  65.1k|            pu_idx_b1 = pu_idx_b1 * t_avail;
  534|       |            /* At CTB boundary, use top-left passed in */
  535|  65.1k|            if(part_pos_y)
  ------------------
  |  Branch (535:16): [True: 53.7k, False: 11.4k]
  ------------------
  536|  53.7k|            {
  537|  53.7k|                pu_idx_b2 = *pu4_top_left_pu_idx;
  538|  53.7k|            }
  539|  11.4k|            else
  540|  11.4k|            {
  541|       |                /* Not at CTB boundary, use top and  */
  542|       |                /* add correction to go to top-left */
  543|  11.4k|                pu_idx_b2 = *((pu4_top_pu_idx)+(x_b2 >> 2));
  544|  11.4k|            }
  545|  65.1k|            pu_idx_b2 = pu_idx_b2 * tl_avail;
  546|       |
  547|  65.1k|            num_nbrs = 0;
  548|  65.1k|            nbr_avail[0] = 0;
  549|  65.1k|            nbr_avail[1] = 0;
  550|  65.1k|            nbr_avail[2] = 0;
  551|       |
  552|  65.1k|            if(tr_avail && (!ps_pic_pu[pu_idx_b0].b1_intra_flag))
  ------------------
  |  Branch (552:16): [True: 40.3k, False: 24.7k]
  |  Branch (552:28): [True: 39.3k, False: 1.00k]
  ------------------
  553|  39.3k|            {
  554|  39.3k|                aps_nbr_pu[num_nbrs] = &ps_pic_pu[pu_idx_b0];
  555|  39.3k|                num_nbrs++;
  556|  39.3k|                nbr_avail[0] = 1;
  557|  39.3k|            }
  558|  65.1k|            if(t_avail && (!ps_pic_pu[pu_idx_b1].b1_intra_flag))
  ------------------
  |  Branch (558:16): [True: 62.5k, False: 2.59k]
  |  Branch (558:27): [True: 61.2k, False: 1.34k]
  ------------------
  559|  61.2k|            {
  560|  61.2k|                aps_nbr_pu[num_nbrs] = &ps_pic_pu[pu_idx_b1];
  561|  61.2k|                num_nbrs++;
  562|  61.2k|                nbr_avail[1] = 1;
  563|  61.2k|            }
  564|  65.1k|            if(tl_avail && (!ps_pic_pu[pu_idx_b2].b1_intra_flag))
  ------------------
  |  Branch (564:16): [True: 58.0k, False: 7.12k]
  |  Branch (564:28): [True: 56.1k, False: 1.92k]
  ------------------
  565|  56.1k|            {
  566|  56.1k|                aps_nbr_pu[num_nbrs] = &ps_pic_pu[pu_idx_b2];
  567|  56.1k|                num_nbrs++;
  568|  56.1k|                nbr_avail[2] = 1;
  569|  56.1k|            }
  570|  65.1k|        }
  571|       |
  572|       |        /* L0 */
  573|  65.1k|        avail_b_flag[0] = 0;
  574|  65.1k|        avail_b_flag[1] = 0;
  575|       |
  576|  65.1k|        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|  65.1k|        if(PRED_L0 != ps_pu->b2_pred_mode)
  ------------------
  |  Branch (579:12): [True: 28.5k, False: 36.6k]
  ------------------
  580|  28.5k|        {
  581|       |            /* B0 Short Term */
  582|  28.5k|            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|  28.5k|        }
  584|       |
  585|  65.1k|        if(avail_b_flag[0])
  ------------------
  |  Branch (585:12): [True: 54.2k, False: 10.9k]
  ------------------
  586|  54.2k|        {
  587|  54.2k|            if(((0 == num_l0_mvp_cand)
  ------------------
  |  Branch (587:17): [True: 5.78k, False: 48.4k]
  ------------------
  588|  54.2k|                            || (as_mv_a[0].i2_mvx != as_mv_b[0].i2_mvx)
  ------------------
  |  Branch (588:32): [True: 24.1k, False: 24.3k]
  ------------------
  589|  54.2k|                            || (as_mv_a[0].i2_mvy != as_mv_b[0].i2_mvy)))
  ------------------
  |  Branch (589:32): [True: 6.59k, False: 17.7k]
  ------------------
  590|  36.5k|            {
  591|  36.5k|                num_l0_mvp_cand++;
  592|  36.5k|                if(max_l0_mvp_cand == num_l0_mvp_cand)
  ------------------
  |  Branch (592:20): [True: 26.2k, False: 10.2k]
  ------------------
  593|  26.2k|                {
  594|  26.2k|                    ps_pred_mv->s_l0_mv = as_mv_b[0];
  595|  26.2k|                    l0_done_flag = 1;
  596|  26.2k|                }
  597|  36.5k|            }
  598|  54.2k|        }
  599|  65.1k|        if(avail_b_flag[1])
  ------------------
  |  Branch (599:12): [True: 23.3k, False: 41.8k]
  ------------------
  600|  23.3k|        {
  601|  23.3k|            if(((0 == num_l1_mvp_cand)
  ------------------
  |  Branch (601:17): [True: 2.56k, False: 20.7k]
  ------------------
  602|  23.3k|                            || (as_mv_a[1].i2_mvx != as_mv_b[1].i2_mvx)
  ------------------
  |  Branch (602:32): [True: 10.5k, False: 10.2k]
  ------------------
  603|  23.3k|                            || (as_mv_a[1].i2_mvy != as_mv_b[1].i2_mvy)))
  ------------------
  |  Branch (603:32): [True: 3.44k, False: 6.79k]
  ------------------
  604|  16.5k|            {
  605|  16.5k|                num_l1_mvp_cand++;
  606|  16.5k|                if(max_l1_mvp_cand == num_l1_mvp_cand)
  ------------------
  |  Branch (606:20): [True: 14.8k, False: 1.68k]
  ------------------
  607|  14.8k|                {
  608|  14.8k|                    ps_pred_mv->s_l1_mv = as_mv_b[1];
  609|  14.8k|                    l1_done_flag = 1;
  610|  14.8k|                }
  611|  16.5k|            }
  612|  23.3k|        }
  613|  65.1k|        if(l0_done_flag && l1_done_flag)
  ------------------
  |  Branch (613:12): [True: 47.1k, False: 18.0k]
  |  Branch (613:28): [True: 36.8k, False: 10.2k]
  ------------------
  614|  36.8k|            return;
  615|       |
  616|  28.3k|        if((is_scaled_flag_list == 0) && (avail_b_flag[0] == 1))
  ------------------
  |  Branch (616:12): [True: 3.89k, False: 24.4k]
  |  Branch (616:42): [True: 2.06k, False: 1.82k]
  ------------------
  617|  2.06k|        {
  618|  2.06k|            avail_a_flag[0] = 1;
  619|  2.06k|            as_mv_a[0] = as_mv_b[0];
  620|  2.06k|        }
  621|  28.3k|        if((is_scaled_flag_list == 0) && (avail_b_flag[1] == 1))
  ------------------
  |  Branch (621:12): [True: 3.89k, False: 24.4k]
  |  Branch (621:42): [True: 990, False: 2.90k]
  ------------------
  622|    990|        {
  623|    990|            avail_a_flag[1] = 1;
  624|    990|            as_mv_a[1] = as_mv_b[1];
  625|    990|        }
  626|       |
  627|  28.3k|        if(0 == is_scaled_flag_list)
  ------------------
  |  Branch (627:12): [True: 3.89k, False: 24.4k]
  ------------------
  628|  3.89k|        {
  629|  3.89k|            avail_b_flag[0] = avail_b_flag[1] = 0;
  630|       |
  631|  3.89k|            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|  3.89k|            if(PRED_L0 != ps_pu->b2_pred_mode)
  ------------------
  |  Branch (633:16): [True: 2.06k, False: 1.82k]
  ------------------
  634|  2.06k|            {
  635|  2.06k|                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|  2.06k|            }
  637|       |
  638|  3.89k|            if(avail_b_flag[0])
  ------------------
  |  Branch (638:16): [True: 2.68k, False: 1.21k]
  ------------------
  639|  2.68k|            {
  640|  2.68k|                if(((0 == num_l0_mvp_cand)
  ------------------
  |  Branch (640:21): [True: 615, False: 2.06k]
  ------------------
  641|  2.68k|                                || (as_mv_a[0].i2_mvx != as_mv_b[0].i2_mvx)
  ------------------
  |  Branch (641:36): [True: 66, False: 2.00k]
  ------------------
  642|  2.68k|                                || (as_mv_a[0].i2_mvy != as_mv_b[0].i2_mvy)))
  ------------------
  |  Branch (642:36): [True: 28, False: 1.97k]
  ------------------
  643|    709|                {
  644|    709|                    num_l0_mvp_cand++;
  645|    709|                    if(max_l0_mvp_cand == num_l0_mvp_cand)
  ------------------
  |  Branch (645:24): [True: 532, False: 177]
  ------------------
  646|    532|                    {
  647|    532|                        ps_pred_mv->s_l0_mv = as_mv_b[0];
  648|    532|                        l0_done_flag = 1;
  649|    532|                    }
  650|    709|                }
  651|  2.68k|            }
  652|  3.89k|            if(avail_b_flag[1])
  ------------------
  |  Branch (652:16): [True: 1.37k, False: 2.51k]
  ------------------
  653|  1.37k|            {
  654|  1.37k|                if(((0 == num_l1_mvp_cand)
  ------------------
  |  Branch (654:21): [True: 387, False: 990]
  ------------------
  655|  1.37k|                                || (as_mv_a[1].i2_mvx != as_mv_b[1].i2_mvx)
  ------------------
  |  Branch (655:36): [True: 32, False: 958]
  ------------------
  656|  1.37k|                                || (as_mv_a[1].i2_mvy != as_mv_b[1].i2_mvy)))
  ------------------
  |  Branch (656:36): [True: 4, False: 954]
  ------------------
  657|    423|                {
  658|    423|                    num_l1_mvp_cand++;
  659|    423|                    if(max_l1_mvp_cand == num_l1_mvp_cand)
  ------------------
  |  Branch (659:24): [True: 287, False: 136]
  ------------------
  660|    287|                    {
  661|    287|                        ps_pred_mv->s_l1_mv = as_mv_b[1];
  662|    287|                        l1_done_flag = 1;
  663|    287|                    }
  664|    423|                }
  665|  1.37k|            }
  666|  3.89k|            if(l0_done_flag && l1_done_flag)
  ------------------
  |  Branch (666:16): [True: 1.43k, False: 2.45k]
  |  Branch (666:32): [True: 555, False: 883]
  ------------------
  667|    555|                return;
  668|  3.89k|        }
  669|       |        /***********************************************************/
  670|       |        /*          Collocated MV prediction                       */
  671|       |        /***********************************************************/
  672|  27.7k|        if((2 != num_l0_mvp_cand) || (2 != num_l1_mvp_cand))
  ------------------
  |  Branch (672:12): [True: 25.4k, False: 2.24k]
  |  Branch (672:38): [True: 2.24k, False: 0]
  ------------------
  673|  27.8k|        {
  674|  27.8k|            mv_t as_mv_col[2], s_mv_col_l0, s_mv_col_l1;
  675|  27.8k|            WORD32 avail_col_flag[2] = { 0 };
  676|  27.8k|            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|  27.8k|            x_col = part_pos_x + part_wd;
  679|  27.8k|            y_col = part_pos_y + part_ht;
  680|  27.8k|            ihevcd_collocated_mvp(ps_mv_ctxt, ps_pu, as_mv_col, avail_col_flag, 1, x_col, y_col);
  681|       |
  682|  27.8k|            avail_col_l0 = avail_col_flag[0];
  683|  27.8k|            avail_col_l1 = avail_col_flag[1];
  684|  27.8k|            if(avail_col_l0 || avail_col_l1)
  ------------------
  |  Branch (684:16): [True: 14.5k, False: 13.2k]
  |  Branch (684:32): [True: 0, False: 13.2k]
  ------------------
  685|  14.5k|            {
  686|  14.5k|                s_mv_col_l0 = as_mv_col[0];
  687|  14.5k|                s_mv_col_l1 = as_mv_col[1];
  688|  14.5k|            }
  689|       |
  690|  27.8k|            if(avail_col_l0 == 0 || avail_col_l1 == 0)
  ------------------
  |  Branch (690:16): [True: 13.2k, False: 14.5k]
  |  Branch (690:37): [True: 8, False: 14.5k]
  ------------------
  691|  13.2k|            {
  692|       |                /* Checking Collocated MV availability at Center of PU */
  693|  13.2k|                x_col = part_pos_x + (part_wd >> 1);
  694|  13.2k|                y_col = part_pos_y + (part_ht >> 1);
  695|  13.2k|                ihevcd_collocated_mvp(ps_mv_ctxt, ps_pu, as_mv_col, avail_col_flag, 1, x_col, y_col);
  696|       |
  697|  13.2k|                if(avail_col_l0 == 0)
  ------------------
  |  Branch (697:20): [True: 13.2k, False: 8]
  ------------------
  698|  13.2k|                {
  699|  13.2k|                    s_mv_col_l0 = as_mv_col[0];
  700|  13.2k|                }
  701|  13.2k|                if(avail_col_l1 == 0)
  ------------------
  |  Branch (701:20): [True: 13.2k, False: 0]
  ------------------
  702|  13.2k|                {
  703|  13.2k|                    s_mv_col_l1 = as_mv_col[1];
  704|  13.2k|                }
  705|       |
  706|  13.2k|                avail_col_l0 |= avail_col_flag[0];
  707|  13.2k|                avail_col_l1 |= avail_col_flag[1];
  708|  13.2k|            }
  709|       |
  710|       |            /* Checking if mvp index matches collocated mv */
  711|  27.8k|            if(avail_col_l0)
  ------------------
  |  Branch (711:16): [True: 18.6k, False: 9.18k]
  ------------------
  712|  18.6k|            {
  713|  18.6k|                if(2 != num_l0_mvp_cand)
  ------------------
  |  Branch (713:20): [True: 16.9k, False: 1.72k]
  ------------------
  714|  16.9k|                {
  715|  16.9k|                    num_l0_mvp_cand++;
  716|  16.9k|                    if(max_l0_mvp_cand == num_l0_mvp_cand)
  ------------------
  |  Branch (716:24): [True: 10.9k, False: 5.96k]
  ------------------
  717|  10.9k|                    {
  718|  10.9k|                        ps_pred_mv->s_l0_mv = s_mv_col_l0;
  719|  10.9k|                        l0_done_flag = 1;
  720|  10.9k|                    }
  721|  16.9k|                }
  722|  18.6k|            }
  723|  27.8k|            if(avail_col_l1)
  ------------------
  |  Branch (723:16): [True: 18.6k, False: 9.21k]
  ------------------
  724|  18.6k|            {
  725|  18.6k|                if(2 != num_l1_mvp_cand)
  ------------------
  |  Branch (725:20): [True: 18.3k, False: 296]
  ------------------
  726|  18.3k|                {
  727|  18.3k|                    num_l1_mvp_cand++;
  728|  18.3k|                    if(max_l1_mvp_cand == num_l1_mvp_cand)
  ------------------
  |  Branch (728:24): [True: 17.5k, False: 758]
  ------------------
  729|  17.5k|                    {
  730|  17.5k|                        ps_pred_mv->s_l1_mv = s_mv_col_l1;
  731|  17.5k|                        l1_done_flag = 1;
  732|  17.5k|                    }
  733|  18.3k|                }
  734|  18.6k|            }
  735|  27.8k|            if(l0_done_flag && l1_done_flag)
  ------------------
  |  Branch (735:16): [True: 20.9k, False: 6.88k]
  |  Branch (735:32): [True: 18.4k, False: 2.49k]
  ------------------
  736|  18.4k|                return;
  737|  27.8k|        }
  738|       |
  739|  9.29k|        if(0 == l0_done_flag)
  ------------------
  |  Branch (739:12): [True: 6.88k, False: 2.40k]
  ------------------
  740|  6.88k|        {
  741|  6.88k|            ps_pred_mv->s_l0_mv.i2_mvx = 0;
  742|  6.88k|            ps_pred_mv->s_l0_mv.i2_mvy = 0;
  743|  6.88k|        }
  744|  9.29k|        if(0 == l1_done_flag)
  ------------------
  |  Branch (744:12): [True: 3.07k, False: 6.21k]
  ------------------
  745|  3.07k|        {
  746|  3.07k|            ps_pred_mv->s_l1_mv.i2_mvx = 0;
  747|  3.07k|            ps_pred_mv->s_l1_mv.i2_mvy = 0;
  748|  3.07k|        }
  749|  9.29k|    }
  750|  9.29k|}

ihevcd_nal_search_start_code:
   97|   113k|{
   98|   113k|    WORD32 ofst;
   99|       |
  100|   113k|    WORD32 zero_byte_cnt;
  101|   113k|    WORD32 start_code_found;
  102|       |
  103|   113k|    ofst = -1;
  104|       |
  105|   113k|    zero_byte_cnt = 0;
  106|   113k|    start_code_found = 0;
  107|   177M|    while(ofst < (bytes_remaining - 1))
  ------------------
  |  Branch (107:11): [True: 177M, False: 60]
  ------------------
  108|   177M|    {
  109|   177M|        ofst++;
  110|   177M|        if(pu1_buf[ofst] != 0)
  ------------------
  |  Branch (110:12): [True: 48.2M, False: 129M]
  ------------------
  111|  48.2M|        {
  112|  48.2M|            zero_byte_cnt = 0;
  113|  48.2M|            continue;
  114|  48.2M|        }
  115|       |
  116|   129M|        zero_byte_cnt++;
  117|   129M|        if((ofst < (bytes_remaining - 1)) &&
  ------------------
  |  Branch (117:12): [True: 129M, False: 8]
  ------------------
  118|   129M|           (pu1_buf[ofst + 1] == START_CODE_PREFIX_BYTE) &&
  ------------------
  |  |   47|   129M|#define START_CODE_PREFIX_BYTE      1
  ------------------
  |  Branch (118:12): [True: 115k, False: 128M]
  ------------------
  119|   129M|           (zero_byte_cnt >= NUM_ZEROS_BEFORE_START_CODE))
  ------------------
  |  |   57|   115k|#define NUM_ZEROS_BEFORE_START_CODE 2
  ------------------
  |  Branch (119:12): [True: 113k, False: 2.28k]
  ------------------
  120|   113k|        {
  121|       |            /* Found the start code */
  122|   113k|            ofst++;
  123|   113k|            start_code_found = 1;
  124|   113k|            break;
  125|   113k|        }
  126|   129M|    }
  127|   113k|    if((0 == start_code_found) && (ofst < bytes_remaining))
  ------------------
  |  Branch (127:8): [True: 60, False: 113k]
  |  Branch (127:35): [True: 60, False: 0]
  ------------------
  128|     60|    {
  129|     60|        if((START_CODE_PREFIX_BYTE == pu1_buf[ofst]) &&
  ------------------
  |  |   47|     60|#define START_CODE_PREFIX_BYTE      1
  ------------------
  |  Branch (129:12): [True: 0, False: 60]
  ------------------
  130|     60|           (zero_byte_cnt >= NUM_ZEROS_BEFORE_START_CODE))
  ------------------
  |  |   57|      0|#define NUM_ZEROS_BEFORE_START_CODE 2
  ------------------
  |  Branch (130:12): [True: 0, False: 0]
  ------------------
  131|      0|        {
  132|       |            /* Found a start code at the end*/
  133|      0|            ofst++;
  134|      0|        }
  135|     60|    }
  136|       |    /* Since ofst started at -1, increment it by 1 */
  137|   113k|    ofst++;
  138|       |
  139|   113k|    return ofst;
  140|   113k|}
ihevcd_nal_remv_emuln_bytes:
  186|   113k|{
  187|   113k|    WORD32 src_cnt;
  188|   113k|    WORD32 dst_cnt;
  189|   113k|    WORD32 zero_byte_cnt;
  190|   113k|    WORD32 start_code_found;
  191|   113k|    UWORD8 u1_src;
  192|   113k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  193|       |
  194|   113k|    src_cnt = 0;
  195|   113k|    dst_cnt = 0;
  196|   113k|    zero_byte_cnt = 0;
  197|   113k|    start_code_found = 0;
  198|   254M|    while(src_cnt < (bytes_remaining - 1))
  ------------------
  |  Branch (198:11): [True: 254M, False: 1.48k]
  ------------------
  199|   254M|    {
  200|   254M|        u1_src = pu1_src[src_cnt++];
  201|       |
  202|   254M|        pu1_dst[dst_cnt++] = u1_src;
  203|   254M|        if(u1_src != 0)
  ------------------
  |  Branch (203:12): [True: 83.5M, False: 171M]
  ------------------
  204|  83.5M|        {
  205|  83.5M|            zero_byte_cnt = 0;
  206|  83.5M|            continue;
  207|  83.5M|        }
  208|       |
  209|   171M|        zero_byte_cnt++;
  210|   171M|        if(zero_byte_cnt >= NUM_ZEROS_BEFORE_START_CODE)
  ------------------
  |  |   57|   171M|#define NUM_ZEROS_BEFORE_START_CODE 2
  ------------------
  |  Branch (210:12): [True: 168M, False: 2.68M]
  ------------------
  211|   168M|        {
  212|   168M|            u1_src = pu1_src[src_cnt];
  213|   168M|            if(START_CODE_PREFIX_BYTE == u1_src)
  ------------------
  |  |   47|   168M|#define START_CODE_PREFIX_BYTE      1
  ------------------
  |  Branch (213:16): [True: 111k, False: 168M]
  ------------------
  214|   111k|            {
  215|       |                /* Found the start code */
  216|   111k|                src_cnt -= zero_byte_cnt;
  217|   111k|                dst_cnt -= zero_byte_cnt;
  218|   111k|                start_code_found = 1;
  219|   111k|                break;
  220|   111k|            }
  221|   168M|            else if(EMULATION_PREVENT_BYTE == u1_src)
  ------------------
  |  |   53|   168M|#define EMULATION_PREVENT_BYTE      3
  ------------------
  |  Branch (221:21): [True: 33.2k, False: 168M]
  ------------------
  222|  33.2k|            {
  223|       |                /* Found the emulation prevention byte */
  224|  33.2k|                src_cnt++;
  225|  33.2k|                zero_byte_cnt = 0;
  226|       |
  227|       |                /* Decrement dst_cnt so that the next byte overwrites
  228|       |                 * the emulation prevention byte already copied to dst above
  229|       |                 */
  230|  33.2k|            }
  231|   168M|        }
  232|       |
  233|   171M|    }
  234|       |
  235|   113k|    if((0 == start_code_found) && (src_cnt < bytes_remaining))
  ------------------
  |  Branch (235:8): [True: 1.48k, False: 111k]
  |  Branch (235:35): [True: 1.48k, False: 0]
  ------------------
  236|  1.48k|    {
  237|  1.48k|        u1_src = pu1_src[src_cnt++];
  238|  1.48k|        if(zero_byte_cnt >= NUM_ZEROS_BEFORE_START_CODE)
  ------------------
  |  |   57|  1.48k|#define NUM_ZEROS_BEFORE_START_CODE 2
  ------------------
  |  Branch (238:12): [True: 359, False: 1.13k]
  ------------------
  239|    359|        {
  240|       |
  241|    359|            if(START_CODE_PREFIX_BYTE == u1_src)
  ------------------
  |  |   47|    359|#define START_CODE_PREFIX_BYTE      1
  ------------------
  |  Branch (241:16): [True: 0, False: 359]
  ------------------
  242|      0|            {
  243|       |                /* Found a start code at the end*/
  244|      0|                src_cnt -= zero_byte_cnt;
  245|      0|            }
  246|    359|            else if(EMULATION_PREVENT_BYTE == u1_src)
  ------------------
  |  |   53|    359|#define EMULATION_PREVENT_BYTE      3
  ------------------
  |  Branch (246:21): [True: 0, False: 359]
  ------------------
  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|    359|        }
  256|  1.13k|        else
  257|  1.13k|        {
  258|  1.13k|            pu1_dst[dst_cnt++] = u1_src;
  259|  1.13k|        }
  260|       |
  261|       |
  262|  1.48k|    }
  263|   113k|    *pi4_nal_len = src_cnt;
  264|   113k|    *pi4_dst_len = dst_cnt;
  265|   113k|    return ret;
  266|   113k|}
ihevcd_nal_unit_header:
  290|   113k|{
  291|   113k|    WORD32 unused;
  292|   113k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  293|   113k|    UNUSED(unused);
  ------------------
  |  |   38|   113k|#define UNUSED(x) ((void)(x))
  ------------------
  294|       |    /* Syntax : forbidden_zero_bit */
  295|   113k|    unused = ihevcd_bits_get(ps_bitstrm, 1);
  296|       |
  297|       |    /* Syntax : nal_unit_type */
  298|   113k|    ps_nal->i1_nal_unit_type = ihevcd_bits_get(ps_bitstrm, 6);
  299|       |
  300|       |    /* Syntax : nuh_reserved_zero_6bits */
  301|   113k|    unused = ihevcd_bits_get(ps_bitstrm, 6);
  302|       |
  303|       |    /* Syntax : nuh_temporal_id_plus1 */
  304|   113k|    ps_nal->i1_nuh_temporal_id = (WORD32)ihevcd_bits_get(ps_bitstrm, 3) - 1;
  305|       |
  306|   113k|    return ret;
  307|       |
  308|   113k|}
ihevcd_nal_unit:
  332|   113k|{
  333|   113k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  334|       |
  335|       |    /* NAL Header */
  336|   113k|    nal_header_t s_nal;
  337|       |
  338|   113k|    ret = ihevcd_nal_unit_header(&ps_codec->s_parse.s_bitstrm, &s_nal);
  339|   113k|    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|   113k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 113k]
  |  |  ------------------
  ------------------
  340|       |
  341|   113k|    if(ps_codec->i4_slice_error)
  ------------------
  |  Branch (341:8): [True: 4.87k, False: 108k]
  ------------------
  342|  4.87k|        s_nal.i1_nal_unit_type = ps_codec->s_parse.ps_slice_hdr->i1_nal_unit_type;
  343|       |
  344|       |    /* Setting RASL Output flag */
  345|   113k|    switch(s_nal.i1_nal_unit_type)
  346|   113k|    {
  347|    631|        case NAL_BLA_W_LP    :
  ------------------
  |  Branch (347:9): [True: 631, False: 112k]
  ------------------
  348|  2.01k|        case NAL_BLA_W_DLP   :
  ------------------
  |  Branch (348:9): [True: 1.38k, False: 111k]
  ------------------
  349|  3.32k|        case NAL_BLA_N_LP    :
  ------------------
  |  Branch (349:9): [True: 1.30k, False: 111k]
  ------------------
  350|  3.32k|            ps_codec->i4_rasl_output_flag = 0;
  351|  3.32k|            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|  8.10k|        case NAL_IDR_W_LP    :
  ------------------
  |  Branch (356:9): [True: 8.10k, False: 105k]
  ------------------
  357|  16.5k|        case NAL_IDR_N_LP    :
  ------------------
  |  Branch (357:9): [True: 8.42k, False: 104k]
  ------------------
  358|  16.5k|            ps_codec->i4_rasl_output_flag = 1;
  359|  16.5k|            break;
  360|       |
  361|  1.13k|        case NAL_CRA         :
  ------------------
  |  Branch (361:9): [True: 1.13k, False: 112k]
  ------------------
  362|  1.13k|            ps_codec->i4_rasl_output_flag = (0 != ps_codec->i4_cra_as_first_pic) ? 0 : 1;
  ------------------
  |  Branch (362:45): [True: 409, False: 721]
  ------------------
  363|  1.13k|            break;
  364|       |
  365|  92.2k|        default:
  ------------------
  |  Branch (365:9): [True: 92.2k, False: 20.9k]
  ------------------
  366|  92.2k|            break;
  367|   113k|    }
  368|       |
  369|   113k|    switch(s_nal.i1_nal_unit_type)
  370|   113k|    {
  371|    631|        case NAL_BLA_W_LP    :
  ------------------
  |  Branch (371:9): [True: 631, False: 112k]
  ------------------
  372|  2.01k|        case NAL_BLA_W_DLP   :
  ------------------
  |  Branch (372:9): [True: 1.38k, False: 111k]
  ------------------
  373|  3.32k|        case NAL_BLA_N_LP    :
  ------------------
  |  Branch (373:9): [True: 1.30k, False: 111k]
  ------------------
  374|  11.4k|        case NAL_IDR_W_LP    :
  ------------------
  |  Branch (374:9): [True: 8.10k, False: 105k]
  ------------------
  375|  19.8k|        case NAL_IDR_N_LP    :
  ------------------
  |  Branch (375:9): [True: 8.42k, False: 104k]
  ------------------
  376|  20.9k|        case NAL_CRA         :
  ------------------
  |  Branch (376:9): [True: 1.13k, False: 112k]
  ------------------
  377|  48.6k|        case NAL_TRAIL_N     :
  ------------------
  |  Branch (377:9): [True: 27.6k, False: 85.5k]
  ------------------
  378|  54.2k|        case NAL_TRAIL_R     :
  ------------------
  |  Branch (378:9): [True: 5.58k, False: 107k]
  ------------------
  379|  55.6k|        case NAL_TSA_N       :
  ------------------
  |  Branch (379:9): [True: 1.40k, False: 111k]
  ------------------
  380|  55.9k|        case NAL_TSA_R       :
  ------------------
  |  Branch (380:9): [True: 302, False: 112k]
  ------------------
  381|  58.5k|        case NAL_STSA_N      :
  ------------------
  |  Branch (381:9): [True: 2.60k, False: 110k]
  ------------------
  382|  58.7k|        case NAL_STSA_R      :
  ------------------
  |  Branch (382:9): [True: 223, False: 112k]
  ------------------
  383|  58.8k|        case NAL_RADL_N      :
  ------------------
  |  Branch (383:9): [True: 55, False: 113k]
  ------------------
  384|  58.9k|        case NAL_RADL_R      :
  ------------------
  |  Branch (384:9): [True: 80, False: 113k]
  ------------------
  385|  59.6k|        case NAL_RASL_N      :
  ------------------
  |  Branch (385:9): [True: 775, False: 112k]
  ------------------
  386|  60.7k|        case NAL_RASL_R      :
  ------------------
  |  Branch (386:9): [True: 1.08k, False: 112k]
  ------------------
  387|  60.7k|            if(ps_codec->i4_header_mode)
  ------------------
  |  Branch (387:16): [True: 16.1k, False: 44.5k]
  ------------------
  388|  16.1k|                return IHEVCD_SLICE_IN_HEADER_MODE;
  389|       |
  390|  44.5k|            if((0 == ps_codec->i4_sps_done) ||
  ------------------
  |  Branch (390:16): [True: 1.31k, False: 43.2k]
  ------------------
  391|  44.5k|                            (0 == ps_codec->i4_pps_done))
  ------------------
  |  Branch (391:29): [True: 892, False: 42.3k]
  ------------------
  392|  2.20k|            {
  393|  2.20k|                return IHEVCD_INVALID_HEADER;
  394|  2.20k|            }
  395|       |
  396|  42.3k|            ps_codec->i4_header_in_slice_mode = 0;
  397|  42.3k|            ps_codec->i4_cra_as_first_pic = 0;
  398|       |
  399|  42.3k|            ret = ihevcd_parse_slice_header(ps_codec, &s_nal);
  400|  42.3k|            DEBUG_PRINT_NAL_INFO(ps_codec, s_nal.i1_nal_unit_type);
  401|  42.3k|            if(ret == (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (401:16): [True: 17.4k, False: 24.9k]
  ------------------
  402|  17.4k|            {
  403|  17.4k|                if((s_nal.i1_nal_unit_type != NAL_RASL_N && s_nal.i1_nal_unit_type != NAL_RASL_R) ||
  ------------------
  |  Branch (403:21): [True: 17.3k, False: 53]
  |  Branch (403:61): [True: 17.0k, False: 348]
  ------------------
  404|  17.4k|                                ps_codec->i4_rasl_output_flag ||
  ------------------
  |  Branch (404:33): [True: 18, False: 383]
  ------------------
  405|  17.4k|                                ps_codec->i4_slice_error)
  ------------------
  |  Branch (405:33): [True: 41, False: 342]
  ------------------
  406|  17.0k|                    ret = ihevcd_parse_slice_data(ps_codec);
  407|  17.4k|            }
  408|  42.3k|            break;
  409|       |
  410|  2.22k|        case NAL_VPS        :
  ------------------
  |  Branch (410:9): [True: 2.22k, False: 110k]
  ------------------
  411|       |            // ret = ihevcd_parse_vps(ps_codec);
  412|  2.22k|            DEBUG_PRINT_NAL_INFO(ps_codec, s_nal.i1_nal_unit_type);
  413|  2.22k|            break;
  414|       |
  415|  20.3k|        case NAL_SPS        :
  ------------------
  |  Branch (415:9): [True: 20.3k, False: 92.8k]
  ------------------
  416|  20.3k|            if(0 == ps_codec->i4_header_mode)
  ------------------
  |  Branch (416:16): [True: 16.3k, False: 4.02k]
  ------------------
  417|  16.3k|            {
  418|  16.3k|                ps_codec->i4_header_in_slice_mode = 1;
  419|  16.3k|                if(ps_codec->i4_sps_done &&
  ------------------
  |  Branch (419:20): [True: 15.0k, False: 1.30k]
  ------------------
  420|  16.3k|                                ps_codec->i4_pic_present)
  ------------------
  |  Branch (420:33): [True: 1.22k, False: 13.8k]
  ------------------
  421|  1.22k|                    break;
  422|  16.3k|            }
  423|       |
  424|  19.1k|            ret = ihevcd_parse_sps(ps_codec);
  425|  19.1k|            if(ret == (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (425:16): [True: 8.29k, False: 10.8k]
  ------------------
  426|  8.29k|            {
  427|  8.29k|                sps_t *ps_sps = ps_codec->ps_sps_base + MAX_SPS_CNT - 1;
  ------------------
  |  |  317|  8.29k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  428|  8.29k|                ihevcd_copy_sps(ps_codec, ps_sps->i1_sps_id, MAX_SPS_CNT - 1);
  ------------------
  |  |  317|  8.29k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  429|  8.29k|            }
  430|  19.1k|            ps_codec->i4_error_code = ret;
  431|       |
  432|  19.1k|            DEBUG_PRINT_NAL_INFO(ps_codec, s_nal.i1_nal_unit_type);
  433|  19.1k|            break;
  434|       |
  435|  17.6k|        case NAL_PPS        :
  ------------------
  |  Branch (435:9): [True: 17.6k, False: 95.5k]
  ------------------
  436|  17.6k|            if(0 == ps_codec->i4_header_mode)
  ------------------
  |  Branch (436:16): [True: 16.1k, False: 1.50k]
  ------------------
  437|  16.1k|            {
  438|  16.1k|                ps_codec->i4_header_in_slice_mode = 1;
  439|  16.1k|                if(ps_codec->i4_pps_done &&
  ------------------
  |  Branch (439:20): [True: 14.4k, False: 1.72k]
  ------------------
  440|  16.1k|                                ps_codec->i4_pic_present)
  ------------------
  |  Branch (440:33): [True: 3.39k, False: 11.0k]
  ------------------
  441|  3.39k|                    break;
  442|  16.1k|            }
  443|       |
  444|  14.2k|            ret = ihevcd_parse_pps(ps_codec);
  445|  14.2k|            if(ret == (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (445:16): [True: 10.4k, False: 3.79k]
  ------------------
  446|  10.4k|            {
  447|  10.4k|                pps_t *ps_pps = ps_codec->ps_pps_base + MAX_PPS_CNT - 1;
  ------------------
  |  |  334|  10.4k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  448|  10.4k|                ihevcd_copy_pps(ps_codec, ps_pps->i1_pps_id, MAX_PPS_CNT - 1);
  ------------------
  |  |  334|  10.4k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  449|  10.4k|            }
  450|  14.2k|            ps_codec->i4_error_code = ret;
  451|  14.2k|            DEBUG_PRINT_NAL_INFO(ps_codec, s_nal.i1_nal_unit_type);
  452|  14.2k|            break;
  453|       |
  454|  6.40k|        case NAL_PREFIX_SEI:
  ------------------
  |  Branch (454:9): [True: 6.40k, False: 106k]
  ------------------
  455|  6.72k|        case NAL_SUFFIX_SEI:
  ------------------
  |  Branch (455:9): [True: 324, False: 112k]
  ------------------
  456|  6.72k|            if(IVD_DECODE_HEADER == ps_codec->i4_header_mode)
  ------------------
  |  Branch (456:16): [True: 419, False: 6.30k]
  ------------------
  457|    419|            {
  458|    419|                return IHEVCD_SLICE_IN_HEADER_MODE;
  459|    419|            }
  460|       |
  461|  6.30k|            ret = ihevcd_parse_sei(ps_codec, &s_nal);
  462|  6.30k|            break;
  463|       |
  464|     36|        case NAL_EOS        :
  ------------------
  |  Branch (464:9): [True: 36, False: 113k]
  ------------------
  465|     36|            ps_codec->i4_cra_as_first_pic = 1;
  466|     36|            break;
  467|       |
  468|  5.41k|        default:
  ------------------
  |  Branch (468:9): [True: 5.41k, False: 107k]
  ------------------
  469|  5.41k|            DEBUG_PRINT_NAL_INFO(ps_codec, s_nal.i1_nal_unit_type);
  470|  5.41k|            break;
  471|   113k|    }
  472|       |
  473|  94.3k|    return ret;
  474|   113k|}

ihevcd_parse_pred_wt_ofst:
  152|  6.38k|{
  153|  6.38k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  154|  6.38k|    WORD32 value;
  155|  6.38k|    UWORD32 u4_value;
  156|  6.38k|    WORD32 i;
  157|       |
  158|  6.38k|    pred_wt_ofst_t *ps_wt_ofst = &ps_slice_hdr->s_wt_ofst;
  159|  6.38k|    UNUSED(ps_pps);
  ------------------
  |  |   38|  6.38k|#define UNUSED(x) ((void)(x))
  ------------------
  160|       |
  161|  6.38k|    UEV_PARSE("luma_log2_weight_denom", u4_value, ps_bitstrm);
  ------------------
  |  |  155|  6.38k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  162|  6.38k|    if(u4_value > 7)
  ------------------
  |  Branch (162:8): [True: 4.53k, False: 1.85k]
  ------------------
  163|  4.53k|    {
  164|  4.53k|        return IHEVCD_INVALID_PARAMETER;
  165|  4.53k|    }
  166|  1.85k|    ps_wt_ofst->i1_luma_log2_weight_denom = u4_value;
  167|       |
  168|  1.85k|    if(ps_sps->i1_chroma_format_idc != 0)
  ------------------
  |  Branch (168:8): [True: 1.85k, False: 0]
  ------------------
  169|  1.85k|    {
  170|  1.85k|        SEV_PARSE("delta_chroma_log2_weight_denom", value, ps_bitstrm);
  ------------------
  |  |  162|  1.85k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  171|  1.85k|        if((value < -7) || (value > 7))
  ------------------
  |  Branch (171:12): [True: 47, False: 1.80k]
  |  Branch (171:28): [True: 391, False: 1.41k]
  ------------------
  172|    438|        {
  173|    438|            return IHEVCD_INVALID_PARAMETER;
  174|    438|        }
  175|       |
  176|  1.41k|        if(((ps_wt_ofst->i1_luma_log2_weight_denom + value) < 0) ||
  ------------------
  |  Branch (176:12): [True: 11, False: 1.40k]
  ------------------
  177|  1.41k|                ((ps_wt_ofst->i1_luma_log2_weight_denom + value) > 7))
  ------------------
  |  Branch (177:17): [True: 14, False: 1.39k]
  ------------------
  178|     25|        {
  179|     25|            return IHEVCD_INVALID_PARAMETER;
  180|     25|        }
  181|  1.39k|        ps_wt_ofst->i1_chroma_log2_weight_denom = ps_wt_ofst->i1_luma_log2_weight_denom + value;
  182|  1.39k|    }
  183|       |
  184|  6.48k|    for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (184:16): [True: 5.09k, False: 1.39k]
  ------------------
  185|  5.09k|    {
  186|  5.09k|        BITS_PARSE("luma_weight_l0_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  5.09k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  187|  5.09k|        ps_wt_ofst->i1_luma_weight_l0_flag[i] = value;
  188|  5.09k|    }
  189|       |
  190|       |
  191|       |
  192|  1.39k|    if(ps_sps->i1_chroma_format_idc != 0)
  ------------------
  |  Branch (192:8): [True: 1.39k, False: 0]
  ------------------
  193|  1.39k|    {
  194|  6.48k|        for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (194:20): [True: 5.09k, False: 1.39k]
  ------------------
  195|  5.09k|        {
  196|  5.09k|            BITS_PARSE("chroma_weight_l0_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  5.09k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  197|  5.09k|            ps_wt_ofst->i1_chroma_weight_l0_flag[i] = value;
  198|  5.09k|        }
  199|  1.39k|    }
  200|      0|    else
  201|      0|    {
  202|      0|        for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (202:20): [True: 0, False: 0]
  ------------------
  203|      0|        {
  204|      0|            ps_wt_ofst->i1_chroma_weight_l0_flag[i] = 0;
  205|      0|        }
  206|      0|    }
  207|       |
  208|       |
  209|  5.50k|    for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (209:16): [True: 4.65k, False: 848]
  ------------------
  210|  4.65k|    {
  211|  4.65k|        if(ps_wt_ofst->i1_luma_weight_l0_flag[i])
  ------------------
  |  Branch (211:12): [True: 2.19k, False: 2.45k]
  ------------------
  212|  2.19k|        {
  213|  2.19k|            SEV_PARSE("delta_luma_weight_l0[ i ]", value, ps_bitstrm);
  ------------------
  |  |  162|  2.19k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  214|  2.19k|            if( value < -128 || value > 127 )
  ------------------
  |  Branch (214:17): [True: 131, False: 2.06k]
  |  Branch (214:33): [True: 137, False: 1.93k]
  ------------------
  215|    268|            {
  216|    268|                return IHEVCD_INVALID_PARAMETER;
  217|    268|            }
  218|       |
  219|  1.93k|            ps_wt_ofst->i2_luma_weight_l0[i] = (1 << ps_wt_ofst->i1_luma_log2_weight_denom) + value;
  220|       |
  221|  1.93k|            SEV_PARSE("luma_offset_l0[ i ]", value, ps_bitstrm);
  ------------------
  |  |  162|  1.93k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  222|  1.93k|            if( value < -128 || value > 127 )
  ------------------
  |  Branch (222:17): [True: 1, False: 1.93k]
  |  Branch (222:33): [True: 0, False: 1.93k]
  ------------------
  223|      1|            {
  224|      1|                return IHEVCD_INVALID_PARAMETER;
  225|      1|            }
  226|  1.93k|            ps_wt_ofst->i2_luma_offset_l0[i] = value;
  227|       |
  228|  1.93k|        }
  229|  2.45k|        else
  230|  2.45k|        {
  231|  2.45k|            ps_wt_ofst->i2_luma_weight_l0[i] = (1 << ps_wt_ofst->i1_luma_log2_weight_denom);
  232|  2.45k|            ps_wt_ofst->i2_luma_offset_l0[i] = 0;
  233|  2.45k|        }
  234|  4.38k|        if(ps_wt_ofst->i1_chroma_weight_l0_flag[i])
  ------------------
  |  Branch (234:12): [True: 2.32k, False: 2.05k]
  ------------------
  235|  2.32k|        {
  236|  2.32k|            WORD32 ofst;
  237|  2.32k|            WORD32 shift = (1 << (BIT_DEPTH_CHROMA - 1));
  ------------------
  |  |  271|  2.32k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  269|  2.32k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  238|  2.32k|            SEV_PARSE("delta_chroma_weight_l0[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|  2.32k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  239|  2.32k|            if(value < -128 || value > 127)
  ------------------
  |  Branch (239:16): [True: 128, False: 2.20k]
  |  Branch (239:32): [True: 10, False: 2.19k]
  ------------------
  240|    138|            {
  241|    138|                return IHEVCD_INVALID_PARAMETER;
  242|    138|            }
  243|  2.19k|            ps_wt_ofst->i2_chroma_weight_l0_cb[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom) + value;
  244|       |
  245|       |
  246|  2.19k|            SEV_PARSE("delta_chroma_offset_l0[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|  2.19k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  247|  2.19k|            if( value < -512 || value > 511 )
  ------------------
  |  Branch (247:17): [True: 0, False: 2.19k]
  |  Branch (247:33): [True: 1, False: 2.18k]
  ------------------
  248|      1|            {
  249|      1|                return IHEVCD_INVALID_PARAMETER;
  250|      1|            }
  251|  2.18k|            ofst = ((shift * ps_wt_ofst->i2_chroma_weight_l0_cb[i]) >> ps_wt_ofst->i1_chroma_log2_weight_denom);
  252|  2.18k|            ofst = value - ofst + shift;
  253|       |
  254|  2.18k|            ps_wt_ofst->i2_chroma_offset_l0_cb[i] = CLIP_S8(ofst);
  ------------------
  |  |   41|  2.18k|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|  2.18k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 1, False: 2.18k]
  |  |  |  |  |  Branch (40:53): [True: 7, False: 2.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  255|       |
  256|  2.18k|            SEV_PARSE("delta_chroma_weight_l0[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|  2.18k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  257|  2.18k|            if(value < -128 || value > 127)
  ------------------
  |  Branch (257:16): [True: 132, False: 2.05k]
  |  Branch (257:32): [True: 2, False: 2.05k]
  ------------------
  258|    134|            {
  259|    134|                return IHEVCD_INVALID_PARAMETER;
  260|    134|            }
  261|  2.05k|            ps_wt_ofst->i2_chroma_weight_l0_cr[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom) + value;
  262|       |
  263|       |
  264|  2.05k|            SEV_PARSE("delta_chroma_offset_l0[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|  2.05k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  265|  2.05k|            if( value < -512 || value > 511 )
  ------------------
  |  Branch (265:17): [True: 0, False: 2.05k]
  |  Branch (265:33): [True: 0, False: 2.05k]
  ------------------
  266|      0|            {
  267|      0|                return IHEVCD_INVALID_PARAMETER;
  268|      0|            }
  269|  2.05k|            ofst = ((shift * ps_wt_ofst->i2_chroma_weight_l0_cr[i]) >> ps_wt_ofst->i1_chroma_log2_weight_denom);
  270|  2.05k|            ofst = value - ofst + shift;
  271|       |
  272|  2.05k|            ps_wt_ofst->i2_chroma_offset_l0_cr[i] = CLIP_S8(ofst);
  ------------------
  |  |   41|  2.05k|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|  2.05k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 7, False: 2.04k]
  |  |  |  |  |  Branch (40:53): [True: 150, False: 1.89k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|       |
  274|  2.05k|        }
  275|  2.05k|        else
  276|  2.05k|        {
  277|  2.05k|            ps_wt_ofst->i2_chroma_weight_l0_cb[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom);
  278|  2.05k|            ps_wt_ofst->i2_chroma_weight_l0_cr[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom);
  279|       |
  280|  2.05k|            ps_wt_ofst->i2_chroma_offset_l0_cb[i] = 0;
  281|  2.05k|            ps_wt_ofst->i2_chroma_offset_l0_cr[i] = 0;
  282|  2.05k|        }
  283|  4.38k|    }
  284|    848|    if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (284:8): [True: 626, False: 222]
  ------------------
  285|    626|    {
  286|  1.92k|        for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (286:20): [True: 1.30k, False: 626]
  ------------------
  287|  1.30k|        {
  288|  1.30k|            BITS_PARSE("luma_weight_l1_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  1.30k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  289|  1.30k|            ps_wt_ofst->i1_luma_weight_l1_flag[i] = value;
  290|  1.30k|        }
  291|       |
  292|    626|        if(ps_sps->i1_chroma_format_idc != 0)
  ------------------
  |  Branch (292:12): [True: 626, False: 0]
  ------------------
  293|    626|        {
  294|  1.92k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (294:24): [True: 1.30k, False: 626]
  ------------------
  295|  1.30k|            {
  296|  1.30k|                BITS_PARSE("chroma_weight_l1_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  1.30k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  297|  1.30k|                ps_wt_ofst->i1_chroma_weight_l1_flag[i] = value;
  298|  1.30k|            }
  299|    626|        }
  300|      0|        else
  301|      0|        {
  302|      0|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (302:24): [True: 0, False: 0]
  ------------------
  303|      0|            {
  304|      0|                ps_wt_ofst->i1_chroma_weight_l1_flag[i] = 0;
  305|      0|            }
  306|      0|        }
  307|       |
  308|  1.63k|        for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (308:20): [True: 1.30k, False: 336]
  ------------------
  309|  1.30k|        {
  310|  1.30k|            if(ps_wt_ofst->i1_luma_weight_l1_flag[i])
  ------------------
  |  Branch (310:16): [True: 695, False: 606]
  ------------------
  311|    695|            {
  312|    695|                SEV_PARSE("delta_luma_weight_l1[ i ]", value, ps_bitstrm);
  ------------------
  |  |  162|    695|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  313|    695|                if( value < -128 || value > 127 )
  ------------------
  |  Branch (313:21): [True: 23, False: 672]
  |  Branch (313:37): [True: 0, False: 672]
  ------------------
  314|     23|                {
  315|     23|                    return IHEVCD_INVALID_PARAMETER;
  316|     23|                }
  317|       |
  318|    672|                ps_wt_ofst->i2_luma_weight_l1[i] = (1 << ps_wt_ofst->i1_luma_log2_weight_denom) + value;
  319|       |
  320|    672|                SEV_PARSE("luma_offset_l1[ i ]", value, ps_bitstrm);
  ------------------
  |  |  162|    672|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  321|    672|                if( value < -128 || value > 127 )
  ------------------
  |  Branch (321:21): [True: 0, False: 672]
  |  Branch (321:37): [True: 0, False: 672]
  ------------------
  322|      0|                {
  323|      0|                    return IHEVCD_INVALID_PARAMETER;
  324|      0|                }
  325|    672|                ps_wt_ofst->i2_luma_offset_l1[i] = value;
  326|       |
  327|    672|            }
  328|    606|            else
  329|    606|            {
  330|    606|                ps_wt_ofst->i2_luma_weight_l1[i] = (1 << ps_wt_ofst->i1_luma_log2_weight_denom);
  331|    606|                ps_wt_ofst->i2_luma_offset_l1[i] = 0;
  332|    606|            }
  333|       |
  334|  1.27k|            if(ps_wt_ofst->i1_chroma_weight_l1_flag[i])
  ------------------
  |  Branch (334:16): [True: 1.05k, False: 228]
  ------------------
  335|  1.05k|            {
  336|  1.05k|                WORD32 ofst;
  337|  1.05k|                WORD32 shift = (1 << (BIT_DEPTH_CHROMA - 1));
  ------------------
  |  |  271|  1.05k|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  269|  1.05k|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  338|  1.05k|                SEV_PARSE("delta_chroma_weight_l1[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|  1.05k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  339|  1.05k|                if(value < -128 || value > 127)
  ------------------
  |  Branch (339:20): [True: 260, False: 790]
  |  Branch (339:36): [True: 0, False: 790]
  ------------------
  340|    260|                {
  341|    260|                    return IHEVCD_INVALID_PARAMETER;
  342|    260|                }
  343|    790|                ps_wt_ofst->i2_chroma_weight_l1_cb[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom) + value;;
  344|       |
  345|       |
  346|    790|                SEV_PARSE("delta_chroma_offset_l1[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|    790|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  347|    790|                if( value < -512 || value > 511 )
  ------------------
  |  Branch (347:21): [True: 0, False: 790]
  |  Branch (347:37): [True: 0, False: 790]
  ------------------
  348|      0|                {
  349|      0|                    return IHEVCD_INVALID_PARAMETER;
  350|      0|                }
  351|    790|                ofst = ((shift * ps_wt_ofst->i2_chroma_weight_l1_cb[i]) >> ps_wt_ofst->i1_chroma_log2_weight_denom);
  352|    790|                ofst = value - ofst + shift;
  353|       |
  354|    790|                ps_wt_ofst->i2_chroma_offset_l1_cb[i] = CLIP_S8(ofst);;
  ------------------
  |  |   41|    790|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|    790|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2, False: 788]
  |  |  |  |  |  Branch (40:53): [True: 25, False: 763]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  355|       |
  356|    790|                SEV_PARSE("delta_chroma_weight_l1[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|    790|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  357|    790|                if(value < -128 || value > 127)
  ------------------
  |  Branch (357:20): [True: 0, False: 790]
  |  Branch (357:36): [True: 0, False: 790]
  ------------------
  358|      0|                {
  359|      0|                    return IHEVCD_INVALID_PARAMETER;
  360|      0|                }
  361|    790|                ps_wt_ofst->i2_chroma_weight_l1_cr[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom) + value;
  362|       |
  363|       |
  364|    790|                SEV_PARSE("delta_chroma_offset_l1[ i ][ j ]", value, ps_bitstrm);
  ------------------
  |  |  162|    790|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  365|    790|                if( value < -512 || value > 511 )
  ------------------
  |  Branch (365:21): [True: 0, False: 790]
  |  Branch (365:37): [True: 7, False: 783]
  ------------------
  366|      7|                {
  367|      7|                    return IHEVCD_INVALID_PARAMETER;
  368|      7|                }
  369|    783|                ofst = ((shift * ps_wt_ofst->i2_chroma_weight_l1_cr[i]) >> ps_wt_ofst->i1_chroma_log2_weight_denom);
  370|    783|                ofst = value - ofst + shift;
  371|       |
  372|    783|                ps_wt_ofst->i2_chroma_offset_l1_cr[i] = CLIP_S8(ofst);;
  ------------------
  |  |   41|    783|#define CLIP_S8(x) CLIP3((x), -128,  127);
  |  |  ------------------
  |  |  |  |   40|    783|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:29): [True: 2, False: 781]
  |  |  |  |  |  Branch (40:53): [True: 128, False: 653]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  373|       |
  374|    783|            }
  375|    228|            else
  376|    228|            {
  377|    228|                ps_wt_ofst->i2_chroma_weight_l1_cb[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom);
  378|    228|                ps_wt_ofst->i2_chroma_weight_l1_cr[i] = (1 << ps_wt_ofst->i1_chroma_log2_weight_denom);
  379|       |
  380|    228|                ps_wt_ofst->i2_chroma_offset_l1_cb[i] = 0;
  381|    228|                ps_wt_ofst->i2_chroma_offset_l1_cr[i] = 0;
  382|       |
  383|    228|            }
  384|  1.27k|        }
  385|    626|    }
  386|    558|    return ret;
  387|    848|}
ihevcd_short_term_ref_pic_set:
  422|  46.2k|{
  423|  46.2k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  424|  46.2k|    UWORD32 value;
  425|  46.2k|    stref_picset_t *ps_stref_picset_ref;
  426|  46.2k|    WORD32 delta_idx, delta_rps;
  427|  46.2k|    WORD32 r_idx;
  428|  46.2k|    WORD32 i;
  429|  46.2k|    WORD32 j, k, temp;
  430|  46.2k|    if(idx > 0)
  ------------------
  |  Branch (430:8): [True: 38.8k, False: 7.43k]
  ------------------
  431|  38.8k|    {
  432|  38.8k|        BITS_PARSE("inter_ref_pic_set_prediction_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  38.8k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  433|  38.8k|        ps_stref_picset->i1_inter_ref_pic_set_prediction_flag = value;
  434|  38.8k|    }
  435|  7.43k|    else
  436|  7.43k|        ps_stref_picset->i1_inter_ref_pic_set_prediction_flag = 0;
  437|       |
  438|  46.2k|    if(ps_stref_picset->i1_inter_ref_pic_set_prediction_flag)
  ------------------
  |  Branch (438:8): [True: 34.7k, False: 11.5k]
  ------------------
  439|  34.7k|    {
  440|  34.7k|        WORD32 delta_rps_sign;
  441|  34.7k|        WORD32 abs_delta_rps;
  442|  34.7k|        WORD32 num_neg_pics = 0;
  443|  34.7k|        WORD32 num_pos_pics = 0;
  444|  34.7k|        WORD32 num_pics = 0;
  445|       |
  446|  34.7k|        if(idx == num_short_term_ref_pic_sets)
  ------------------
  |  Branch (446:12): [True: 612, False: 34.1k]
  ------------------
  447|    612|        {
  448|    612|            UEV_PARSE("delta_idx_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|    612|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  449|    612|            if(value > num_short_term_ref_pic_sets - 1)
  ------------------
  |  Branch (449:16): [True: 8, False: 604]
  ------------------
  450|      8|            {
  451|      8|                return IHEVCD_INVALID_PARAMETER;
  452|      8|            }
  453|    604|            delta_idx = value + 1;
  454|    604|        }
  455|  34.1k|        else
  456|  34.1k|        {
  457|  34.1k|            delta_idx = 1;
  458|  34.1k|        }
  459|  34.7k|        r_idx = idx - delta_idx;
  460|  34.7k|        r_idx = CLIP3(r_idx, 0, idx - 1);
  ------------------
  |  |   40|  34.7k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 34.7k]
  |  |  |  Branch (40:53): [True: 0, False: 34.7k]
  |  |  ------------------
  ------------------
  461|       |
  462|  34.7k|        ps_stref_picset_ref = ps_stref_picset_base + r_idx;
  463|       |
  464|  34.7k|        BITS_PARSE("delta_rps_sign", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  34.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  465|  34.7k|        delta_rps_sign = value;
  466|       |
  467|  34.7k|        UEV_PARSE("abs_delta_rps_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  34.7k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  468|  34.7k|        if(value > 32767)
  ------------------
  |  Branch (468:12): [True: 19, False: 34.6k]
  ------------------
  469|     19|        {
  470|     19|            return IHEVCD_INVALID_PARAMETER;
  471|     19|        }
  472|  34.6k|        abs_delta_rps = value + 1;
  473|       |
  474|  34.6k|        delta_rps = (1 - 2 * delta_rps_sign) * (abs_delta_rps);
  475|       |
  476|       |
  477|       |
  478|   205k|        for(i = 0; i <= ps_stref_picset_ref->i1_num_delta_pocs; i++)
  ------------------
  |  Branch (478:20): [True: 170k, False: 34.6k]
  ------------------
  479|   170k|        {
  480|   170k|            WORD32 ref_idc;
  481|       |
  482|       |            /*****************************************************************/
  483|       |            /* ref_idc is parsed as below                                    */
  484|       |            /* bits "1" ref_idc 1                                            */
  485|       |            /* bits "01" ref_idc 2                                           */
  486|       |            /* bits "00" ref_idc 0                                           */
  487|       |            /*****************************************************************/
  488|   170k|            BITS_PARSE("used_by_curr_pic_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|   170k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  489|   170k|            ref_idc = value;
  490|   170k|            ps_stref_picset->ai1_used[num_pics] = value;
  491|       |            /* If ref_idc is zero check for next bit */
  492|   170k|            if(0 == ref_idc)
  ------------------
  |  Branch (492:16): [True: 25.3k, False: 145k]
  ------------------
  493|  25.3k|            {
  494|  25.3k|                BITS_PARSE("use_delta_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  25.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  495|  25.3k|                ref_idc = value << 1;
  496|  25.3k|            }
  497|   170k|            if((ref_idc == 1) || (ref_idc == 2))
  ------------------
  |  Branch (497:16): [True: 145k, False: 25.3k]
  |  Branch (497:34): [True: 398, False: 24.9k]
  ------------------
  498|   145k|            {
  499|   145k|                WORD32 delta_poc;
  500|   145k|                delta_poc = delta_rps;
  501|   145k|                delta_poc +=
  502|   145k|                                ((i < ps_stref_picset_ref->i1_num_delta_pocs) ?
  ------------------
  |  Branch (502:34): [True: 124k, False: 21.4k]
  ------------------
  503|   124k|                                ps_stref_picset_ref->ai2_delta_poc[i] :
  504|   145k|                                0);
  505|       |
  506|   145k|                ps_stref_picset->ai2_delta_poc[num_pics] = delta_poc;
  507|       |
  508|   145k|                if(delta_poc < 0)
  ------------------
  |  Branch (508:20): [True: 73.2k, False: 72.4k]
  ------------------
  509|  73.2k|                {
  510|  73.2k|                    num_neg_pics++;
  511|  73.2k|                }
  512|  72.4k|                else
  513|  72.4k|                {
  514|  72.4k|                    num_pos_pics++;
  515|  72.4k|                }
  516|   145k|                num_pics++;
  517|   145k|            }
  518|   170k|            ps_stref_picset->ai1_ref_idc[i] = ref_idc;
  519|   170k|        }
  520|       |
  521|  34.6k|        num_neg_pics = CLIP3(num_neg_pics, 0, MAX_DPB_SIZE - 1);
  ------------------
  |  |   40|  34.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 34.6k]
  |  |  |  Branch (40:53): [True: 0, False: 34.6k]
  |  |  ------------------
  ------------------
  522|  34.6k|        num_pos_pics = CLIP3(num_pos_pics, 0, (MAX_DPB_SIZE - 1 - num_neg_pics));
  ------------------
  |  |   40|  34.6k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 11, False: 34.6k]
  |  |  |  Branch (40:53): [True: 0, False: 34.6k]
  |  |  ------------------
  ------------------
  523|  34.6k|        num_pics = num_neg_pics + num_pos_pics;
  524|       |
  525|  34.6k|        ps_stref_picset->i1_num_ref_idc =
  526|  34.6k|                        ps_stref_picset_ref->i1_num_delta_pocs + 1;
  527|  34.6k|        ps_stref_picset->i1_num_delta_pocs = num_pics;
  528|  34.6k|        ps_stref_picset->i1_num_pos_pics = num_pos_pics;
  529|  34.6k|        ps_stref_picset->i1_num_neg_pics = num_neg_pics;
  530|       |
  531|       |
  532|   145k|        for(j = 1; j < num_pics; j++)
  ------------------
  |  Branch (532:20): [True: 111k, False: 34.6k]
  ------------------
  533|   111k|        {
  534|   111k|            WORD32 delta_poc = ps_stref_picset->ai2_delta_poc[j];
  535|   111k|            WORD8 i1_used = ps_stref_picset->ai1_used[j];
  536|   363k|            for(k = j - 1; k >= 0; k--)
  ------------------
  |  Branch (536:28): [True: 252k, False: 111k]
  ------------------
  537|   252k|            {
  538|   252k|                temp = ps_stref_picset->ai2_delta_poc[k];
  539|   252k|                if(delta_poc < temp)
  ------------------
  |  Branch (539:20): [True: 58.7k, False: 193k]
  ------------------
  540|  58.7k|                {
  541|  58.7k|                    ps_stref_picset->ai2_delta_poc[k + 1] = temp;
  542|  58.7k|                    ps_stref_picset->ai1_used[k + 1] = ps_stref_picset->ai1_used[k];
  543|  58.7k|                    ps_stref_picset->ai2_delta_poc[k] = delta_poc;
  544|  58.7k|                    ps_stref_picset->ai1_used[k] = i1_used;
  545|  58.7k|                }
  546|   252k|            }
  547|   111k|        }
  548|       |        // flip the negative values to largest first
  549|  63.5k|        for(j = 0, k = num_neg_pics - 1; j < num_neg_pics >> 1; j++, k--)
  ------------------
  |  Branch (549:42): [True: 28.8k, False: 34.6k]
  ------------------
  550|  28.8k|        {
  551|  28.8k|            WORD32 delta_poc = ps_stref_picset->ai2_delta_poc[j];
  552|  28.8k|            WORD8 i1_used = ps_stref_picset->ai1_used[j];
  553|  28.8k|            ps_stref_picset->ai2_delta_poc[j] = ps_stref_picset->ai2_delta_poc[k];
  554|  28.8k|            ps_stref_picset->ai1_used[j] = ps_stref_picset->ai1_used[k];
  555|  28.8k|            ps_stref_picset->ai2_delta_poc[k] = delta_poc;
  556|  28.8k|            ps_stref_picset->ai1_used[k] = i1_used;
  557|  28.8k|        }
  558|       |
  559|  34.6k|    }
  560|  11.5k|    else
  561|  11.5k|    {
  562|  11.5k|        WORD32 prev_poc = 0;
  563|  11.5k|        WORD32 poc;
  564|       |
  565|  11.5k|        UEV_PARSE("num_negative_pics", value, ps_bitstrm);
  ------------------
  |  |  155|  11.5k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  566|  11.5k|        if(value > MAX_DPB_SIZE - 1)
  ------------------
  |  |  281|  11.5k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (566:12): [True: 206, False: 11.3k]
  ------------------
  567|    206|        {
  568|    206|            return IHEVCD_INVALID_PARAMETER;
  569|    206|        }
  570|  11.3k|        ps_stref_picset->i1_num_neg_pics = value;
  571|       |
  572|  11.3k|        UEV_PARSE("num_positive_pics", value, ps_bitstrm);
  ------------------
  |  |  155|  11.3k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  573|  11.3k|        if(value > (MAX_DPB_SIZE - 1 - ps_stref_picset->i1_num_neg_pics))
  ------------------
  |  |  281|  11.3k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (573:12): [True: 53, False: 11.2k]
  ------------------
  574|     53|        {
  575|     53|            return IHEVCD_INVALID_PARAMETER;
  576|     53|        }
  577|  11.2k|        ps_stref_picset->i1_num_pos_pics = value;
  578|       |
  579|  11.2k|        ps_stref_picset->i1_num_delta_pocs =
  580|  11.2k|                        ps_stref_picset->i1_num_neg_pics +
  581|  11.2k|                        ps_stref_picset->i1_num_pos_pics;
  582|       |
  583|       |
  584|  21.3k|        for(i = 0; i < ps_stref_picset->i1_num_neg_pics; i++)
  ------------------
  |  Branch (584:20): [True: 10.0k, False: 11.2k]
  ------------------
  585|  10.0k|        {
  586|  10.0k|            UEV_PARSE("delta_poc_s0_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  10.0k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  587|  10.0k|            if(value > 32767)
  ------------------
  |  Branch (587:16): [True: 34, False: 10.0k]
  ------------------
  588|     34|            {
  589|     34|                return IHEVCD_INVALID_PARAMETER;
  590|     34|            }
  591|  10.0k|            poc = prev_poc - ((WORD32)(value + 1));
  592|  10.0k|            prev_poc = poc;
  593|  10.0k|            ps_stref_picset->ai2_delta_poc[i] = poc;
  594|       |
  595|  10.0k|            BITS_PARSE("used_by_curr_pic_s0_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  596|  10.0k|            ps_stref_picset->ai1_used[i] = value;
  597|       |
  598|  10.0k|        }
  599|  11.2k|        prev_poc = 0;
  600|  11.2k|        for(i = ps_stref_picset->i1_num_neg_pics;
  601|  16.7k|                        i < ps_stref_picset->i1_num_delta_pocs;
  ------------------
  |  Branch (601:25): [True: 5.52k, False: 11.2k]
  ------------------
  602|  11.2k|                        i++)
  603|  5.52k|        {
  604|  5.52k|            UEV_PARSE("delta_poc_s1_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  5.52k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  605|  5.52k|            if(value > 32767)
  ------------------
  |  Branch (605:16): [True: 21, False: 5.50k]
  ------------------
  606|     21|            {
  607|     21|                return IHEVCD_INVALID_PARAMETER;
  608|     21|            }
  609|  5.50k|            poc = prev_poc + (value + 1);
  610|  5.50k|            prev_poc = poc;
  611|  5.50k|            ps_stref_picset->ai2_delta_poc[i] = poc;
  612|       |
  613|  5.50k|            BITS_PARSE("used_by_curr_pic_s1_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  5.50k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  614|  5.50k|            ps_stref_picset->ai1_used[i] = value;
  615|       |
  616|  5.50k|        }
  617|       |
  618|  11.2k|    }
  619|       |
  620|  45.9k|    return ret;
  621|  46.2k|}
ihevcd_scaling_list_data:
 1170|  3.44k|{
 1171|  3.44k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1172|  3.44k|    WORD32 size_id;
 1173|  3.44k|    WORD32 matrix_id;
 1174|  3.44k|    WORD32 value, dc_value = 0;
 1175|  3.44k|    UWORD32 u4_value;
 1176|  3.44k|    WORD32 next_coef;
 1177|  3.44k|    WORD32 coef_num;
 1178|  3.44k|    WORD32 i, j, offset;
 1179|  3.44k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 1180|  3.44k|    WORD16 *pi2_scaling_mat_offset;
 1181|  3.44k|    WORD32 scaling_mat_offset[] = { 0, 16, 32, 48, 64, 80, 96, 160, 224, 288, 352, 416, 480, 736, 992, 1248, 1504, 1760, 2016, 3040 };
 1182|  3.44k|    UWORD8 *scan_table;
 1183|       |
 1184|  11.1k|    for(size_id = 0; size_id < 4; size_id++)
  ------------------
  |  Branch (1184:22): [True: 9.27k, False: 1.87k]
  ------------------
 1185|  9.27k|    {
 1186|  48.3k|        for(matrix_id = 0; matrix_id < ((size_id == 3) ? 2 : 6); matrix_id++)
  ------------------
  |  Branch (1186:28): [True: 40.6k, False: 7.71k]
  |  Branch (1186:41): [True: 5.72k, False: 42.6k]
  ------------------
 1187|  40.6k|        {
 1188|  40.6k|            WORD32 scaling_list_pred_mode_flag;
 1189|  40.6k|            WORD32 scaling_list_delta_coef;
 1190|  40.6k|            BITS_PARSE("scaling_list_pred_mode_flag", scaling_list_pred_mode_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  40.6k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1191|       |
 1192|  40.6k|            offset = size_id * 6 + matrix_id;
 1193|  40.6k|            pi2_scaling_mat_offset = pi2_scaling_mat + scaling_mat_offset[offset];
 1194|       |
 1195|  40.6k|            if(!scaling_list_pred_mode_flag)
  ------------------
  |  Branch (1195:16): [True: 32.6k, False: 8.02k]
  ------------------
 1196|  32.6k|            {
 1197|  32.6k|                WORD32 num_elements;
 1198|  32.6k|                UEV_PARSE("scaling_list_pred_matrix_id_delta", u4_value,
  ------------------
  |  |  155|  32.6k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1199|  32.6k|                          ps_bitstrm);
 1200|  32.6k|                if(u4_value > matrix_id)
  ------------------
  |  Branch (1200:20): [True: 1.47k, False: 31.1k]
  ------------------
 1201|  1.47k|                {
 1202|  1.47k|                    return IHEVCD_INVALID_PARAMETER;
 1203|  1.47k|                }
 1204|       |
 1205|  31.1k|                num_elements = (1 << (4 + (size_id << 1)));
 1206|  31.1k|                if(0 != u4_value)
  ------------------
  |  Branch (1206:20): [True: 30.9k, False: 269]
  ------------------
 1207|  30.9k|                    memmove(pi2_scaling_mat_offset, pi2_scaling_mat_offset - u4_value * num_elements, num_elements * sizeof(WORD16));
 1208|  31.1k|            }
 1209|  8.02k|            else
 1210|  8.02k|            {
 1211|  8.02k|                next_coef = 8;
 1212|  8.02k|                coef_num = MIN(64, (1 << (4 + (size_id << 1))));
  ------------------
  |  |   43|  8.02k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 3.92k, False: 4.09k]
  |  |  ------------------
  ------------------
 1213|       |
 1214|  8.02k|                if(size_id > 1)
  ------------------
  |  Branch (1214:20): [True: 3.92k, False: 4.09k]
  ------------------
 1215|  3.92k|                {
 1216|  3.92k|                    SEV_PARSE("scaling_list_dc_coef_minus8", value,
  ------------------
  |  |  162|  3.92k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 1217|  3.92k|                              ps_bitstrm);
 1218|  3.92k|                    if(value < -7 || value > 247)
  ------------------
  |  Branch (1218:24): [True: 0, False: 3.92k]
  |  Branch (1218:38): [True: 6, False: 3.91k]
  ------------------
 1219|      6|                    {
 1220|      6|                        return IHEVCD_INVALID_PARAMETER;
 1221|      6|                    }
 1222|  3.91k|                    next_coef = value + 8;
 1223|  3.91k|                    dc_value = next_coef;
 1224|  3.91k|                }
 1225|  8.01k|                if(size_id < 2)
  ------------------
  |  Branch (1225:20): [True: 4.09k, False: 3.91k]
  ------------------
 1226|  4.09k|                {
 1227|  4.09k|                    scan_table = (UWORD8 *)gapv_ihevc_invscan[size_id + 1];
 1228|       |
 1229|   165k|                    for(i = 0; i < coef_num; i++)
  ------------------
  |  Branch (1229:32): [True: 161k, False: 4.04k]
  ------------------
 1230|   161k|                    {
 1231|   161k|                        SEV_PARSE("scaling_list_delta_coef",
  ------------------
  |  |  162|   161k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 1232|   161k|                                  scaling_list_delta_coef, ps_bitstrm);
 1233|   161k|                        if((scaling_list_delta_coef < -256) || (scaling_list_delta_coef > 255))
  ------------------
  |  Branch (1233:28): [True: 42, False: 161k]
  |  Branch (1233:64): [True: 16, False: 161k]
  ------------------
 1234|     58|                        {
 1235|     58|                            return IHEVCD_INVALID_PARAMETER;
 1236|     58|                        }
 1237|   161k|                        next_coef = (next_coef + scaling_list_delta_coef + 256)
 1238|   161k|                                        % 256;
 1239|   161k|                        pi2_scaling_mat_offset[scan_table[i]] = next_coef;
 1240|   161k|                    }
 1241|  4.09k|                }
 1242|  3.91k|                else if(size_id == 2)
  ------------------
  |  Branch (1242:25): [True: 1.98k, False: 1.93k]
  ------------------
 1243|  1.98k|                {
 1244|  1.98k|                    scan_table = (UWORD8 *)gapv_ihevc_invscan[2];
 1245|       |
 1246|   128k|                    for(i = 0; i < coef_num; i++)
  ------------------
  |  Branch (1246:32): [True: 126k, False: 1.96k]
  ------------------
 1247|   126k|                    {
 1248|   126k|                        SEV_PARSE("scaling_list_delta_coef",
  ------------------
  |  |  162|   126k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 1249|   126k|                                  scaling_list_delta_coef, ps_bitstrm);
 1250|   126k|                        if((scaling_list_delta_coef < -256) || (scaling_list_delta_coef > 255))
  ------------------
  |  Branch (1250:28): [True: 4, False: 126k]
  |  Branch (1250:64): [True: 13, False: 126k]
  ------------------
 1251|     17|                        {
 1252|     17|                            return IHEVCD_INVALID_PARAMETER;
 1253|     17|                        }
 1254|   126k|                        next_coef = (next_coef + scaling_list_delta_coef + 256)
 1255|   126k|                                        % 256;
 1256|       |
 1257|   126k|                        offset = scan_table[i];
 1258|   126k|                        offset = (offset >> 3) * 16 * 2 + (offset & 0x7) * 2;
 1259|   126k|                        pi2_scaling_mat_offset[offset] = next_coef;
 1260|   126k|                        pi2_scaling_mat_offset[offset + 1] = next_coef;
 1261|   126k|                        pi2_scaling_mat_offset[offset + 16] = next_coef;
 1262|   126k|                        pi2_scaling_mat_offset[offset + 16 + 1] = next_coef;
 1263|   126k|                    }
 1264|  1.96k|                    pi2_scaling_mat_offset[0] = dc_value;
 1265|  1.96k|                }
 1266|  1.93k|                else
 1267|  1.93k|                {
 1268|  1.93k|                    scan_table = (UWORD8 *)gapv_ihevc_invscan[2];
 1269|       |
 1270|   125k|                    for(i = 0; i < coef_num; i++)
  ------------------
  |  Branch (1270:32): [True: 123k, False: 1.92k]
  ------------------
 1271|   123k|                    {
 1272|   123k|                        SEV_PARSE("scaling_list_delta_coef",
  ------------------
  |  |  162|   123k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 1273|   123k|                                  scaling_list_delta_coef, ps_bitstrm);
 1274|   123k|                        if((scaling_list_delta_coef < -256) || (scaling_list_delta_coef > 255))
  ------------------
  |  Branch (1274:28): [True: 2, False: 123k]
  |  Branch (1274:64): [True: 8, False: 123k]
  ------------------
 1275|     10|                        {
 1276|     10|                            return IHEVCD_INVALID_PARAMETER;
 1277|     10|                        }
 1278|   123k|                        next_coef = (next_coef + scaling_list_delta_coef + 256)
 1279|   123k|                                        % 256;
 1280|       |
 1281|   123k|                        offset = scan_table[i];
 1282|   123k|                        offset = (offset >> 3) * 32 * 4 + (offset & 0x7) * 4;
 1283|       |
 1284|   617k|                        for(j = 0; j < 4; j++)
  ------------------
  |  Branch (1284:36): [True: 494k, False: 123k]
  ------------------
 1285|   494k|                        {
 1286|   494k|                            pi2_scaling_mat_offset[offset + j * 32] = next_coef;
 1287|   494k|                            pi2_scaling_mat_offset[offset + 1 + j * 32] = next_coef;
 1288|   494k|                            pi2_scaling_mat_offset[offset + 2 + j * 32] = next_coef;
 1289|   494k|                            pi2_scaling_mat_offset[offset + 3 + j * 32] = next_coef;
 1290|   494k|                        }
 1291|   123k|                        pi2_scaling_mat_offset[0] = dc_value;
 1292|   123k|                    }
 1293|  1.93k|                }
 1294|  8.01k|            }
 1295|  40.6k|        }
 1296|  9.27k|    }
 1297|       |
 1298|  1.87k|    return ret;
 1299|  3.44k|}
ihevcd_parse_sps:
 1443|  19.1k|{
 1444|  19.1k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1445|  19.1k|    UWORD32 value;
 1446|       |
 1447|  19.1k|    WORD32 i;
 1448|  19.1k|    WORD32 vps_id;
 1449|  19.1k|    WORD32 sps_max_sub_layers;
 1450|  19.1k|    WORD32 sps_id;
 1451|  19.1k|    WORD32 sps_temporal_id_nesting_flag;
 1452|  19.1k|    sps_t *ps_sps;
 1453|  19.1k|    profile_tier_lvl_info_t s_ptl;
 1454|  19.1k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 1455|  19.1k|    WORD32 ctb_log2_size_y = 0;
 1456|       |
 1457|       |
 1458|  19.1k|    BITS_PARSE("video_parameter_set_id", value, ps_bitstrm, 4);
  ------------------
  |  |  148|  19.1k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1459|  19.1k|    if(value > MAX_VPS_CNT - 1)
  ------------------
  |  |  289|  19.1k|#define MAX_VPS_CNT         16
  ------------------
  |  Branch (1459:8): [True: 0, False: 19.1k]
  ------------------
 1460|      0|    {
 1461|      0|        return IHEVCD_INVALID_PARAMETER;
 1462|      0|    }
 1463|  19.1k|    vps_id = value;
 1464|       |
 1465|  19.1k|    BITS_PARSE("sps_max_sub_layers_minus1", value, ps_bitstrm, 3);
  ------------------
  |  |  148|  19.1k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1466|  19.1k|    if(value > SPS_MAX_SUB_LAYERS - 1)
  ------------------
  |  |  320|  19.1k|#define SPS_MAX_SUB_LAYERS  7
  ------------------
  |  Branch (1466:8): [True: 41, False: 19.1k]
  ------------------
 1467|     41|    {
 1468|     41|        return IHEVCD_INVALID_PARAMETER;
 1469|     41|    }
 1470|  19.1k|    sps_max_sub_layers = value + 1;
 1471|       |
 1472|  19.1k|    BITS_PARSE("sps_temporal_id_nesting_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  19.1k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1473|  19.1k|    sps_temporal_id_nesting_flag = value;
 1474|       |
 1475|       |    //profile_and_level( 1, sps_max_sub_layers_minus1 )
 1476|  19.1k|    ret = ihevcd_profile_tier_level(ps_bitstrm, &(s_ptl), 1,
 1477|  19.1k|                                    (sps_max_sub_layers - 1));
 1478|       |
 1479|  19.1k|    UEV_PARSE("seq_parameter_set_id", value, ps_bitstrm);
  ------------------
  |  |  155|  19.1k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1480|  19.1k|    sps_id = value;
 1481|  19.1k|    if((sps_id >= MAX_SPS_CNT) || (sps_id < 0))
  ------------------
  |  |  317|  19.1k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  |  Branch (1481:8): [True: 5.90k, False: 13.2k]
  |  Branch (1481:35): [True: 2.11k, False: 11.0k]
  ------------------
 1482|  8.02k|    {
 1483|  8.02k|        if(ps_codec->i4_sps_done)
  ------------------
  |  Branch (1483:12): [True: 4.96k, False: 3.05k]
  ------------------
 1484|  4.96k|            return IHEVCD_UNSUPPORTED_SPS_ID;
 1485|  3.05k|        else
 1486|  3.05k|            sps_id = 0;
 1487|  8.02k|    }
 1488|       |
 1489|       |
 1490|  14.1k|    ps_sps = (ps_codec->s_parse.ps_sps_base + MAX_SPS_CNT - 1);
  ------------------
  |  |  317|  14.1k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
 1491|       |    /* Reset SPS to zero */
 1492|  14.1k|    {
 1493|  14.1k|        WORD16 *pi2_scaling_mat = ps_sps->pi2_scaling_mat;
 1494|  14.1k|        memset(ps_sps, 0, sizeof(sps_t));
 1495|  14.1k|        ps_sps->pi2_scaling_mat = pi2_scaling_mat;
 1496|  14.1k|    }
 1497|  14.1k|    ps_sps->i1_sps_id = sps_id;
 1498|  14.1k|    ps_sps->i1_vps_id = vps_id;
 1499|  14.1k|    ps_sps->i1_sps_max_sub_layers = sps_max_sub_layers;
 1500|  14.1k|    ps_sps->i1_sps_temporal_id_nesting_flag = sps_temporal_id_nesting_flag;
 1501|       |
 1502|  14.1k|    memcpy(&ps_sps->s_ptl, &s_ptl, sizeof(profile_tier_lvl_info_t));
 1503|       |
 1504|  14.1k|    UEV_PARSE("chroma_format_idc", value, ps_bitstrm);
  ------------------
  |  |  155|  14.1k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1505|  14.1k|    if(value > 3)
  ------------------
  |  Branch (1505:8): [True: 1.40k, False: 12.7k]
  ------------------
 1506|  1.40k|    {
 1507|  1.40k|        return IHEVCD_INVALID_PARAMETER;
 1508|  1.40k|    }
 1509|  12.7k|    ps_sps->i1_chroma_format_idc = value;
 1510|       |
 1511|  12.7k|    if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_YUV420)
  ------------------
  |  Branch (1511:8): [True: 940, False: 11.8k]
  ------------------
 1512|    940|    {
 1513|    940|        ps_codec->s_parse.i4_error_code = IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC;
 1514|    940|        return (IHEVCD_ERROR_T)IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC;
 1515|    940|    }
 1516|       |
 1517|  11.8k|    if(CHROMA_FMT_IDC_YUV444_PLANES == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1517:8): [True: 0, False: 11.8k]
  ------------------
 1518|      0|    {
 1519|      0|        BITS_PARSE("separate_colour_plane_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|      0|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1520|      0|        ps_sps->i1_separate_colour_plane_flag = value;
 1521|      0|    }
 1522|  11.8k|    else
 1523|  11.8k|    {
 1524|  11.8k|        ps_sps->i1_separate_colour_plane_flag = 0;
 1525|  11.8k|    }
 1526|       |
 1527|  11.8k|    UEV_PARSE("pic_width_in_luma_samples", value, ps_bitstrm);
  ------------------
  |  |  155|  11.8k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1528|  11.8k|    if(value > INT16_MAX)
  ------------------
  |  Branch (1528:8): [True: 202, False: 11.5k]
  ------------------
 1529|    202|    {
 1530|    202|        return (IHEVCD_ERROR_T)IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
 1531|    202|    }
 1532|  11.5k|    ps_sps->i2_pic_width_in_luma_samples = value;
 1533|       |
 1534|  11.5k|    UEV_PARSE("pic_height_in_luma_samples", value, ps_bitstrm);
  ------------------
  |  |  155|  11.5k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1535|  11.5k|    if(value > INT16_MAX)
  ------------------
  |  Branch (1535:8): [True: 131, False: 11.4k]
  ------------------
 1536|    131|    {
 1537|    131|        return (IHEVCD_ERROR_T)IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
 1538|    131|    }
 1539|  11.4k|    ps_sps->i2_pic_height_in_luma_samples = value;
 1540|       |
 1541|  11.4k|    if((0 >= ps_sps->i2_pic_width_in_luma_samples) || (0 >= ps_sps->i2_pic_height_in_luma_samples))
  ------------------
  |  Branch (1541:8): [True: 722, False: 10.7k]
  |  Branch (1541:55): [True: 30, False: 10.7k]
  ------------------
 1542|    752|        return IHEVCD_INVALID_PARAMETER;
 1543|       |
 1544|  10.7k|    BITS_PARSE("pic_cropping_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1545|  10.7k|    ps_sps->i1_pic_cropping_flag = value;
 1546|       |
 1547|  10.7k|    if(ps_sps->i1_pic_cropping_flag)
  ------------------
  |  Branch (1547:8): [True: 9.26k, False: 1.44k]
  ------------------
 1548|  9.26k|    {
 1549|       |
 1550|  9.26k|        UEV_PARSE("pic_crop_left_offset", value, ps_bitstrm);
  ------------------
  |  |  155|  9.26k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1551|  9.26k|        if (value >= ps_sps->i2_pic_width_in_luma_samples)
  ------------------
  |  Branch (1551:13): [True: 0, False: 9.26k]
  ------------------
 1552|      0|        {
 1553|      0|            return IHEVCD_INVALID_PARAMETER;
 1554|      0|        }
 1555|  9.26k|        ps_sps->i2_pic_crop_left_offset = value;
 1556|       |
 1557|  9.26k|        UEV_PARSE("pic_crop_right_offset", value, ps_bitstrm);
  ------------------
  |  |  155|  9.26k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1558|  9.26k|        if (value >= ps_sps->i2_pic_width_in_luma_samples)
  ------------------
  |  Branch (1558:13): [True: 2, False: 9.26k]
  ------------------
 1559|      2|        {
 1560|      2|            return IHEVCD_INVALID_PARAMETER;
 1561|      2|        }
 1562|  9.26k|        ps_sps->i2_pic_crop_right_offset = value;
 1563|       |
 1564|  9.26k|        UEV_PARSE("pic_crop_top_offset", value, ps_bitstrm);
  ------------------
  |  |  155|  9.26k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1565|  9.26k|        if (value >= ps_sps->i2_pic_height_in_luma_samples)
  ------------------
  |  Branch (1565:13): [True: 9, False: 9.25k]
  ------------------
 1566|      9|        {
 1567|      9|            return IHEVCD_INVALID_PARAMETER;
 1568|      9|        }
 1569|  9.25k|        ps_sps->i2_pic_crop_top_offset = value;
 1570|       |
 1571|  9.25k|        UEV_PARSE("pic_crop_bottom_offset", value, ps_bitstrm);
  ------------------
  |  |  155|  9.25k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1572|  9.25k|        if (value >= ps_sps->i2_pic_height_in_luma_samples)
  ------------------
  |  Branch (1572:13): [True: 2, False: 9.25k]
  ------------------
 1573|      2|        {
 1574|      2|            return IHEVCD_INVALID_PARAMETER;
 1575|      2|        }
 1576|  9.25k|        ps_sps->i2_pic_crop_bottom_offset = value;
 1577|  9.25k|    }
 1578|  1.44k|    else
 1579|  1.44k|    {
 1580|  1.44k|        ps_sps->i2_pic_crop_left_offset = 0;
 1581|  1.44k|        ps_sps->i2_pic_crop_right_offset = 0;
 1582|  1.44k|        ps_sps->i2_pic_crop_top_offset = 0;
 1583|  1.44k|        ps_sps->i2_pic_crop_bottom_offset = 0;
 1584|  1.44k|    }
 1585|       |
 1586|       |
 1587|  10.7k|    UEV_PARSE("bit_depth_luma_minus8", value, ps_bitstrm);
  ------------------
  |  |  155|  10.7k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1588|  10.7k|    if(0 != value)
  ------------------
  |  Branch (1588:8): [True: 246, False: 10.4k]
  ------------------
 1589|    246|        return IHEVCD_UNSUPPORTED_BIT_DEPTH;
 1590|       |
 1591|  10.4k|    UEV_PARSE("bit_depth_chroma_minus8", value, ps_bitstrm);
  ------------------
  |  |  155|  10.4k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1592|  10.4k|    if(0 != value)
  ------------------
  |  Branch (1592:8): [True: 77, False: 10.3k]
  ------------------
 1593|     77|        return IHEVCD_UNSUPPORTED_BIT_DEPTH;
 1594|       |
 1595|  10.3k|    UEV_PARSE("log2_max_pic_order_cnt_lsb_minus4", value, ps_bitstrm);
  ------------------
  |  |  155|  10.3k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1596|  10.3k|    if(value > 12)
  ------------------
  |  Branch (1596:8): [True: 4, False: 10.3k]
  ------------------
 1597|      4|        return IHEVCD_INVALID_PARAMETER;
 1598|  10.3k|    ps_sps->i1_log2_max_pic_order_cnt_lsb = value + 4;
 1599|       |
 1600|  10.3k|    BITS_PARSE("sps_sub_layer_ordering_info_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1601|       |
 1602|  10.3k|    ps_sps->i1_sps_sub_layer_ordering_info_present_flag = value;
 1603|       |
 1604|       |
 1605|  10.3k|    i = (ps_sps->i1_sps_sub_layer_ordering_info_present_flag ? 0 : (ps_sps->i1_sps_max_sub_layers - 1));
  ------------------
  |  Branch (1605:10): [True: 4.36k, False: 6.01k]
  ------------------
 1606|  29.4k|    for(; i < ps_sps->i1_sps_max_sub_layers; i++)
  ------------------
  |  Branch (1606:11): [True: 19.1k, False: 10.2k]
  ------------------
 1607|  19.1k|    {
 1608|  19.1k|        UEV_PARSE("max_dec_pic_buffering", value, ps_bitstrm);
  ------------------
  |  |  155|  19.1k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1609|  19.1k|        if(value > (MAX_DPB_SIZE - 1))
  ------------------
  |  |  281|  19.1k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (1609:12): [True: 85, False: 19.0k]
  ------------------
 1610|     85|        {
 1611|     85|            return IHEVCD_INVALID_PARAMETER;
 1612|     85|        }
 1613|  19.0k|        ps_sps->ai1_sps_max_dec_pic_buffering[i] = value + 1;
 1614|       |
 1615|  19.0k|        UEV_PARSE("num_reorder_pics", value, ps_bitstrm);
  ------------------
  |  |  155|  19.0k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1616|  19.0k|        if(value >= ps_sps->ai1_sps_max_dec_pic_buffering[i])
  ------------------
  |  Branch (1616:12): [True: 41, False: 19.0k]
  ------------------
 1617|     41|        {
 1618|     41|            return IHEVCD_INVALID_PARAMETER;
 1619|     41|        }
 1620|  19.0k|        ps_sps->ai1_sps_max_num_reorder_pics[i] = value;
 1621|       |
 1622|  19.0k|        UEV_PARSE("max_latency_increase", value, ps_bitstrm);
  ------------------
  |  |  155|  19.0k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1623|  19.0k|        if(value > UINT_MAX - 2)
  ------------------
  |  Branch (1623:12): [True: 0, False: 19.0k]
  ------------------
 1624|      0|        {
 1625|      0|            return IHEVCD_INVALID_PARAMETER;
 1626|      0|        }
 1627|  19.0k|        ps_sps->ai1_sps_max_latency_increase[i] = value;
 1628|  19.0k|    }
 1629|       |
 1630|       |    /* Check if sps_max_dec_pic_buffering or sps_max_num_reorder_pics
 1631|       |       has changed */
 1632|  10.2k|    if(0 != ps_codec->u4_allocate_dynamic_done)
  ------------------
  |  Branch (1632:8): [True: 7.83k, False: 2.41k]
  ------------------
 1633|  7.83k|    {
 1634|  7.83k|        sps_t *ps_sps_old = ps_codec->s_parse.ps_sps;
 1635|  7.83k|        if(ps_sps_old->ai1_sps_max_dec_pic_buffering[ps_sps_old->i1_sps_max_sub_layers - 1] !=
  ------------------
  |  Branch (1635:12): [True: 757, False: 7.07k]
  ------------------
 1636|  7.83k|                    ps_sps->ai1_sps_max_dec_pic_buffering[ps_sps->i1_sps_max_sub_layers - 1])
 1637|    757|        {
 1638|    757|            if(0 == ps_codec->i4_first_pic_done)
  ------------------
  |  Branch (1638:16): [True: 131, False: 626]
  ------------------
 1639|    131|            {
 1640|    131|                return IHEVCD_INVALID_PARAMETER;
 1641|    131|            }
 1642|    626|            ps_codec->i4_reset_flag = 1;
 1643|    626|            return (IHEVCD_ERROR_T)IVD_RES_CHANGED;
 1644|    757|        }
 1645|       |
 1646|  7.07k|        if(ps_sps_old->ai1_sps_max_num_reorder_pics[ps_sps_old->i1_sps_max_sub_layers - 1] !=
  ------------------
  |  Branch (1646:12): [True: 0, False: 7.07k]
  ------------------
 1647|  7.07k|                    ps_sps->ai1_sps_max_num_reorder_pics[ps_sps->i1_sps_max_sub_layers - 1])
 1648|      0|        {
 1649|      0|            if(0 == ps_codec->i4_first_pic_done)
  ------------------
  |  Branch (1649:16): [True: 0, False: 0]
  ------------------
 1650|      0|            {
 1651|      0|                return IHEVCD_INVALID_PARAMETER;
 1652|      0|            }
 1653|      0|            ps_codec->i4_reset_flag = 1;
 1654|      0|            return (IHEVCD_ERROR_T)IVD_RES_CHANGED;
 1655|      0|        }
 1656|  7.07k|    }
 1657|       |
 1658|  9.49k|    UEV_PARSE("log2_min_coding_block_size_minus3", value, ps_bitstrm);
  ------------------
  |  |  155|  9.49k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1659|  9.49k|    if(value > (LOG2_MAX_CU_SIZE - 3))
  ------------------
  |  |  364|  9.49k|#define LOG2_MAX_CU_SIZE    6
  ------------------
  |  Branch (1659:8): [True: 94, False: 9.39k]
  ------------------
 1660|     94|    {
 1661|     94|        return IHEVCD_INVALID_PARAMETER;
 1662|     94|    }
 1663|  9.39k|    ps_sps->i1_log2_min_coding_block_size = value + 3;
 1664|  9.39k|    if((ps_sps->i2_pic_width_in_luma_samples % (1 << ps_sps->i1_log2_min_coding_block_size) != 0) ||
  ------------------
  |  Branch (1664:8): [True: 60, False: 9.33k]
  ------------------
 1665|  9.39k|                    (ps_sps->i2_pic_height_in_luma_samples % (1 << ps_sps->i1_log2_min_coding_block_size) != 0))
  ------------------
  |  Branch (1665:21): [True: 28, False: 9.31k]
  ------------------
 1666|     88|    {
 1667|     88|        return IHEVCD_INVALID_PARAMETER;
 1668|     88|    }
 1669|       |
 1670|  9.31k|    UEV_PARSE("log2_diff_max_min_coding_block_size", value, ps_bitstrm);
  ------------------
  |  |  155|  9.31k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1671|  9.31k|    if(value > (LOG2_MAX_CU_SIZE - ps_sps->i1_log2_min_coding_block_size))
  ------------------
  |  |  364|  9.31k|#define LOG2_MAX_CU_SIZE    6
  ------------------
  |  Branch (1671:8): [True: 8, False: 9.30k]
  ------------------
 1672|      8|    {
 1673|      8|        return IHEVCD_INVALID_PARAMETER;
 1674|      8|    }
 1675|  9.30k|    ps_sps->i1_log2_diff_max_min_coding_block_size = value;
 1676|       |
 1677|  9.30k|    ctb_log2_size_y = ps_sps->i1_log2_min_coding_block_size + ps_sps->i1_log2_diff_max_min_coding_block_size;
 1678|       |
 1679|  9.30k|    if((ctb_log2_size_y < LOG2_MIN_CTB_SIZE) || (ctb_log2_size_y > LOG2_MAX_CTB_SIZE))
  ------------------
  |  |  344|  9.30k|#define LOG2_MIN_CTB_SIZE   4
  ------------------
                  if((ctb_log2_size_y < LOG2_MIN_CTB_SIZE) || (ctb_log2_size_y > LOG2_MAX_CTB_SIZE))
  ------------------
  |  |  343|  9.29k|#define LOG2_MAX_CTB_SIZE   6
  ------------------
  |  Branch (1679:8): [True: 4, False: 9.29k]
  |  Branch (1679:49): [True: 0, False: 9.29k]
  ------------------
 1680|      4|    {
 1681|      4|        return IHEVCD_INVALID_PARAMETER;
 1682|      4|    }
 1683|       |    /* Check if CTB size is different in case of multiple SPS with same ID */
 1684|  9.29k|    {
 1685|  9.29k|        sps_t *ps_sps_old = (ps_codec->s_parse.ps_sps_base + sps_id);
 1686|  9.29k|        if(ps_sps_old->i1_sps_valid && ps_sps_old->i1_log2_ctb_size != ctb_log2_size_y)
  ------------------
  |  Branch (1686:12): [True: 6.83k, False: 2.46k]
  |  Branch (1686:40): [True: 3, False: 6.83k]
  ------------------
 1687|      3|        {
 1688|      3|            if(0 == ps_codec->i4_first_pic_done)
  ------------------
  |  Branch (1688:16): [True: 2, False: 1]
  ------------------
 1689|      2|            {
 1690|      2|                return IHEVCD_INVALID_PARAMETER;
 1691|      2|            }
 1692|      1|            ps_codec->i4_reset_flag = 1;
 1693|      1|            return (IHEVCD_ERROR_T)IVD_RES_CHANGED;
 1694|      3|        }
 1695|  9.29k|    }
 1696|  9.29k|    ps_sps->i1_log2_ctb_size = ctb_log2_size_y;
 1697|       |
 1698|  9.29k|    UEV_PARSE("log2_min_transform_block_size_minus2", value, ps_bitstrm);
  ------------------
  |  |  155|  9.29k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1699|  9.29k|    if(value > (LOG2_MAX_TU_SIZE - 2))
  ------------------
  |  |  349|  9.29k|#define LOG2_MAX_TU_SIZE    5
  ------------------
  |  Branch (1699:8): [True: 97, False: 9.19k]
  ------------------
 1700|     97|    {
 1701|     97|        return IHEVCD_INVALID_PARAMETER;
 1702|     97|    }
 1703|  9.19k|    ps_sps->i1_log2_min_transform_block_size = value + 2;
 1704|  9.19k|    if(ps_sps->i1_log2_min_transform_block_size >= ps_sps->i1_log2_min_coding_block_size)
  ------------------
  |  Branch (1704:8): [True: 1, False: 9.19k]
  ------------------
 1705|      1|    {
 1706|      1|        return IHEVCD_INVALID_PARAMETER;
 1707|      1|    }
 1708|       |
 1709|  9.19k|    UEV_PARSE("log2_diff_max_min_transform_block_size", value, ps_bitstrm);
  ------------------
  |  |  155|  9.19k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1710|  9.19k|    if(value > (LOG2_MAX_TU_SIZE - ps_sps->i1_log2_min_transform_block_size))
  ------------------
  |  |  349|  9.19k|#define LOG2_MAX_TU_SIZE    5
  ------------------
  |  Branch (1710:8): [True: 0, False: 9.19k]
  ------------------
 1711|      0|    {
 1712|      0|        return IHEVCD_INVALID_PARAMETER;
 1713|      0|    }
 1714|  9.19k|    ps_sps->i1_log2_diff_max_min_transform_block_size = value;
 1715|       |
 1716|  9.19k|    ps_sps->i1_log2_max_transform_block_size = ps_sps->i1_log2_min_transform_block_size +
 1717|  9.19k|                    ps_sps->i1_log2_diff_max_min_transform_block_size;
 1718|       |
 1719|  9.19k|    if(ps_sps->i1_log2_max_transform_block_size > ps_sps->i1_log2_ctb_size)
  ------------------
  |  Branch (1719:8): [True: 0, False: 9.19k]
  ------------------
 1720|      0|    {
 1721|      0|        return IHEVCD_INVALID_PARAMETER;
 1722|      0|    }
 1723|       |
 1724|  9.19k|    ps_sps->i1_log2_min_pcm_coding_block_size = 0;
 1725|  9.19k|    ps_sps->i1_log2_diff_max_min_pcm_coding_block_size = 0;
 1726|       |
 1727|  9.19k|    UEV_PARSE("max_transform_hierarchy_depth_inter", value, ps_bitstrm);
  ------------------
  |  |  155|  9.19k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1728|  9.19k|    if(value > (ps_sps->i1_log2_ctb_size - ps_sps->i1_log2_min_transform_block_size))
  ------------------
  |  Branch (1728:8): [True: 110, False: 9.08k]
  ------------------
 1729|    110|    {
 1730|    110|        return IHEVCD_INVALID_PARAMETER;
 1731|    110|    }
 1732|  9.08k|    ps_sps->i1_max_transform_hierarchy_depth_inter = value;
 1733|       |
 1734|  9.08k|    UEV_PARSE("max_transform_hierarchy_depth_intra", value, ps_bitstrm);
  ------------------
  |  |  155|  9.08k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1735|  9.08k|    if(value > (ps_sps->i1_log2_ctb_size - ps_sps->i1_log2_min_transform_block_size))
  ------------------
  |  Branch (1735:8): [True: 191, False: 8.89k]
  ------------------
 1736|    191|    {
 1737|    191|        return IHEVCD_INVALID_PARAMETER;
 1738|    191|    }
 1739|  8.89k|    ps_sps->i1_max_transform_hierarchy_depth_intra = value;
 1740|       |
 1741|       |    /* String has a d (enabled) in order to match with HM */
 1742|  8.89k|    BITS_PARSE("scaling_list_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.89k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1743|  8.89k|    ps_sps->i1_scaling_list_enable_flag = value;
 1744|       |
 1745|  8.89k|    if(ps_sps->i1_scaling_list_enable_flag)
  ------------------
  |  Branch (1745:8): [True: 7.41k, False: 1.47k]
  ------------------
 1746|  7.41k|    {
 1747|  7.41k|        COPY_DEFAULT_SCALING_LIST(ps_sps->pi2_scaling_mat);
  ------------------
  |  |   76|  7.41k|#define COPY_DEFAULT_SCALING_LIST(pi2_scaling_mat)                                                                                      \
  |  |   77|  7.41k|{                                                                                                                                       \
  |  |   78|  7.41k|    WORD32 scaling_mat_offset[]={0, 16, 32, 48, 64, 80, 96, 160, 224, 288, 352, 416, 480, 736, 992, 1248, 1504, 1760, 2016, 3040};      \
  |  |   79|  7.41k|                                                                                                                                        \
  |  |   80|  7.41k|    /* scaling matrix for 4x4 */                                                                                                        \
  |  |   81|  7.41k|    memcpy(pi2_scaling_mat, gi2_flat_scale_mat_32x32, 6*16*sizeof(WORD16));                                                             \
  |  |   82|  7.41k|/* scaling matrix for 8x8 */                                                                                                            \
  |  |   83|  7.41k|    memcpy(pi2_scaling_mat + scaling_mat_offset[6], gi2_intra_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   84|  7.41k|    memcpy(pi2_scaling_mat + scaling_mat_offset[7], gi2_intra_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   85|  7.41k|    memcpy(pi2_scaling_mat + scaling_mat_offset[8], gi2_intra_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   86|  7.41k|    memcpy(pi2_scaling_mat + scaling_mat_offset[9], gi2_inter_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   87|  7.41k|    memcpy(pi2_scaling_mat + scaling_mat_offset[10], gi2_inter_default_scale_mat_8x8, 64*sizeof(WORD16));                               \
  |  |   88|  7.41k|    memcpy(pi2_scaling_mat + scaling_mat_offset[11], gi2_inter_default_scale_mat_8x8, 64*sizeof(WORD16));                               \
  |  |   89|  7.41k|    /* scaling matrix for 16x16 */                                                                                                      \
  |  |   90|  7.41k|    memcpy(pi2_scaling_mat + scaling_mat_offset[12], gi2_intra_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   91|  7.41k|    memcpy(pi2_scaling_mat + scaling_mat_offset[13], gi2_intra_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   92|  7.41k|    memcpy(pi2_scaling_mat + scaling_mat_offset[14], gi2_intra_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   93|  7.41k|    memcpy(pi2_scaling_mat + scaling_mat_offset[15], gi2_inter_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   94|  7.41k|    memcpy(pi2_scaling_mat + scaling_mat_offset[16], gi2_inter_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   95|  7.41k|    memcpy(pi2_scaling_mat + scaling_mat_offset[17], gi2_inter_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   96|  7.41k|    /* scaling matrix for 32x32 */                                                                                                      \
  |  |   97|  7.41k|    memcpy(pi2_scaling_mat + scaling_mat_offset[18], gi2_intra_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |   98|  7.41k|    memcpy(pi2_scaling_mat + scaling_mat_offset[19], gi2_inter_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |   99|  7.41k|}
  ------------------
 1748|  7.41k|        BITS_PARSE("sps_scaling_list_data_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  7.41k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1749|  7.41k|        ps_sps->i1_sps_scaling_list_data_present_flag = value;
 1750|       |
 1751|  7.41k|        if(ps_sps->i1_sps_scaling_list_data_present_flag)
  ------------------
  |  Branch (1751:12): [True: 1.98k, False: 5.43k]
  ------------------
 1752|  1.98k|            ihevcd_scaling_list_data(ps_codec, ps_sps->pi2_scaling_mat);
 1753|  7.41k|    }
 1754|  1.47k|    else
 1755|  1.47k|    {
 1756|  1.47k|        COPY_FLAT_SCALING_LIST(ps_sps->pi2_scaling_mat);
  ------------------
  |  |  101|  1.47k|#define COPY_FLAT_SCALING_LIST(pi2_scaling_mat)                                                                                         \
  |  |  102|  1.47k|{                                                                                                                                       \
  |  |  103|  1.47k|    WORD32 scaling_mat_offset[]={0, 16, 32, 48, 64, 80, 96, 160, 224, 288, 352, 416, 480, 736, 992, 1248, 1504, 1760, 2016, 3040};      \
  |  |  104|  1.47k|                                                                                                                                        \
  |  |  105|  1.47k|    /* scaling matrix for 4x4 */                                                                                                        \
  |  |  106|  1.47k|    memcpy(pi2_scaling_mat, gi2_flat_scale_mat_32x32, 6*16*sizeof(WORD16));                                                             \
  |  |  107|  1.47k|    /* scaling matrix for 8x8 */                                                                                                        \
  |  |  108|  1.47k|    memcpy(pi2_scaling_mat + scaling_mat_offset[6], gi2_flat_scale_mat_32x32, 6*64*sizeof(WORD16));                                     \
  |  |  109|  1.47k|    /* scaling matrix for 16x16 */                                                                                                      \
  |  |  110|  1.47k|    memcpy(pi2_scaling_mat + scaling_mat_offset[12], gi2_flat_scale_mat_32x32, 3*256*sizeof(WORD16));                                   \
  |  |  111|  1.47k|    memcpy(pi2_scaling_mat + scaling_mat_offset[15], gi2_flat_scale_mat_32x32, 3*256*sizeof(WORD16));                                   \
  |  |  112|  1.47k|    /* scaling matrix for 32x32 */                                                                                                      \
  |  |  113|  1.47k|    memcpy(pi2_scaling_mat + scaling_mat_offset[18], gi2_flat_scale_mat_32x32, 1024*sizeof(WORD16));                                    \
  |  |  114|  1.47k|    memcpy(pi2_scaling_mat + scaling_mat_offset[19], gi2_flat_scale_mat_32x32, 1024*sizeof(WORD16));                                    \
  |  |  115|  1.47k|}
  ------------------
 1757|  1.47k|    }
 1758|       |    /* String is asymmetric_motion_partitions_enabled_flag instead of amp_enabled_flag in order to match with HM */
 1759|  8.89k|    BITS_PARSE("asymmetric_motion_partitions_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.89k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1760|  8.89k|    ps_sps->i1_amp_enabled_flag = value;
 1761|       |
 1762|  8.89k|    BITS_PARSE("sample_adaptive_offset_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.89k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1763|  8.89k|    ps_sps->i1_sample_adaptive_offset_enabled_flag = value;
 1764|       |
 1765|  8.89k|    BITS_PARSE("pcm_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.89k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1766|  8.89k|    ps_sps->i1_pcm_enabled_flag = value;
 1767|       |
 1768|  8.89k|    if(ps_sps->i1_pcm_enabled_flag)
  ------------------
  |  Branch (1768:8): [True: 5.45k, False: 3.43k]
  ------------------
 1769|  5.45k|    {
 1770|  5.45k|        BITS_PARSE("pcm_sample_bit_depth_luma", value, ps_bitstrm, 4);
  ------------------
  |  |  148|  5.45k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1771|  5.45k|        ps_sps->i1_pcm_sample_bit_depth_luma = value + 1;
 1772|       |
 1773|  5.45k|        BITS_PARSE("pcm_sample_bit_depth_chroma", value, ps_bitstrm, 4);
  ------------------
  |  |  148|  5.45k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1774|  5.45k|        ps_sps->i1_pcm_sample_bit_depth_chroma = value + 1;
 1775|       |
 1776|  5.45k|        UEV_PARSE("log2_min_pcm_coding_block_size_minus3", value, ps_bitstrm);
  ------------------
  |  |  155|  5.45k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1777|  5.45k|        if(value < (ps_sps->i1_log2_min_coding_block_size - 3) || value > (MIN(ctb_log2_size_y, 5) - 3))
  ------------------
  |  |   43|  5.45k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 20, False: 5.43k]
  |  |  ------------------
  ------------------
  |  Branch (1777:12): [True: 0, False: 5.45k]
  |  Branch (1777:67): [True: 11, False: 5.44k]
  ------------------
 1778|     11|        {
 1779|     11|            return IHEVCD_INVALID_PARAMETER;
 1780|     11|        }
 1781|  5.44k|        ps_sps->i1_log2_min_pcm_coding_block_size = value + 3;
 1782|       |
 1783|  5.44k|        UEV_PARSE("log2_diff_max_min_pcm_coding_block_size", value, ps_bitstrm);
  ------------------
  |  |  155|  5.44k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1784|  5.44k|        if(value > MIN(ctb_log2_size_y, 5) - ps_sps->i1_log2_min_pcm_coding_block_size)
  ------------------
  |  |   43|  5.44k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 20, False: 5.42k]
  |  |  ------------------
  ------------------
  |  Branch (1784:12): [True: 0, False: 5.44k]
  ------------------
 1785|      0|        {
 1786|      0|            return IHEVCD_INVALID_PARAMETER;
 1787|      0|        }
 1788|  5.44k|        ps_sps->i1_log2_diff_max_min_pcm_coding_block_size = value;
 1789|  5.44k|        BITS_PARSE("pcm_loop_filter_disable_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  5.44k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1790|  5.44k|        ps_sps->i1_pcm_loop_filter_disable_flag = value;
 1791|       |
 1792|  5.44k|    }
 1793|  8.88k|    UEV_PARSE("num_short_term_ref_pic_sets", value, ps_bitstrm);
  ------------------
  |  |  155|  8.88k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1794|  8.88k|    if(value > MAX_STREF_PICS_SPS)
  ------------------
  |  |  325|  8.88k|#define MAX_STREF_PICS_SPS 64
  ------------------
  |  Branch (1794:8): [True: 168, False: 8.71k]
  ------------------
 1795|    168|    {
 1796|    168|        return IHEVCD_INVALID_PARAMETER;
 1797|    168|    }
 1798|  8.71k|    ps_sps->i1_num_short_term_ref_pic_sets = value;
 1799|       |
 1800|  48.7k|    for(i = 0; i < ps_sps->i1_num_short_term_ref_pic_sets; i++)
  ------------------
  |  Branch (1800:16): [True: 40.1k, False: 8.64k]
  ------------------
 1801|  40.1k|    {
 1802|  40.1k|        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]);
 1803|  40.1k|        if (ret != IHEVCD_SUCCESS)
  ------------------
  |  Branch (1803:13): [True: 77, False: 40.0k]
  ------------------
 1804|     77|        {
 1805|     77|            return ret;
 1806|     77|        }
 1807|  40.1k|    }
 1808|       |
 1809|  8.64k|    BITS_PARSE("long_term_ref_pics_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.64k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1810|  8.64k|    ps_sps->i1_long_term_ref_pics_present_flag = value;
 1811|       |
 1812|  8.64k|    if(ps_sps->i1_long_term_ref_pics_present_flag)
  ------------------
  |  Branch (1812:8): [True: 820, False: 7.82k]
  ------------------
 1813|    820|    {
 1814|    820|        UEV_PARSE("num_long_term_ref_pics_sps", value, ps_bitstrm);
  ------------------
  |  |  155|    820|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 1815|    820|        if(value > MAX_LTREF_PICS_SPS)
  ------------------
  |  |  323|    820|#define MAX_LTREF_PICS_SPS 32
  ------------------
  |  Branch (1815:12): [True: 0, False: 820]
  ------------------
 1816|      0|        {
 1817|      0|            return IHEVCD_INVALID_PARAMETER;
 1818|      0|        }
 1819|    820|        ps_sps->i1_num_long_term_ref_pics_sps = value;
 1820|       |
 1821|  1.14k|        for(i = 0; i < ps_sps->i1_num_long_term_ref_pics_sps; i++)
  ------------------
  |  Branch (1821:20): [True: 326, False: 820]
  ------------------
 1822|    326|        {
 1823|    326|            BITS_PARSE("lt_ref_pic_poc_lsb_sps[ i ]", value, ps_bitstrm, ps_sps->i1_log2_max_pic_order_cnt_lsb);
  ------------------
  |  |  148|    326|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1824|    326|            ps_sps->au2_lt_ref_pic_poc_lsb_sps[i] = value;
 1825|       |
 1826|    326|            BITS_PARSE("used_by_curr_pic_lt_sps_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|    326|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1827|    326|            ps_sps->ai1_used_by_curr_pic_lt_sps_flag[i] = value;
 1828|    326|        }
 1829|    820|    }
 1830|       |
 1831|  8.64k|    BITS_PARSE("sps_temporal_mvp_enable_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.64k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1832|  8.64k|    ps_sps->i1_sps_temporal_mvp_enable_flag = value;
 1833|       |
 1834|       |    /* Print matches HM 8-2 */
 1835|  8.64k|    BITS_PARSE("sps_strong_intra_smoothing_enable_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.64k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1836|  8.64k|    ps_sps->i1_strong_intra_smoothing_enable_flag = value;
 1837|       |
 1838|  8.64k|    BITS_PARSE("vui_parameters_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.64k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1839|  8.64k|    ps_sps->i1_vui_parameters_present_flag = value;
 1840|       |
 1841|  8.64k|    if(ps_sps->i1_vui_parameters_present_flag)
  ------------------
  |  Branch (1841:8): [True: 733, False: 7.90k]
  ------------------
 1842|    733|    {
 1843|    733|        ret = ihevcd_parse_vui_parameters(ps_bitstrm,
 1844|    733|                                          &ps_sps->s_vui_parameters,
 1845|    733|                                          ps_sps->i1_sps_max_sub_layers - 1);
 1846|    733|        RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|    733|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 14, False: 719]
  |  |  ------------------
  ------------------
 1847|    719|    }
 1848|       |
 1849|  8.62k|    BITS_PARSE("sps_extension_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.62k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1850|       |
 1851|  8.62k|    if((UWORD8 *)ps_bitstrm->pu4_buf > ps_bitstrm->pu1_buf_max)
  ------------------
  |  Branch (1851:8): [True: 114, False: 8.51k]
  ------------------
 1852|    114|    {
 1853|    114|        return IHEVCD_INVALID_PARAMETER;
 1854|    114|    }
 1855|       |
 1856|  8.51k|    {
 1857|  8.51k|        WORD32 numerator;
 1858|  8.51k|        WORD32 ceil_offset;
 1859|       |
 1860|  8.51k|        ceil_offset = (1 << ps_sps->i1_log2_ctb_size) - 1;
 1861|  8.51k|        numerator = ps_sps->i2_pic_width_in_luma_samples;
 1862|       |
 1863|  8.51k|        ps_sps->i2_pic_wd_in_ctb = ((numerator + ceil_offset) /
 1864|  8.51k|                        (1 << ps_sps->i1_log2_ctb_size));
 1865|       |
 1866|  8.51k|        numerator = ps_sps->i2_pic_height_in_luma_samples;
 1867|  8.51k|        ps_sps->i2_pic_ht_in_ctb = ((numerator + ceil_offset) /
 1868|  8.51k|                        (1 << ps_sps->i1_log2_ctb_size));
 1869|       |
 1870|  8.51k|        ps_sps->i4_pic_size_in_ctb = ps_sps->i2_pic_ht_in_ctb *
 1871|  8.51k|                        ps_sps->i2_pic_wd_in_ctb;
 1872|       |
 1873|  8.51k|        if(0 == ps_codec->i4_sps_done)
  ------------------
  |  Branch (1873:12): [True: 1.56k, False: 6.95k]
  ------------------
 1874|  1.56k|            ps_codec->s_parse.i4_next_ctb_indx = ps_sps->i4_pic_size_in_ctb;
 1875|       |
 1876|  8.51k|        numerator = ps_sps->i2_pic_width_in_luma_samples;
 1877|  8.51k|        ps_sps->i2_pic_wd_in_min_cb = numerator  /
 1878|  8.51k|                        (1 << ps_sps->i1_log2_min_coding_block_size);
 1879|       |
 1880|  8.51k|        numerator = ps_sps->i2_pic_height_in_luma_samples;
 1881|  8.51k|        ps_sps->i2_pic_ht_in_min_cb = numerator  /
 1882|  8.51k|                        (1 << ps_sps->i1_log2_min_coding_block_size);
 1883|  8.51k|    }
 1884|  8.51k|    if((0 != ps_codec->u4_allocate_dynamic_done) &&
  ------------------
  |  Branch (1884:8): [True: 6.95k, False: 1.56k]
  ------------------
 1885|  8.51k|                    ((ps_codec->i4_wd != ps_sps->i2_pic_width_in_luma_samples) ||
  ------------------
  |  Branch (1885:22): [True: 190, False: 6.76k]
  ------------------
 1886|  6.95k|                    (ps_codec->i4_ht != ps_sps->i2_pic_height_in_luma_samples)))
  ------------------
  |  Branch (1886:21): [True: 26, False: 6.73k]
  ------------------
 1887|    216|    {
 1888|    216|        if(0 == ps_codec->i4_first_pic_done)
  ------------------
  |  Branch (1888:12): [True: 17, False: 199]
  ------------------
 1889|     17|        {
 1890|     17|            return IHEVCD_INVALID_PARAMETER;
 1891|     17|        }
 1892|    199|        ps_codec->i4_reset_flag = 1;
 1893|    199|        return (IHEVCD_ERROR_T)IVD_RES_CHANGED;
 1894|    216|    }
 1895|       |
 1896|  8.29k|    if((ps_sps->i2_pic_width_in_luma_samples > MAX_WD) ||
  ------------------
  |  |   53|  8.29k|#define MAX_WD   8448
  ------------------
  |  Branch (1896:8): [True: 0, False: 8.29k]
  ------------------
 1897|  8.29k|                    ((ps_sps->i2_pic_width_in_luma_samples * ps_sps->i2_pic_height_in_luma_samples) >
  ------------------
  |  Branch (1897:21): [True: 0, False: 8.29k]
  ------------------
 1898|  8.29k|                    (MAX_WD * MAX_HT)))
  ------------------
  |  |   53|  8.29k|#define MAX_WD   8448
  ------------------
                                  (MAX_WD * MAX_HT)))
  ------------------
  |  |   64|  8.29k|#define MAX_HT   4320
  ------------------
 1899|      0|    {
 1900|      0|        return (IHEVCD_ERROR_T)IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
 1901|      0|    }
 1902|       |
 1903|       |    /* Update display width and display height */
 1904|  8.29k|    {
 1905|  8.29k|        WORD32 disp_wd, disp_ht;
 1906|  8.29k|        WORD32 crop_unit_x, crop_unit_y;
 1907|  8.29k|        crop_unit_x = 1;
 1908|  8.29k|        crop_unit_y = 1;
 1909|       |
 1910|  8.29k|        if(CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc)
  ------------------
  |  Branch (1910:12): [True: 8.29k, False: 0]
  ------------------
 1911|  8.29k|        {
 1912|  8.29k|            crop_unit_x = 2;
 1913|  8.29k|            crop_unit_y = 2;
 1914|  8.29k|        }
 1915|       |
 1916|  8.29k|        disp_wd = ps_sps->i2_pic_width_in_luma_samples;
 1917|  8.29k|        disp_wd -= ps_sps->i2_pic_crop_left_offset * crop_unit_x;
 1918|  8.29k|        disp_wd -= ps_sps->i2_pic_crop_right_offset * crop_unit_x;
 1919|       |
 1920|       |
 1921|  8.29k|        disp_ht = ps_sps->i2_pic_height_in_luma_samples;
 1922|  8.29k|        disp_ht -= ps_sps->i2_pic_crop_top_offset * crop_unit_y;
 1923|  8.29k|        disp_ht -= ps_sps->i2_pic_crop_bottom_offset * crop_unit_y;
 1924|       |
 1925|  8.29k|        if((0 >= disp_wd) || (0 >= disp_ht))
  ------------------
  |  Branch (1925:12): [True: 0, False: 8.29k]
  |  Branch (1925:30): [True: 0, False: 8.29k]
  ------------------
 1926|      0|            return IHEVCD_INVALID_PARAMETER;
 1927|       |
 1928|  8.29k|        if((0 != ps_codec->u4_allocate_dynamic_done) &&
  ------------------
  |  Branch (1928:12): [True: 6.73k, False: 1.56k]
  ------------------
 1929|  8.29k|                            ((ps_codec->i4_disp_wd != disp_wd) ||
  ------------------
  |  Branch (1929:30): [True: 0, False: 6.73k]
  ------------------
 1930|  6.73k|                            (ps_codec->i4_disp_ht != disp_ht)))
  ------------------
  |  Branch (1930:29): [True: 0, False: 6.73k]
  ------------------
 1931|      0|        {
 1932|      0|            if(0 == ps_codec->i4_first_pic_done)
  ------------------
  |  Branch (1932:16): [True: 0, False: 0]
  ------------------
 1933|      0|            {
 1934|      0|                return IHEVCD_INVALID_PARAMETER;
 1935|      0|            }
 1936|      0|            ps_codec->i4_reset_flag = 1;
 1937|      0|            return (IHEVCD_ERROR_T)IVD_RES_CHANGED;
 1938|      0|        }
 1939|       |
 1940|  8.29k|        ps_codec->i4_disp_wd = disp_wd;
 1941|  8.29k|        ps_codec->i4_disp_ht = disp_ht;
 1942|       |
 1943|       |
 1944|  8.29k|        ps_codec->i4_wd = ps_sps->i2_pic_width_in_luma_samples;
 1945|  8.29k|        ps_codec->i4_ht = ps_sps->i2_pic_height_in_luma_samples;
 1946|  8.29k|        ps_codec->u4_num_8x8_blks = ALIGN64(ps_codec->i4_wd) * ALIGN64(ps_codec->i4_ht) >> 6;
  ------------------
  |  |   50|  8.29k|#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|  8.29k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1947|       |
 1948|  8.29k|        {
 1949|  8.29k|            WORD32 ref_strd;
 1950|  8.29k|            ref_strd = ALIGN32(ps_sps->i2_pic_width_in_luma_samples + PAD_WD);
  ------------------
  |  |   51|  8.29k|#define ALIGN32(x)  ((((x) + 31) >> 5) << 5)
  ------------------
 1951|  8.29k|            if(ps_codec->i4_strd < ref_strd)
  ------------------
  |  Branch (1951:16): [True: 1.56k, False: 6.73k]
  ------------------
 1952|  1.56k|            {
 1953|  1.56k|                ps_codec->i4_strd = ref_strd;
 1954|  1.56k|            }
 1955|  8.29k|        }
 1956|       |
 1957|  8.29k|        if(0 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (1957:12): [True: 8.29k, False: 0]
  ------------------
 1958|  8.29k|        {
 1959|  8.29k|            if(ps_codec->i4_disp_strd < ps_codec->i4_disp_wd)
  ------------------
  |  Branch (1959:16): [True: 1.56k, False: 6.73k]
  ------------------
 1960|  1.56k|            {
 1961|  1.56k|                ps_codec->i4_disp_strd = ps_codec->i4_disp_wd;
 1962|  1.56k|            }
 1963|  8.29k|        }
 1964|      0|        else
 1965|      0|        {
 1966|      0|            if(ps_codec->i4_disp_strd < ps_codec->i4_strd)
  ------------------
  |  Branch (1966:16): [True: 0, False: 0]
  ------------------
 1967|      0|            {
 1968|      0|                ps_codec->i4_disp_strd = ps_codec->i4_strd;
 1969|      0|            }
 1970|      0|        }
 1971|  8.29k|    }
 1972|       |
 1973|       |    /* This is used only during initialization to get reorder count etc */
 1974|      0|    ps_codec->i4_sps_id = sps_id;
 1975|       |
 1976|  8.29k|    ps_codec->i4_sps_done = 1;
 1977|  8.29k|    return ret;
 1978|  8.29k|}
ihevcd_copy_sps:
 1996|  8.29k|{
 1997|  8.29k|    sps_t *ps_sps, *ps_sps_ref;
 1998|  8.29k|    WORD16 *pi2_scaling_mat_backup;
 1999|  8.29k|    WORD32 scaling_mat_size;
 2000|       |
 2001|  8.29k|    SCALING_MAT_SIZE(scaling_mat_size);
  ------------------
  |  |  194|  8.29k|#define SCALING_MAT_SIZE(m_scaling_mat_size)                                 \
  |  |  195|  8.29k|{                                                                            \
  |  |  196|  8.29k|    m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  419|  8.29k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |                   m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  419|  8.29k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |  197|  8.29k|    m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  420|  8.29k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  420|  8.29k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |  198|  8.29k|    m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  421|  8.29k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  421|  8.29k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |  199|  8.29k|    m_scaling_mat_size += 2 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  422|  8.29k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |                   m_scaling_mat_size += 2 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  422|  8.29k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |  200|  8.29k|}
  ------------------
 2002|  8.29k|    ps_sps_ref = ps_codec->ps_sps_base + sps_id_ref;
 2003|  8.29k|    ps_sps = ps_codec->ps_sps_base + sps_id;
 2004|       |
 2005|  8.29k|    if(ps_sps->i1_sps_valid)
  ------------------
  |  Branch (2005:8): [True: 6.71k, False: 1.57k]
  ------------------
 2006|  6.71k|    {
 2007|  6.71k|        if((ps_sps->i1_log2_ctb_size != ps_sps_ref->i1_log2_ctb_size) ||
  ------------------
  |  Branch (2007:12): [True: 0, False: 6.71k]
  ------------------
 2008|  6.71k|                        (ps_sps->i2_pic_wd_in_ctb != ps_sps_ref->i2_pic_wd_in_ctb) ||
  ------------------
  |  Branch (2008:25): [True: 0, False: 6.71k]
  ------------------
 2009|  6.71k|                        (ps_sps->i2_pic_ht_in_ctb != ps_sps_ref->i2_pic_ht_in_ctb))
  ------------------
  |  Branch (2009:25): [True: 0, False: 6.71k]
  ------------------
 2010|      0|        {
 2011|      0|            ihevcd_unmark_pps(ps_codec, sps_id);
 2012|      0|        }
 2013|  6.71k|    }
 2014|       |
 2015|  8.29k|    pi2_scaling_mat_backup = ps_sps->pi2_scaling_mat;
 2016|       |
 2017|  8.29k|    memcpy(ps_sps, ps_sps_ref, sizeof(sps_t));
 2018|  8.29k|    ps_sps->pi2_scaling_mat = pi2_scaling_mat_backup;
 2019|  8.29k|    memcpy(ps_sps->pi2_scaling_mat, ps_sps_ref->pi2_scaling_mat, scaling_mat_size * sizeof(WORD16));
 2020|  8.29k|    ps_sps->i1_sps_valid = 1;
 2021|       |
 2022|  8.29k|    ps_codec->s_parse.ps_sps = ps_sps;
 2023|  8.29k|}
ihevcd_parse_pps:
 2048|  14.2k|{
 2049|  14.2k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2050|  14.2k|    UWORD32 value;
 2051|  14.2k|    WORD32 i4_value;
 2052|  14.2k|    WORD32 pps_id;
 2053|       |
 2054|  14.2k|    pps_t *ps_pps;
 2055|  14.2k|    sps_t *ps_sps;
 2056|  14.2k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 2057|       |
 2058|       |
 2059|  14.2k|    if(0 == ps_codec->i4_sps_done)
  ------------------
  |  Branch (2059:8): [True: 1.57k, False: 12.6k]
  ------------------
 2060|  1.57k|        return IHEVCD_INVALID_HEADER;
 2061|       |
 2062|  12.6k|    UEV_PARSE("pic_parameter_set_id", value, ps_bitstrm);
  ------------------
  |  |  155|  12.6k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2063|       |
 2064|  12.6k|    pps_id = value;
 2065|  12.6k|    if((pps_id >= MAX_PPS_CNT) || (pps_id < 0))
  ------------------
  |  |  334|  12.6k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (2065:8): [True: 214, False: 12.4k]
  |  Branch (2065:35): [True: 174, False: 12.2k]
  ------------------
 2066|    388|    {
 2067|    388|        if(ps_codec->i4_pps_done)
  ------------------
  |  Branch (2067:12): [True: 361, False: 27]
  ------------------
 2068|    361|            return IHEVCD_UNSUPPORTED_PPS_ID;
 2069|     27|        else
 2070|     27|            pps_id = 0;
 2071|    388|    }
 2072|       |
 2073|       |
 2074|  12.3k|    ps_pps = (ps_codec->s_parse.ps_pps_base + MAX_PPS_CNT - 1);
  ------------------
  |  |  334|  12.3k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
 2075|       |
 2076|  12.3k|    ps_pps->i1_pps_id = pps_id;
 2077|       |
 2078|  12.3k|    UEV_PARSE("seq_parameter_set_id", value, ps_bitstrm);
  ------------------
  |  |  155|  12.3k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2079|  12.3k|    if(value > MAX_SPS_CNT - 2)
  ------------------
  |  |  317|  12.3k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  |  Branch (2079:8): [True: 37, False: 12.2k]
  ------------------
 2080|     37|    {
 2081|     37|        return IHEVCD_INVALID_PARAMETER;
 2082|     37|    }
 2083|  12.2k|    ps_pps->i1_sps_id = value;
 2084|       |
 2085|  12.2k|    ps_sps = (ps_codec->s_parse.ps_sps_base + ps_pps->i1_sps_id);
 2086|       |
 2087|       |    /* If the SPS that is being referred to has not been parsed,
 2088|       |     * copy an existing SPS to the current location */
 2089|  12.2k|    if(0 == ps_sps->i1_sps_valid)
  ------------------
  |  Branch (2089:8): [True: 869, False: 11.3k]
  ------------------
 2090|    869|    {
 2091|    869|        return IHEVCD_INVALID_HEADER;
 2092|       |
 2093|       |/*
 2094|       |        sps_t *ps_sps_ref = ps_codec->ps_sps_base;
 2095|       |        while(0 == ps_sps_ref->i1_sps_valid)
 2096|       |            ps_sps_ref++;
 2097|       |        ihevcd_copy_sps(ps_codec, ps_pps->i1_sps_id, ps_sps_ref->i1_sps_id);
 2098|       |*/
 2099|    869|    }
 2100|       |
 2101|  11.3k|    BITS_PARSE("dependent_slices_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  11.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2102|  11.3k|    ps_pps->i1_dependent_slice_enabled_flag = value;
 2103|       |
 2104|  11.3k|    BITS_PARSE("output_flag_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  11.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2105|  11.3k|    ps_pps->i1_output_flag_present_flag = value;
 2106|       |
 2107|  11.3k|    BITS_PARSE("num_extra_slice_header_bits", value, ps_bitstrm, 3);
  ------------------
  |  |  148|  11.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2108|  11.3k|    ps_pps->i1_num_extra_slice_header_bits = value;
 2109|       |
 2110|       |
 2111|  11.3k|    BITS_PARSE("sign_data_hiding_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  11.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2112|  11.3k|    ps_pps->i1_sign_data_hiding_flag = value;
 2113|       |
 2114|  11.3k|    BITS_PARSE("cabac_init_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  11.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2115|  11.3k|    ps_pps->i1_cabac_init_present_flag = value;
 2116|       |
 2117|  11.3k|    UEV_PARSE("num_ref_idx_l0_default_active_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  11.3k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2118|  11.3k|    if(value > MAX_DPB_SIZE - 2)
  ------------------
  |  |  281|  11.3k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (2118:8): [True: 27, False: 11.3k]
  ------------------
 2119|     27|    {
 2120|     27|         return IHEVCD_INVALID_PARAMETER;
 2121|     27|    }
 2122|  11.3k|    ps_pps->i1_num_ref_idx_l0_default_active = value + 1;
 2123|       |
 2124|  11.3k|    UEV_PARSE("num_ref_idx_l1_default_active_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  11.3k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2125|  11.3k|    if(value > MAX_DPB_SIZE - 2)
  ------------------
  |  |  281|  11.3k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (2125:8): [True: 9, False: 11.3k]
  ------------------
 2126|      9|    {
 2127|      9|        return IHEVCD_INVALID_PARAMETER;
 2128|      9|    }
 2129|  11.3k|    ps_pps->i1_num_ref_idx_l1_default_active = value + 1;
 2130|       |
 2131|  11.3k|    SEV_PARSE("pic_init_qp_minus26", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  11.3k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 2132|  11.3k|    if(i4_value < -26 || i4_value > 25)
  ------------------
  |  Branch (2132:8): [True: 0, False: 11.3k]
  |  Branch (2132:26): [True: 10, False: 11.3k]
  ------------------
 2133|     10|    {
 2134|     10|        return IHEVCD_INVALID_PARAMETER;
 2135|     10|    }
 2136|  11.3k|    ps_pps->i1_pic_init_qp = i4_value + 26;
 2137|       |
 2138|  11.3k|    BITS_PARSE("constrained_intra_pred_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  11.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2139|  11.3k|    ps_pps->i1_constrained_intra_pred_flag = value;
 2140|       |
 2141|  11.3k|    BITS_PARSE("transform_skip_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  11.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2142|  11.3k|    ps_pps->i1_transform_skip_enabled_flag = value;
 2143|       |
 2144|  11.3k|    BITS_PARSE("cu_qp_delta_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  11.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2145|  11.3k|    ps_pps->i1_cu_qp_delta_enabled_flag = value;
 2146|       |
 2147|  11.3k|    if(ps_pps->i1_cu_qp_delta_enabled_flag)
  ------------------
  |  Branch (2147:8): [True: 8.26k, False: 3.08k]
  ------------------
 2148|  8.26k|    {
 2149|  8.26k|        UEV_PARSE("diff_cu_qp_delta_depth", value, ps_bitstrm);
  ------------------
  |  |  155|  8.26k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2150|  8.26k|        if(value > ps_sps->i1_log2_diff_max_min_coding_block_size)
  ------------------
  |  Branch (2150:12): [True: 764, False: 7.50k]
  ------------------
 2151|    764|        {
 2152|    764|            return IHEVCD_INVALID_PARAMETER;
 2153|    764|        }
 2154|  7.50k|        ps_pps->i1_diff_cu_qp_delta_depth = value;
 2155|  7.50k|    }
 2156|  3.08k|    else
 2157|  3.08k|    {
 2158|  3.08k|        ps_pps->i1_diff_cu_qp_delta_depth = 0;
 2159|  3.08k|    }
 2160|  10.5k|    ps_pps->i1_log2_min_cu_qp_delta_size = ps_sps->i1_log2_ctb_size - ps_pps->i1_diff_cu_qp_delta_depth;
 2161|       |    /* Print different */
 2162|  10.5k|    SEV_PARSE("cb_qp_offset", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  10.5k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 2163|  10.5k|    if(i4_value < -12 || i4_value > 12)
  ------------------
  |  Branch (2163:8): [True: 5, False: 10.5k]
  |  Branch (2163:26): [True: 18, False: 10.5k]
  ------------------
 2164|     23|    {
 2165|     23|        return IHEVCD_INVALID_PARAMETER;
 2166|     23|    }
 2167|  10.5k|    ps_pps->i1_pic_cb_qp_offset = i4_value;
 2168|       |
 2169|       |    /* Print different */
 2170|  10.5k|    SEV_PARSE("cr_qp_offset", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  10.5k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 2171|  10.5k|    if(i4_value < -12 || i4_value > 12)
  ------------------
  |  Branch (2171:8): [True: 0, False: 10.5k]
  |  Branch (2171:26): [True: 11, False: 10.5k]
  ------------------
 2172|     11|    {
 2173|     11|        return IHEVCD_INVALID_PARAMETER;
 2174|     11|    }
 2175|  10.5k|    ps_pps->i1_pic_cr_qp_offset = i4_value;
 2176|       |
 2177|       |    /* Print different */
 2178|  10.5k|    BITS_PARSE("slicelevel_chroma_qp_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2179|  10.5k|    ps_pps->i1_pic_slice_level_chroma_qp_offsets_present_flag = value;
 2180|       |
 2181|  10.5k|    BITS_PARSE("weighted_pred_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2182|  10.5k|    ps_pps->i1_weighted_pred_flag = value;
 2183|       |
 2184|  10.5k|    BITS_PARSE("weighted_bipred_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2185|  10.5k|    ps_pps->i1_weighted_bipred_flag = value;
 2186|       |
 2187|  10.5k|    BITS_PARSE("transquant_bypass_enable_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2188|  10.5k|    ps_pps->i1_transquant_bypass_enable_flag = value;
 2189|       |
 2190|  10.5k|    BITS_PARSE("tiles_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2191|  10.5k|    ps_pps->i1_tiles_enabled_flag = value;
 2192|       |
 2193|       |    /* When tiles are enabled and width or height is >= 4096,
 2194|       |     * CTB Size should at least be 32 while if width or height is >= 8192,
 2195|       |     * CTB Size should at least be 64 and so on. 16x16 CTBs can result
 2196|       |     * in tile position greater than 255 for 4096 while 32x32 CTBs can result
 2197|       |     * in tile position greater than 255 for 8192,
 2198|       |     * which decoder does not support.
 2199|       |     */
 2200|  10.5k|    if (ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (2200:9): [True: 4.63k, False: 5.91k]
  ------------------
 2201|  4.63k|    {
 2202|  4.63k|        if((ps_sps->i1_log2_ctb_size == 4) &&
  ------------------
  |  Branch (2202:12): [True: 186, False: 4.45k]
  ------------------
 2203|  4.63k|            ((ps_sps->i2_pic_width_in_luma_samples >= 4096) ||
  ------------------
  |  Branch (2203:14): [True: 0, False: 186]
  ------------------
 2204|    186|            (ps_sps->i2_pic_height_in_luma_samples >= 4096)))
  ------------------
  |  Branch (2204:13): [True: 0, False: 186]
  ------------------
 2205|      0|        {
 2206|      0|            return IHEVCD_INVALID_HEADER;
 2207|      0|        }
 2208|  4.63k|        if((ps_sps->i1_log2_ctb_size == 5) &&
  ------------------
  |  Branch (2208:12): [True: 4.25k, False: 380]
  ------------------
 2209|  4.63k|            ((ps_sps->i2_pic_width_in_luma_samples >= 8192) ||
  ------------------
  |  Branch (2209:14): [True: 0, False: 4.25k]
  ------------------
 2210|  4.25k|            (ps_sps->i2_pic_height_in_luma_samples >= 8192)))
  ------------------
  |  Branch (2210:13): [True: 0, False: 4.25k]
  ------------------
 2211|      0|        {
 2212|      0|            return IHEVCD_INVALID_HEADER;
 2213|      0|        }
 2214|  4.63k|        if((ps_sps->i1_log2_ctb_size == 6) &&
  ------------------
  |  Branch (2214:12): [True: 194, False: 4.44k]
  ------------------
 2215|  4.63k|            ((ps_sps->i2_pic_width_in_luma_samples >= 16384) ||
  ------------------
  |  Branch (2215:14): [True: 0, False: 194]
  ------------------
 2216|    194|            (ps_sps->i2_pic_height_in_luma_samples >= 16384)))
  ------------------
  |  Branch (2216:13): [True: 0, False: 194]
  ------------------
 2217|      0|        {
 2218|      0|            return IHEVCD_INVALID_HEADER;
 2219|      0|        }
 2220|  4.63k|    }
 2221|       |
 2222|  10.5k|    BITS_PARSE("entropy_coding_sync_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2223|  10.5k|    ps_pps->i1_entropy_coding_sync_enabled_flag = value;
 2224|       |
 2225|  10.5k|    ps_pps->i1_loop_filter_across_tiles_enabled_flag = 0;
 2226|  10.5k|    if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (2226:8): [True: 4.63k, False: 5.91k]
  ------------------
 2227|  4.63k|    {
 2228|  4.63k|        WORD32 wd = ALIGN64(ps_codec->i4_wd);
  ------------------
  |  |   50|  4.63k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2229|  4.63k|        WORD32 ht = ALIGN64(ps_codec->i4_ht);
  ------------------
  |  |   50|  4.63k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2230|       |
 2231|  4.63k|        WORD32 max_tile_cols = (wd + MIN_TILE_WD - 1) / MIN_TILE_WD;
  ------------------
  |  |  305|  4.63k|#define MIN_TILE_WD  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  341|  4.63k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
                      WORD32 max_tile_cols = (wd + MIN_TILE_WD - 1) / MIN_TILE_WD;
  ------------------
  |  |  305|  4.63k|#define MIN_TILE_WD  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  341|  4.63k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
 2232|  4.63k|        WORD32 max_tile_rows = (ht + MIN_TILE_HT - 1) / MIN_TILE_HT;
  ------------------
  |  |  308|  4.63k|#define MIN_TILE_HT  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  341|  4.63k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
                      WORD32 max_tile_rows = (ht + MIN_TILE_HT - 1) / MIN_TILE_HT;
  ------------------
  |  |  308|  4.63k|#define MIN_TILE_HT  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  341|  4.63k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
 2233|       |
 2234|  4.63k|        UEV_PARSE("num_tile_columns_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  4.63k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2235|  4.63k|        ps_pps->i1_num_tile_columns = value + 1;
 2236|       |
 2237|  4.63k|        UEV_PARSE("num_tile_rows_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  4.63k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2238|  4.63k|        ps_pps->i1_num_tile_rows = value + 1;
 2239|       |
 2240|  4.63k|        if((ps_pps->i1_num_tile_columns < 1) ||
  ------------------
  |  Branch (2240:12): [True: 1, False: 4.63k]
  ------------------
 2241|  4.63k|                        (ps_pps->i1_num_tile_columns > max_tile_cols) ||
  ------------------
  |  Branch (2241:25): [True: 2, False: 4.63k]
  ------------------
 2242|  4.63k|                        (ps_pps->i1_num_tile_rows < 1) ||
  ------------------
  |  Branch (2242:25): [True: 0, False: 4.63k]
  ------------------
 2243|  4.63k|                        (ps_pps->i1_num_tile_rows > max_tile_rows))
  ------------------
  |  Branch (2243:25): [True: 35, False: 4.59k]
  ------------------
 2244|     38|            return IHEVCD_INVALID_HEADER;
 2245|       |
 2246|  4.59k|        BITS_PARSE("uniform_spacing_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  4.59k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2247|  4.59k|        ps_pps->i1_uniform_spacing_flag = value;
 2248|       |
 2249|       |
 2250|  4.59k|        {
 2251|       |
 2252|  4.59k|            UWORD32 start;
 2253|  4.59k|            WORD32 i, j;
 2254|       |
 2255|       |
 2256|  4.59k|            start = 0;
 2257|  9.77k|            for(i = 0; i < ps_pps->i1_num_tile_columns; i++)
  ------------------
  |  Branch (2257:24): [True: 5.17k, False: 4.59k]
  ------------------
 2258|  5.17k|            {
 2259|  5.17k|                tile_t *ps_tile;
 2260|  5.17k|                if(!ps_pps->i1_uniform_spacing_flag)
  ------------------
  |  Branch (2260:20): [True: 4.37k, False: 799]
  ------------------
 2261|  4.37k|                {
 2262|  4.37k|                    if(i < (ps_pps->i1_num_tile_columns - 1))
  ------------------
  |  Branch (2262:24): [True: 69, False: 4.31k]
  ------------------
 2263|     69|                    {
 2264|     69|                        UEV_PARSE("column_width_minus1[ i ]", value, ps_bitstrm);
  ------------------
  |  |  155|     69|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2265|     69|                        value += 1;
 2266|     69|                        if (value >= ps_sps->i2_pic_wd_in_ctb - start)
  ------------------
  |  Branch (2266:29): [True: 0, False: 69]
  ------------------
 2267|      0|                        {
 2268|      0|                            return IHEVCD_INVALID_HEADER;
 2269|      0|                        }
 2270|     69|                    }
 2271|  4.31k|                    else
 2272|  4.31k|                    {
 2273|  4.31k|                        value = ps_sps->i2_pic_wd_in_ctb - start;
 2274|  4.31k|                    }
 2275|  4.37k|                }
 2276|    799|                else
 2277|    799|                {
 2278|    799|                    value = ((i + 1) * ps_sps->i2_pic_wd_in_ctb) / ps_pps->i1_num_tile_columns -
 2279|    799|                                    (i * ps_sps->i2_pic_wd_in_ctb) / ps_pps->i1_num_tile_columns;
 2280|    799|                }
 2281|       |
 2282|  11.9k|                for(j = 0; j < ps_pps->i1_num_tile_rows; j++)
  ------------------
  |  Branch (2282:28): [True: 6.76k, False: 5.17k]
  ------------------
 2283|  6.76k|                {
 2284|  6.76k|                    ps_tile = ps_pps->ps_tile + j * ps_pps->i1_num_tile_columns + i;
 2285|  6.76k|                    ps_tile->u1_pos_x = start;
 2286|  6.76k|                    ps_tile->u2_wd = value;
 2287|  6.76k|                }
 2288|  5.17k|                start += value;
 2289|       |
 2290|  5.17k|                if((start > ps_sps->i2_pic_wd_in_ctb) ||
  ------------------
  |  Branch (2290:20): [True: 0, False: 5.17k]
  ------------------
 2291|  5.17k|                                (value == 0))
  ------------------
  |  Branch (2291:33): [True: 0, False: 5.17k]
  ------------------
 2292|      0|                    return IHEVCD_INVALID_HEADER;
 2293|  5.17k|            }
 2294|       |
 2295|  4.59k|            start = 0;
 2296|  10.0k|            for(i = 0; i < (ps_pps->i1_num_tile_rows); i++)
  ------------------
  |  Branch (2296:24): [True: 5.42k, False: 4.59k]
  ------------------
 2297|  5.42k|            {
 2298|  5.42k|                tile_t *ps_tile;
 2299|  5.42k|                if(!ps_pps->i1_uniform_spacing_flag)
  ------------------
  |  Branch (2299:20): [True: 4.36k, False: 1.05k]
  ------------------
 2300|  4.36k|                {
 2301|  4.36k|                    if(i < (ps_pps->i1_num_tile_rows - 1))
  ------------------
  |  Branch (2301:24): [True: 57, False: 4.31k]
  ------------------
 2302|     57|                    {
 2303|       |
 2304|     57|                        UEV_PARSE("row_height_minus1[ i ]", value, ps_bitstrm);
  ------------------
  |  |  155|     57|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2305|     57|                        value += 1;
 2306|     57|                        if (value >= ps_sps->i2_pic_ht_in_ctb - start)
  ------------------
  |  Branch (2306:29): [True: 0, False: 57]
  ------------------
 2307|      0|                        {
 2308|      0|                            return IHEVCD_INVALID_HEADER;
 2309|      0|                        }
 2310|     57|                    }
 2311|  4.31k|                    else
 2312|  4.31k|                    {
 2313|  4.31k|                        value = ps_sps->i2_pic_ht_in_ctb - start;
 2314|  4.31k|                    }
 2315|  4.36k|                }
 2316|  1.05k|                else
 2317|  1.05k|                {
 2318|  1.05k|                    value = ((i + 1) * ps_sps->i2_pic_ht_in_ctb) / ps_pps->i1_num_tile_rows -
 2319|  1.05k|                                    (i * ps_sps->i2_pic_ht_in_ctb) / ps_pps->i1_num_tile_rows;
 2320|  1.05k|                }
 2321|       |
 2322|  12.1k|                for(j = 0; j < ps_pps->i1_num_tile_columns; j++)
  ------------------
  |  Branch (2322:28): [True: 6.76k, False: 5.42k]
  ------------------
 2323|  6.76k|                {
 2324|  6.76k|                    ps_tile = ps_pps->ps_tile + i * ps_pps->i1_num_tile_columns + j;
 2325|  6.76k|                    ps_tile->u1_pos_y = start;
 2326|  6.76k|                    ps_tile->u2_ht = value;
 2327|  6.76k|                }
 2328|  5.42k|                start += value;
 2329|       |
 2330|  5.42k|                if((start > ps_sps->i2_pic_ht_in_ctb) ||
  ------------------
  |  Branch (2330:20): [True: 0, False: 5.42k]
  ------------------
 2331|  5.42k|                                (value == 0))
  ------------------
  |  Branch (2331:33): [True: 0, False: 5.42k]
  ------------------
 2332|      0|                    return IHEVCD_INVALID_HEADER;
 2333|  5.42k|            }
 2334|  4.59k|        }
 2335|       |
 2336|       |
 2337|  4.59k|        BITS_PARSE("loop_filter_across_tiles_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  4.59k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2338|  4.59k|        ps_pps->i1_loop_filter_across_tiles_enabled_flag = value;
 2339|       |
 2340|  4.59k|    }
 2341|  5.91k|    else
 2342|  5.91k|    {
 2343|       |        /* If tiles are not present, set first tile in each PPS to have tile
 2344|       |        width and height equal to picture width and height */
 2345|  5.91k|        ps_pps->i1_num_tile_columns = 1;
 2346|  5.91k|        ps_pps->i1_num_tile_rows = 1;
 2347|  5.91k|        ps_pps->i1_uniform_spacing_flag = 1;
 2348|       |
 2349|  5.91k|        ps_pps->ps_tile->u1_pos_x = 0;
 2350|  5.91k|        ps_pps->ps_tile->u1_pos_y = 0;
 2351|  5.91k|        ps_pps->ps_tile->u2_wd = ps_sps->i2_pic_wd_in_ctb;
 2352|  5.91k|        ps_pps->ps_tile->u2_ht = ps_sps->i2_pic_ht_in_ctb;
 2353|  5.91k|    }
 2354|       |
 2355|  10.5k|    BITS_PARSE("loop_filter_across_slices_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2356|  10.5k|    ps_pps->i1_loop_filter_across_slices_enabled_flag = value;
 2357|       |
 2358|  10.5k|    BITS_PARSE("deblocking_filter_control_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2359|  10.5k|    ps_pps->i1_deblocking_filter_control_present_flag = value;
 2360|       |
 2361|       |    /* Default values */
 2362|  10.5k|    ps_pps->i1_pic_disable_deblocking_filter_flag = 0;
 2363|  10.5k|    ps_pps->i1_deblocking_filter_override_enabled_flag = 0;
 2364|  10.5k|    ps_pps->i1_beta_offset_div2 = 0;
 2365|  10.5k|    ps_pps->i1_tc_offset_div2 = 0;
 2366|       |
 2367|  10.5k|    if(ps_pps->i1_deblocking_filter_control_present_flag)
  ------------------
  |  Branch (2367:8): [True: 369, False: 10.1k]
  ------------------
 2368|    369|    {
 2369|       |
 2370|    369|        BITS_PARSE("deblocking_filter_override_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|    369|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2371|    369|        ps_pps->i1_deblocking_filter_override_enabled_flag = value;
 2372|       |
 2373|    369|        BITS_PARSE("pic_disable_deblocking_filter_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|    369|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2374|    369|        ps_pps->i1_pic_disable_deblocking_filter_flag = value;
 2375|       |
 2376|    369|        if(!ps_pps->i1_pic_disable_deblocking_filter_flag)
  ------------------
  |  Branch (2376:12): [True: 118, False: 251]
  ------------------
 2377|    118|        {
 2378|       |
 2379|    118|            SEV_PARSE("pps_beta_offset_div2", i4_value, ps_bitstrm);
  ------------------
  |  |  162|    118|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 2380|    118|            if(i4_value < -6 || i4_value > 6)
  ------------------
  |  Branch (2380:16): [True: 4, False: 114]
  |  Branch (2380:33): [True: 6, False: 108]
  ------------------
 2381|     10|            {
 2382|     10|                return IHEVCD_INVALID_PARAMETER;
 2383|     10|            }
 2384|    108|            ps_pps->i1_beta_offset_div2 = i4_value;
 2385|       |
 2386|    108|            SEV_PARSE("pps_tc_offset_div2", i4_value, ps_bitstrm);
  ------------------
  |  |  162|    108|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
 2387|    108|            if(i4_value < -6 || i4_value > 6)
  ------------------
  |  Branch (2387:16): [True: 0, False: 108]
  |  Branch (2387:33): [True: 1, False: 107]
  ------------------
 2388|      1|            {
 2389|      1|                return IHEVCD_INVALID_PARAMETER;
 2390|      1|            }
 2391|    107|            ps_pps->i1_tc_offset_div2 = i4_value;
 2392|       |
 2393|    107|        }
 2394|    369|    }
 2395|       |
 2396|  10.5k|    BITS_PARSE("pps_scaling_list_data_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2397|  10.5k|    ps_pps->i1_pps_scaling_list_data_present_flag = value;
 2398|       |
 2399|  10.5k|    if(ps_pps->i1_pps_scaling_list_data_present_flag)
  ------------------
  |  Branch (2399:8): [True: 1.45k, False: 9.05k]
  ------------------
 2400|  1.45k|    {
 2401|  1.45k|        COPY_DEFAULT_SCALING_LIST(ps_pps->pi2_scaling_mat);
  ------------------
  |  |   76|  1.45k|#define COPY_DEFAULT_SCALING_LIST(pi2_scaling_mat)                                                                                      \
  |  |   77|  1.45k|{                                                                                                                                       \
  |  |   78|  1.45k|    WORD32 scaling_mat_offset[]={0, 16, 32, 48, 64, 80, 96, 160, 224, 288, 352, 416, 480, 736, 992, 1248, 1504, 1760, 2016, 3040};      \
  |  |   79|  1.45k|                                                                                                                                        \
  |  |   80|  1.45k|    /* scaling matrix for 4x4 */                                                                                                        \
  |  |   81|  1.45k|    memcpy(pi2_scaling_mat, gi2_flat_scale_mat_32x32, 6*16*sizeof(WORD16));                                                             \
  |  |   82|  1.45k|/* scaling matrix for 8x8 */                                                                                                            \
  |  |   83|  1.45k|    memcpy(pi2_scaling_mat + scaling_mat_offset[6], gi2_intra_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   84|  1.45k|    memcpy(pi2_scaling_mat + scaling_mat_offset[7], gi2_intra_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   85|  1.45k|    memcpy(pi2_scaling_mat + scaling_mat_offset[8], gi2_intra_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   86|  1.45k|    memcpy(pi2_scaling_mat + scaling_mat_offset[9], gi2_inter_default_scale_mat_8x8, 64*sizeof(WORD16));                                \
  |  |   87|  1.45k|    memcpy(pi2_scaling_mat + scaling_mat_offset[10], gi2_inter_default_scale_mat_8x8, 64*sizeof(WORD16));                               \
  |  |   88|  1.45k|    memcpy(pi2_scaling_mat + scaling_mat_offset[11], gi2_inter_default_scale_mat_8x8, 64*sizeof(WORD16));                               \
  |  |   89|  1.45k|    /* scaling matrix for 16x16 */                                                                                                      \
  |  |   90|  1.45k|    memcpy(pi2_scaling_mat + scaling_mat_offset[12], gi2_intra_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   91|  1.45k|    memcpy(pi2_scaling_mat + scaling_mat_offset[13], gi2_intra_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   92|  1.45k|    memcpy(pi2_scaling_mat + scaling_mat_offset[14], gi2_intra_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   93|  1.45k|    memcpy(pi2_scaling_mat + scaling_mat_offset[15], gi2_inter_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   94|  1.45k|    memcpy(pi2_scaling_mat + scaling_mat_offset[16], gi2_inter_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   95|  1.45k|    memcpy(pi2_scaling_mat + scaling_mat_offset[17], gi2_inter_default_scale_mat_16x16, 256*sizeof(WORD16));                            \
  |  |   96|  1.45k|    /* scaling matrix for 32x32 */                                                                                                      \
  |  |   97|  1.45k|    memcpy(pi2_scaling_mat + scaling_mat_offset[18], gi2_intra_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |   98|  1.45k|    memcpy(pi2_scaling_mat + scaling_mat_offset[19], gi2_inter_default_scale_mat_32x32, 1024*sizeof(WORD16));                           \
  |  |   99|  1.45k|}
  ------------------
 2402|  1.45k|        ihevcd_scaling_list_data(ps_codec, ps_pps->pi2_scaling_mat);
 2403|  1.45k|    }
 2404|       |
 2405|  10.5k|    BITS_PARSE("lists_modification_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2406|  10.5k|    ps_pps->i1_lists_modification_present_flag = value;
 2407|  10.5k|    UEV_PARSE("log2_parallel_merge_level_minus2", value, ps_bitstrm);
  ------------------
  |  |  155|  10.5k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2408|  10.5k|    if(value > (ps_sps->i1_log2_min_coding_block_size + ps_sps->i1_log2_diff_max_min_coding_block_size))
  ------------------
  |  Branch (2408:8): [True: 52, False: 10.4k]
  ------------------
 2409|     52|    {
 2410|     52|        return IHEVCD_INVALID_PARAMETER;
 2411|     52|    }
 2412|  10.4k|    ps_pps->i1_log2_parallel_merge_level = value + 2;
 2413|       |
 2414|  10.4k|    BITS_PARSE("slice_header_extension_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.4k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2415|  10.4k|    ps_pps->i1_slice_header_extension_present_flag = value;
 2416|       |    /* Not present in HM */
 2417|  10.4k|    BITS_PARSE("pps_extension_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.4k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2418|       |
 2419|  10.4k|    if((UWORD8 *)ps_bitstrm->pu4_buf > ps_bitstrm->pu1_buf_max)
  ------------------
  |  Branch (2419:8): [True: 4, False: 10.4k]
  ------------------
 2420|      4|        return IHEVCD_INVALID_PARAMETER;
 2421|       |
 2422|  10.4k|    ps_codec->i4_pps_done = 1;
 2423|  10.4k|    return ret;
 2424|  10.4k|}
ihevcd_copy_pps:
 2428|  12.3k|{
 2429|  12.3k|    pps_t *ps_pps, *ps_pps_ref;
 2430|  12.3k|    WORD16 *pi2_scaling_mat_backup;
 2431|  12.3k|    WORD32 scaling_mat_size;
 2432|  12.3k|    tile_t *ps_tile_backup;
 2433|  12.3k|    WORD32 max_tile_cols, max_tile_rows;
 2434|  12.3k|    WORD32 wd, ht;
 2435|  12.3k|    wd = ALIGN64(ps_codec->i4_wd);
  ------------------
  |  |   50|  12.3k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2436|  12.3k|    ht = ALIGN64(ps_codec->i4_ht);
  ------------------
  |  |   50|  12.3k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2437|       |
 2438|  12.3k|    SCALING_MAT_SIZE(scaling_mat_size);
  ------------------
  |  |  194|  12.3k|#define SCALING_MAT_SIZE(m_scaling_mat_size)                                 \
  |  |  195|  12.3k|{                                                                            \
  |  |  196|  12.3k|    m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  419|  12.3k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |                   m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4;                    \
  |  |  ------------------
  |  |  |  |  419|  12.3k|#define TRANS_SIZE_4   4
  |  |  ------------------
  |  |  197|  12.3k|    m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  420|  12.3k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8;                   \
  |  |  ------------------
  |  |  |  |  420|  12.3k|#define TRANS_SIZE_8   8
  |  |  ------------------
  |  |  198|  12.3k|    m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  421|  12.3k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |                   m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16;                 \
  |  |  ------------------
  |  |  |  |  421|  12.3k|#define TRANS_SIZE_16 16
  |  |  ------------------
  |  |  199|  12.3k|    m_scaling_mat_size += 2 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  422|  12.3k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |                   m_scaling_mat_size += 2 * TRANS_SIZE_32 * TRANS_SIZE_32;                 \
  |  |  ------------------
  |  |  |  |  422|  12.3k|#define TRANS_SIZE_32 32
  |  |  ------------------
  |  |  200|  12.3k|}
  ------------------
 2439|  12.3k|    max_tile_cols = (wd + MIN_TILE_WD - 1) / MIN_TILE_WD;
  ------------------
  |  |  305|  12.3k|#define MIN_TILE_WD  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  341|  12.3k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
                  max_tile_cols = (wd + MIN_TILE_WD - 1) / MIN_TILE_WD;
  ------------------
  |  |  305|  12.3k|#define MIN_TILE_WD  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  341|  12.3k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
 2440|  12.3k|    max_tile_rows = (ht + MIN_TILE_HT - 1) / MIN_TILE_HT;
  ------------------
  |  |  308|  12.3k|#define MIN_TILE_HT  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  341|  12.3k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
                  max_tile_rows = (ht + MIN_TILE_HT - 1) / MIN_TILE_HT;
  ------------------
  |  |  308|  12.3k|#define MIN_TILE_HT  MAX_CTB_SIZE
  |  |  ------------------
  |  |  |  |  341|  12.3k|#define MAX_CTB_SIZE        64
  |  |  ------------------
  ------------------
 2441|       |
 2442|  12.3k|    ps_pps_ref = ps_codec->ps_pps_base + pps_id_ref;
 2443|  12.3k|    ps_pps = ps_codec->ps_pps_base + pps_id;
 2444|       |
 2445|  12.3k|    pi2_scaling_mat_backup = ps_pps->pi2_scaling_mat;
 2446|  12.3k|    ps_tile_backup = ps_pps->ps_tile;
 2447|       |
 2448|  12.3k|    memcpy(ps_pps, ps_pps_ref, sizeof(pps_t));
 2449|  12.3k|    ps_pps->pi2_scaling_mat = pi2_scaling_mat_backup;
 2450|  12.3k|    ps_pps->ps_tile = ps_tile_backup;
 2451|  12.3k|    memcpy(ps_pps->pi2_scaling_mat, ps_pps_ref->pi2_scaling_mat, scaling_mat_size * sizeof(WORD16));
 2452|  12.3k|    memcpy(ps_pps->ps_tile, ps_pps_ref->ps_tile, max_tile_cols * max_tile_rows * sizeof(tile_t));
 2453|       |
 2454|  12.3k|    ps_pps->i1_pps_valid = 1;
 2455|       |
 2456|  12.3k|    ps_codec->s_parse.ps_pps = ps_pps;
 2457|  12.3k|}
ihevcd_parse_buffering_period_sei:
 2462|    114|{
 2463|    114|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
 2464|    114|    bitstrm_t *ps_bitstrm = &ps_parse->s_bitstrm;
 2465|    114|    UWORD32 value;
 2466|    114|    vui_t *ps_vui;
 2467|    114|    buf_period_sei_params_t *ps_buf_period_sei_params;
 2468|    114|    UWORD32 i;
 2469|    114|    hrd_params_t *ps_vui_hdr;
 2470|    114|    UWORD32 u4_cpb_cnt;
 2471|       |
 2472|    114|    ps_vui = &ps_sps->s_vui_parameters;
 2473|    114|    ps_vui_hdr = &ps_vui->s_vui_hrd_parameters;
 2474|       |
 2475|    114|    ps_buf_period_sei_params = &ps_parse->s_sei_params.s_buf_period_sei_params;
 2476|       |
 2477|    114|    ps_parse->s_sei_params.i1_buf_period_params_present_flag = 1;
 2478|       |
 2479|    114|    UEV_PARSE("bp_seq_parameter_set_id", value, ps_bitstrm);
  ------------------
  |  |  155|    114|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2480|    114|    if(value > MAX_SPS_CNT - 2)
  ------------------
  |  |  317|    114|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  |  Branch (2480:8): [True: 7, False: 107]
  ------------------
 2481|      7|    {
 2482|      7|        return IHEVCD_INVALID_PARAMETER;
 2483|      7|    }
 2484|    107|    ps_buf_period_sei_params->u1_bp_seq_parameter_set_id = value;
 2485|       |
 2486|    107|    if(!ps_vui_hdr->u1_sub_pic_cpb_params_present_flag)
  ------------------
  |  Branch (2486:8): [True: 107, False: 0]
  ------------------
 2487|    107|    {
 2488|    107|        BITS_PARSE("irap_cpb_params_present_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|    107|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2489|    107|        ps_buf_period_sei_params->u1_rap_cpb_params_present_flag = value;
 2490|    107|    }
 2491|       |
 2492|    107|    if(ps_buf_period_sei_params->u1_rap_cpb_params_present_flag)
  ------------------
  |  Branch (2492:8): [True: 23, False: 84]
  ------------------
 2493|     23|    {
 2494|     23|        BITS_PARSE("cpb_delay_offset",
  ------------------
  |  |  148|     23|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2495|     23|                   value,
 2496|     23|                   ps_bitstrm,
 2497|     23|                   (ps_vui_hdr->u1_au_cpb_removal_delay_length_minus1
 2498|     23|                                   + 1));
 2499|     23|        ps_buf_period_sei_params->u4_cpb_delay_offset = value;
 2500|       |
 2501|     23|        BITS_PARSE("dpb_delay_offset",
  ------------------
  |  |  148|     23|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2502|     23|                   value,
 2503|     23|                   ps_bitstrm,
 2504|     23|                   (ps_vui_hdr->u1_dpb_output_delay_length_minus1
 2505|     23|                                   + 1));
 2506|     23|        ps_buf_period_sei_params->u4_dpb_delay_offset = value;
 2507|     23|    }
 2508|     84|    else
 2509|     84|    {
 2510|     84|        ps_buf_period_sei_params->u4_cpb_delay_offset = 0;
 2511|     84|        ps_buf_period_sei_params->u4_dpb_delay_offset = 0;
 2512|     84|    }
 2513|       |
 2514|    107|    BITS_PARSE("concatenation_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|    107|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2515|    107|    ps_buf_period_sei_params->u1_concatenation_flag = value;
 2516|       |
 2517|    107|    BITS_PARSE("au_cpb_removal_delay_delta_minus1",
  ------------------
  |  |  148|    107|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2518|    107|               value,
 2519|    107|               ps_bitstrm,
 2520|    107|               (ps_vui_hdr->u1_au_cpb_removal_delay_length_minus1
 2521|    107|                               + 1));
 2522|    107|    ps_buf_period_sei_params->u4_au_cpb_removal_delay_delta_minus1 = value;
 2523|       |
 2524|    107|    if(ps_vui_hdr->u1_nal_hrd_parameters_present_flag)
  ------------------
  |  Branch (2524:8): [True: 36, False: 71]
  ------------------
 2525|     36|    {
 2526|     36|        u4_cpb_cnt = ps_vui_hdr->au1_cpb_cnt_minus1[0];
 2527|       |
 2528|     72|        for(i = 0; i <= u4_cpb_cnt; i++)
  ------------------
  |  Branch (2528:20): [True: 36, False: 36]
  ------------------
 2529|     36|        {
 2530|     36|            BITS_PARSE("nal_initial_cpb_removal_delay[i]",
  ------------------
  |  |  148|     36|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2531|     36|                       value,
 2532|     36|                       ps_bitstrm,
 2533|     36|                       (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 2534|     36|                                       + 1));
 2535|     36|            ps_buf_period_sei_params->au4_nal_initial_cpb_removal_delay[i] =
 2536|     36|                            value;
 2537|       |
 2538|     36|            BITS_PARSE("nal_initial_cpb_removal_delay_offset",
  ------------------
  |  |  148|     36|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2539|     36|                       value,
 2540|     36|                       ps_bitstrm,
 2541|     36|                       (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 2542|     36|                                       + 1));
 2543|     36|            ps_buf_period_sei_params->au4_nal_initial_cpb_removal_delay_offset[i] =
 2544|     36|                            value;
 2545|       |
 2546|     36|            if(ps_vui_hdr->u1_sub_pic_cpb_params_present_flag
  ------------------
  |  Branch (2546:16): [True: 0, False: 36]
  ------------------
 2547|     36|                            || ps_buf_period_sei_params->u1_rap_cpb_params_present_flag)
  ------------------
  |  Branch (2547:32): [True: 9, False: 27]
  ------------------
 2548|      9|            {
 2549|      9|                BITS_PARSE("nal_initial_alt_cpb_removal_delay[i]",
  ------------------
  |  |  148|      9|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2550|      9|                           value,
 2551|      9|                           ps_bitstrm,
 2552|      9|                           (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 2553|      9|                                           + 1));
 2554|      9|                ps_buf_period_sei_params->au4_nal_initial_alt_cpb_removal_delay[i] =
 2555|      9|                                value;
 2556|       |
 2557|      9|                BITS_PARSE("nal_initial_alt_cpb_removal_delay_offset",
  ------------------
  |  |  148|      9|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2558|      9|                           value,
 2559|      9|                           ps_bitstrm,
 2560|      9|                           (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 2561|      9|                                           + 1));
 2562|      9|                ps_buf_period_sei_params->au4_nal_initial_alt_cpb_removal_delay_offset[i] =
 2563|      9|                                value;
 2564|      9|            }
 2565|     36|        }
 2566|     36|    }
 2567|       |
 2568|    107|    if(ps_vui_hdr->u1_vcl_hrd_parameters_present_flag)
  ------------------
  |  Branch (2568:8): [True: 0, False: 107]
  ------------------
 2569|      0|    {
 2570|      0|        u4_cpb_cnt = ps_vui_hdr->au1_cpb_cnt_minus1[0];
 2571|       |
 2572|      0|        for(i = 0; i <= u4_cpb_cnt; i++)
  ------------------
  |  Branch (2572:20): [True: 0, False: 0]
  ------------------
 2573|      0|        {
 2574|      0|            BITS_PARSE("vcl_initial_cpb_removal_delay[i]",
  ------------------
  |  |  148|      0|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2575|      0|                       value,
 2576|      0|                       ps_bitstrm,
 2577|      0|                       (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 2578|      0|                                       + 1));
 2579|      0|            ps_buf_period_sei_params->au4_vcl_initial_cpb_removal_delay[i] =
 2580|      0|                            value;
 2581|       |
 2582|      0|            BITS_PARSE("vcl_initial_cpb_removal_delay_offset",
  ------------------
  |  |  148|      0|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2583|      0|                       value,
 2584|      0|                       ps_bitstrm,
 2585|      0|                       (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 2586|      0|                                       + 1));
 2587|      0|            ps_buf_period_sei_params->au4_vcl_initial_cpb_removal_delay_offset[i] =
 2588|      0|                            value;
 2589|       |
 2590|      0|            if(ps_vui_hdr->u1_sub_pic_cpb_params_present_flag
  ------------------
  |  Branch (2590:16): [True: 0, False: 0]
  ------------------
 2591|      0|                            || ps_buf_period_sei_params->u1_rap_cpb_params_present_flag)
  ------------------
  |  Branch (2591:32): [True: 0, False: 0]
  ------------------
 2592|      0|            {
 2593|      0|                BITS_PARSE("vcl_initial_alt_cpb_removal_delay[i]",
  ------------------
  |  |  148|      0|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2594|      0|                           value,
 2595|      0|                           ps_bitstrm,
 2596|      0|                           (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 2597|      0|                                           + 1));
 2598|      0|                ps_buf_period_sei_params->au4_vcl_initial_alt_cpb_removal_delay[i] =
 2599|      0|                                value;
 2600|       |
 2601|      0|                BITS_PARSE("vcl_initial_alt_cpb_removal_delay_offset",
  ------------------
  |  |  148|      0|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2602|      0|                           value,
 2603|      0|                           ps_bitstrm,
 2604|      0|                           (ps_vui_hdr->u1_initial_cpb_removal_delay_length_minus1
 2605|      0|                                           + 1));
 2606|      0|                ps_buf_period_sei_params->au4_vcl_initial_alt_cpb_removal_delay_offset[i] =
 2607|      0|                                value;
 2608|      0|            }
 2609|      0|        }
 2610|      0|    }
 2611|       |
 2612|    107|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2613|    114|}
ihevcd_parse_pic_timing_sei:
 2616|    312|{
 2617|    312|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
 2618|    312|    bitstrm_t *ps_bitstrm = &ps_parse->s_bitstrm;
 2619|    312|    UWORD32 value;
 2620|    312|    vui_t *ps_vui;
 2621|    312|    UWORD32 i;
 2622|    312|    hrd_params_t *ps_vui_hdr;
 2623|    312|    UWORD32 u4_cpb_dpb_delays_present_flag = 0;
 2624|    312|    pic_timing_sei_params_t *ps_pic_timing;
 2625|       |
 2626|    312|    ps_pic_timing = &ps_parse->s_sei_params.s_pic_timing_sei_params;
 2627|    312|    ps_vui = &ps_sps->s_vui_parameters;
 2628|    312|    ps_vui_hdr = &ps_vui->s_vui_hrd_parameters;
 2629|    312|    ps_parse->s_sei_params.i1_pic_timing_params_present_flag = 1;
 2630|    312|    if(ps_vui->u1_frame_field_info_present_flag)
  ------------------
  |  Branch (2630:8): [True: 237, False: 75]
  ------------------
 2631|    237|    {
 2632|    237|        BITS_PARSE("pic_struct", value, ps_bitstrm, 4);
  ------------------
  |  |  148|    237|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2633|    237|        ps_pic_timing->u4_pic_struct = value;
 2634|       |
 2635|    237|        BITS_PARSE("source_scan_type", value, ps_bitstrm, 2);
  ------------------
  |  |  148|    237|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2636|    237|        ps_pic_timing->u4_source_scan_type = value;
 2637|       |
 2638|    237|        BITS_PARSE("duplicate_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|    237|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2639|    237|        ps_pic_timing->u1_duplicate_flag = value;
 2640|    237|    }
 2641|       |
 2642|    312|    if(ps_vui_hdr->u1_nal_hrd_parameters_present_flag
  ------------------
  |  Branch (2642:8): [True: 237, False: 75]
  ------------------
 2643|    312|                    || ps_vui_hdr->u1_vcl_hrd_parameters_present_flag)
  ------------------
  |  Branch (2643:24): [True: 0, False: 75]
  ------------------
 2644|    237|    {
 2645|    237|        u4_cpb_dpb_delays_present_flag = 1;
 2646|    237|    }
 2647|     75|    else
 2648|     75|    {
 2649|     75|        u4_cpb_dpb_delays_present_flag = 0;
 2650|     75|    }
 2651|       |
 2652|    312|    if(u4_cpb_dpb_delays_present_flag)
  ------------------
  |  Branch (2652:8): [True: 237, False: 75]
  ------------------
 2653|    237|    {
 2654|    237|        BITS_PARSE("au_cpb_removal_delay_minus1", value, ps_bitstrm,
  ------------------
  |  |  148|    237|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2655|    237|                   (ps_vui_hdr->u1_au_cpb_removal_delay_length_minus1 + 1));
 2656|    237|        ps_pic_timing->u4_au_cpb_removal_delay_minus1 = value;
 2657|       |
 2658|    237|        BITS_PARSE("pic_dpb_output_delay", value, ps_bitstrm,
  ------------------
  |  |  148|    237|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2659|    237|                   (ps_vui_hdr->u1_dpb_output_delay_length_minus1 + 1));
 2660|    237|        ps_pic_timing->u4_pic_dpb_output_delay = value;
 2661|       |
 2662|    237|        if(ps_vui_hdr->u1_sub_pic_cpb_params_present_flag)
  ------------------
  |  Branch (2662:12): [True: 237, False: 0]
  ------------------
 2663|    237|        {
 2664|    237|            BITS_PARSE("pic_dpb_output_du_delay", value, ps_bitstrm,
  ------------------
  |  |  148|    237|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2665|    237|                       (ps_vui_hdr->u1_dpb_output_delay_du_length_minus1 + 1));
 2666|    237|            ps_pic_timing->u4_pic_dpb_output_du_delay = value;
 2667|    237|        }
 2668|       |
 2669|    237|        if(ps_vui_hdr->u1_sub_pic_cpb_params_present_flag
  ------------------
  |  Branch (2669:12): [True: 237, False: 0]
  ------------------
 2670|    237|                        && ps_vui_hdr->u1_sub_pic_cpb_params_in_pic_timing_sei_flag)
  ------------------
  |  Branch (2670:28): [True: 237, False: 0]
  ------------------
 2671|    237|        {
 2672|    237|            UWORD32 num_units_minus1;
 2673|    237|            UWORD32 array_size;
 2674|       |
 2675|    237|            UEV_PARSE("num_decoding_units_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|    237|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2676|    237|            if(value > (ps_sps->i4_pic_size_in_ctb -1))
  ------------------
  |  Branch (2676:16): [True: 14, False: 223]
  ------------------
 2677|     14|            {
 2678|     14|                return IHEVCD_INVALID_PARAMETER;
 2679|     14|            }
 2680|    223|            ps_pic_timing->u4_num_decoding_units_minus1 = value;
 2681|       |
 2682|    223|            num_units_minus1 = ps_pic_timing->u4_num_decoding_units_minus1;
 2683|    223|            array_size = (sizeof(ps_pic_timing->au4_num_nalus_in_du_minus1)
 2684|    223|                       / sizeof(ps_pic_timing->au4_num_nalus_in_du_minus1[0]));
 2685|    223|            num_units_minus1 = CLIP3(num_units_minus1, 0,(array_size - 1));
  ------------------
  |  |   40|    223|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 223]
  |  |  |  Branch (40:53): [True: 0, False: 223]
  |  |  ------------------
  ------------------
 2686|    223|            ps_pic_timing->u4_num_decoding_units_minus1 = num_units_minus1;
 2687|       |
 2688|    223|            BITS_PARSE("du_common_cpb_removal_delay_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|    223|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2689|    223|            ps_pic_timing->u1_du_common_cpb_removal_delay_flag = value;
 2690|       |
 2691|    223|            if(ps_pic_timing->u1_du_common_cpb_removal_delay_flag)
  ------------------
  |  Branch (2691:16): [True: 74, False: 149]
  ------------------
 2692|     74|            {
 2693|     74|                BITS_PARSE("du_common_cpb_removal_delay_increment_minus1",
  ------------------
  |  |  148|     74|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2694|     74|                           value,
 2695|     74|                           ps_bitstrm,
 2696|     74|                           (ps_vui_hdr->u1_du_cpb_removal_delay_increment_length_minus1
 2697|     74|                                           + 1));
 2698|     74|                ps_pic_timing->u4_du_common_cpb_removal_delay_increment_minus1 =
 2699|     74|                                value;
 2700|     74|            }
 2701|       |
 2702|    451|            for(i = 0; i <= ps_pic_timing->u4_num_decoding_units_minus1; i++)
  ------------------
  |  Branch (2702:24): [True: 253, False: 198]
  ------------------
 2703|    253|            {
 2704|    253|                UEV_PARSE("num_nalus_in_du_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|    253|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
 2705|    253|                if(value > (ps_sps->i4_pic_size_in_ctb -1))
  ------------------
  |  Branch (2705:20): [True: 25, False: 228]
  ------------------
 2706|     25|                {
 2707|     25|                    return IHEVCD_INVALID_PARAMETER;
 2708|     25|                }
 2709|    228|                ps_pic_timing->au4_num_nalus_in_du_minus1[i] = value;
 2710|       |
 2711|    228|                if((!ps_pic_timing->u1_du_common_cpb_removal_delay_flag)
  ------------------
  |  Branch (2711:20): [True: 129, False: 99]
  ------------------
 2712|    228|                                && (i < ps_pic_timing->u4_num_decoding_units_minus1))
  ------------------
  |  Branch (2712:36): [True: 0, False: 129]
  ------------------
 2713|      0|                {
 2714|      0|                    BITS_PARSE("du_common_cpb_removal_delay_increment_minus1",
  ------------------
  |  |  148|      0|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2715|      0|                               value,
 2716|      0|                               ps_bitstrm,
 2717|      0|                               (ps_vui_hdr->u1_du_cpb_removal_delay_increment_length_minus1
 2718|      0|                                               + 1));
 2719|      0|                    ps_pic_timing->au4_du_cpb_removal_delay_increment_minus1[i] =
 2720|      0|                                    value;
 2721|      0|                }
 2722|    228|            }
 2723|    223|        }
 2724|    237|    }
 2725|       |
 2726|    273|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2727|    312|}
ihevcd_parse_time_code_sei:
 2730|  2.57k|{
 2731|  2.57k|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
 2732|  2.57k|    bitstrm_t *ps_bitstrm = &ps_parse->s_bitstrm;
 2733|  2.57k|    UWORD32 value;
 2734|  2.57k|    time_code_t *ps_time_code;
 2735|  2.57k|    WORD32 i;
 2736|       |
 2737|  2.57k|    ps_parse->s_sei_params.i1_time_code_present_flag = 1;
 2738|  2.57k|    ps_time_code = &ps_parse->s_sei_params.s_time_code;
 2739|       |
 2740|  2.57k|    BITS_PARSE("num_clock_ts", value, ps_bitstrm, 2);
  ------------------
  |  |  148|  2.57k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2741|  2.57k|    ps_time_code->u1_num_clock_ts = value;
 2742|       |
 2743|  9.66k|    for(i = 0; i < ps_time_code->u1_num_clock_ts; i++)
  ------------------
  |  Branch (2743:16): [True: 7.09k, False: 2.57k]
  ------------------
 2744|  7.09k|    {
 2745|  7.09k|        BITS_PARSE("clock_timestamp_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  7.09k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2746|  7.09k|        ps_time_code->au1_clock_timestamp_flag[i] = value;
 2747|       |
 2748|  7.09k|        if(ps_time_code->au1_clock_timestamp_flag[i])
  ------------------
  |  Branch (2748:12): [True: 3.73k, False: 3.36k]
  ------------------
 2749|  3.73k|        {
 2750|  3.73k|            BITS_PARSE("units_field_based_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  3.73k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2751|  3.73k|            ps_time_code->au1_units_field_based_flag[i] = value;
 2752|       |
 2753|  3.73k|            BITS_PARSE("counting_type[i]", value, ps_bitstrm, 5);
  ------------------
  |  |  148|  3.73k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2754|  3.73k|            ps_time_code->au1_counting_type[i] = value;
 2755|       |
 2756|  3.73k|            BITS_PARSE("full_timestamp_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  3.73k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2757|  3.73k|            ps_time_code->au1_full_timestamp_flag[i] = value;
 2758|       |
 2759|  3.73k|            BITS_PARSE("discontinuity_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  3.73k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2760|  3.73k|            ps_time_code->au1_discontinuity_flag[i] = value;
 2761|       |
 2762|  3.73k|            BITS_PARSE("cnt_dropped_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  3.73k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2763|  3.73k|            ps_time_code->au1_cnt_dropped_flag[i] = value;
 2764|       |
 2765|  3.73k|            BITS_PARSE("n_frames[i]", value, ps_bitstrm, 9);
  ------------------
  |  |  148|  3.73k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2766|  3.73k|            ps_time_code->au2_n_frames[i] = value;
 2767|       |
 2768|  3.73k|            if(ps_time_code->au1_full_timestamp_flag[i])
  ------------------
  |  Branch (2768:16): [True: 325, False: 3.40k]
  ------------------
 2769|    325|            {
 2770|    325|                BITS_PARSE("seconds_value[i]", value, ps_bitstrm, 6);
  ------------------
  |  |  148|    325|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2771|    325|                ps_time_code->au1_seconds_value[i] = value;
 2772|       |
 2773|    325|                BITS_PARSE("minutes_value[i]", value, ps_bitstrm, 6);
  ------------------
  |  |  148|    325|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2774|    325|                ps_time_code->au1_minutes_value[i] = value;
 2775|       |
 2776|    325|                BITS_PARSE("hours_value[i]", value, ps_bitstrm, 5);
  ------------------
  |  |  148|    325|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2777|    325|                ps_time_code->au1_hours_value[i] = value;
 2778|    325|            }
 2779|  3.40k|            else
 2780|  3.40k|            {
 2781|  3.40k|                BITS_PARSE("seconds_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  3.40k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2782|  3.40k|                ps_time_code->au1_seconds_flag[i] = value;
 2783|       |
 2784|  3.40k|                if(ps_time_code->au1_seconds_flag[i])
  ------------------
  |  Branch (2784:20): [True: 1.53k, False: 1.86k]
  ------------------
 2785|  1.53k|                {
 2786|  1.53k|                    BITS_PARSE("seconds_value[i]", value, ps_bitstrm, 6);
  ------------------
  |  |  148|  1.53k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2787|  1.53k|                    ps_time_code->au1_seconds_value[i] = value;
 2788|       |
 2789|  1.53k|                    BITS_PARSE("minutes_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  1.53k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2790|  1.53k|                    ps_time_code->au1_minutes_flag[i] = value;
 2791|       |
 2792|  1.53k|                    if(ps_time_code->au1_minutes_flag[i])
  ------------------
  |  Branch (2792:24): [True: 457, False: 1.08k]
  ------------------
 2793|    457|                    {
 2794|    457|                        BITS_PARSE("minutes_value[i]", value, ps_bitstrm, 6);
  ------------------
  |  |  148|    457|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2795|    457|                        ps_time_code->au1_minutes_value[i] = value;
 2796|       |
 2797|    457|                        BITS_PARSE("hours_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|    457|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2798|    457|                        ps_time_code->au1_hours_flag[i] = value;
 2799|       |
 2800|    457|                        if(ps_time_code->au1_hours_flag[i])
  ------------------
  |  Branch (2800:28): [True: 282, False: 175]
  ------------------
 2801|    282|                        {
 2802|    282|                            BITS_PARSE("hours_value[i]", value, ps_bitstrm, 5);
  ------------------
  |  |  148|    282|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2803|    282|                            ps_time_code->au1_hours_value[i] = value;
 2804|    282|                        }
 2805|    457|                    }
 2806|  1.53k|                }
 2807|  3.40k|            }
 2808|       |
 2809|  3.73k|            BITS_PARSE("time_offset_length[i]", value, ps_bitstrm, 5);
  ------------------
  |  |  148|  3.73k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2810|  3.73k|            ps_time_code->au1_time_offset_length[i] = value;
 2811|       |
 2812|  3.73k|            if(ps_time_code->au1_time_offset_length[i] > 0)
  ------------------
  |  Branch (2812:16): [True: 1.35k, False: 2.37k]
  ------------------
 2813|  1.35k|            {
 2814|  1.35k|                BITS_PARSE("time_offset_value[i]", value, ps_bitstrm,
  ------------------
  |  |  148|  1.35k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2815|  1.35k|                           ps_time_code->au1_time_offset_length[i]);
 2816|  1.35k|                ps_time_code->au1_time_offset_value[i] = value;
 2817|  1.35k|            }
 2818|  2.37k|            else
 2819|  2.37k|            {
 2820|  2.37k|                ps_time_code->au1_time_offset_value[i] = 0;
 2821|  2.37k|            }
 2822|  3.73k|        }
 2823|  7.09k|    }
 2824|       |
 2825|  2.57k|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2826|  2.57k|}
ihevcd_parse_user_data_registered_itu_t_t35:
 2866|     28|{
 2867|     28|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
 2868|     28|    bitstrm_t *ps_bitstrm = &ps_parse->s_bitstrm;
 2869|     28|    UWORD32 value;
 2870|     28|    user_data_registered_itu_t_t35_t *ps_user_data_registered_itu_t_t35;
 2871|     28|    UWORD32 i;
 2872|     28|    UWORD32 j = 0;
 2873|       |
 2874|     28|    ps_parse->s_sei_params.i1_user_data_registered_present_flag = 1;
 2875|     28|    ps_user_data_registered_itu_t_t35 =
 2876|     28|                    &ps_parse->s_sei_params.as_user_data_registered_itu_t_t35[ps_parse->s_sei_params.i4_sei_user_data_cnt];
 2877|     28|    ps_parse->s_sei_params.i4_sei_user_data_cnt++;
 2878|       |
 2879|     28|    ps_user_data_registered_itu_t_t35->i4_payload_size = u4_payload_size;
 2880|       |
 2881|     28|    if(u4_payload_size > MAX_USERDATA_PAYLOAD)
  ------------------
  |  |  521|     28|#define MAX_USERDATA_PAYLOAD 256
  ------------------
  |  Branch (2881:8): [True: 0, False: 28]
  ------------------
 2882|      0|    {
 2883|      0|        u4_payload_size = MAX_USERDATA_PAYLOAD;
  ------------------
  |  |  521|      0|#define MAX_USERDATA_PAYLOAD 256
  ------------------
 2884|      0|    }
 2885|       |
 2886|     28|    ps_user_data_registered_itu_t_t35->i4_valid_payload_size = u4_payload_size;
 2887|       |
 2888|     28|    BITS_PARSE("itu_t_t35_country_code", value, ps_bitstrm, 8);
  ------------------
  |  |  148|     28|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2889|     28|    ps_user_data_registered_itu_t_t35->u1_itu_t_t35_country_code = value;
 2890|       |
 2891|     28|    if(0xFF != ps_user_data_registered_itu_t_t35->u1_itu_t_t35_country_code)
  ------------------
  |  Branch (2891:8): [True: 28, False: 0]
  ------------------
 2892|     28|    {
 2893|     28|        i = 1;
 2894|     28|    }
 2895|      0|    else
 2896|      0|    {
 2897|      0|        BITS_PARSE("itu_t_t35_country_code_extension_byte", value, ps_bitstrm,
  ------------------
  |  |  148|      0|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2898|      0|                   8);
 2899|      0|        ps_user_data_registered_itu_t_t35->u1_itu_t_t35_country_code_extension_byte =
 2900|      0|                        value;
 2901|       |
 2902|      0|        i = 2;
 2903|      0|    }
 2904|       |
 2905|     28|    do
 2906|  2.60k|    {
 2907|  2.60k|        BITS_PARSE("itu_t_t35_payload_byte", value, ps_bitstrm, 8);
  ------------------
  |  |  148|  2.60k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 2908|  2.60k|        ps_user_data_registered_itu_t_t35->u1_itu_t_t35_payload_byte[j++] =
 2909|  2.60k|                        value;
 2910|       |
 2911|  2.60k|        i++;
 2912|  2.60k|    }while(i < u4_payload_size);
  ------------------
  |  Branch (2912:12): [True: 2.57k, False: 28]
  ------------------
 2913|       |
 2914|     28|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2915|     28|}
ihevcd_parse_sei_payload:
 2921|  32.3k|{
 2922|  32.3k|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
 2923|  32.3k|    bitstrm_t *ps_bitstrm = &ps_parse->s_bitstrm;
 2924|  32.3k|    WORD32 payload_bits_remaining = 0;
 2925|  32.3k|    sps_t *ps_sps;
 2926|       |
 2927|  32.3k|    UWORD32 i;
 2928|       |
 2929|   488k|    for(i = 0; i < MAX_SPS_CNT; i++)
  ------------------
  |  |  317|   488k|#define MAX_SPS_CNT         (16 + 1)
  ------------------
  |  Branch (2929:16): [True: 461k, False: 26.4k]
  ------------------
 2930|   461k|    {
 2931|   461k|        ps_sps = ps_codec->ps_sps_base + i;
 2932|   461k|        if(ps_sps->i1_sps_valid)
  ------------------
  |  Branch (2932:12): [True: 5.82k, False: 455k]
  ------------------
 2933|  5.82k|        {
 2934|  5.82k|            break;
 2935|  5.82k|        }
 2936|   461k|    }
 2937|  32.3k|    if(!ps_sps->i1_sps_valid)
  ------------------
  |  Branch (2937:8): [True: 26.4k, False: 5.82k]
  ------------------
 2938|  26.4k|    {
 2939|  26.4k|        return;
 2940|  26.4k|    }
 2941|       |
 2942|  5.82k|    if(NAL_PREFIX_SEI == i1_nal_type)
  ------------------
  |  Branch (2942:8): [True: 5.55k, False: 266]
  ------------------
 2943|  5.55k|    {
 2944|  5.55k|        switch(u4_payload_type)
 2945|  5.55k|        {
 2946|    114|            case SEI_BUFFERING_PERIOD:
  ------------------
  |  Branch (2946:13): [True: 114, False: 5.44k]
  ------------------
 2947|    114|                ps_parse->s_sei_params.i1_sei_parameters_present_flag = 1;
 2948|    114|                ihevcd_parse_buffering_period_sei(ps_codec, ps_sps);
 2949|    114|                break;
 2950|       |
 2951|    312|            case SEI_PICTURE_TIMING:
  ------------------
  |  Branch (2951:13): [True: 312, False: 5.24k]
  ------------------
 2952|    312|                ps_parse->s_sei_params.i1_sei_parameters_present_flag = 1;
 2953|    312|                ihevcd_parse_pic_timing_sei(ps_codec, ps_sps);
 2954|    312|                break;
 2955|       |
 2956|  2.57k|            case SEI_TIME_CODE:
  ------------------
  |  Branch (2956:13): [True: 2.57k, False: 2.98k]
  ------------------
 2957|  2.57k|                ps_parse->s_sei_params.i1_sei_parameters_present_flag = 1;
 2958|  2.57k|                ihevcd_parse_time_code_sei(ps_codec);
 2959|  2.57k|                break;
 2960|       |
 2961|      0|            case SEI_MASTERING_DISPLAY_COLOUR_VOLUME:
  ------------------
  |  Branch (2961:13): [True: 0, False: 5.55k]
  ------------------
 2962|      0|                ps_parse->s_sei_params.i4_sei_mastering_disp_colour_vol_params_present_flags = 1;
 2963|      0|                ihevcd_parse_mastering_disp_params_sei(ps_codec);
 2964|      0|                break;
 2965|       |
 2966|    394|            case SEI_USER_DATA_REGISTERED_ITU_T_T35:
  ------------------
  |  Branch (2966:13): [True: 394, False: 5.16k]
  ------------------
 2967|    394|                ps_parse->s_sei_params.i1_sei_parameters_present_flag = 1;
 2968|    394|                if(ps_parse->s_sei_params.i4_sei_user_data_cnt >= USER_DATA_MAX)
  ------------------
  |  Branch (2968:20): [True: 382, False: 12]
  ------------------
 2969|    382|                {
 2970|  1.03k|                    for(i = 0; i < u4_payload_size / 4; i++)
  ------------------
  |  Branch (2970:32): [True: 650, False: 382]
  ------------------
 2971|    650|                    {
 2972|    650|                        ihevcd_bits_flush(ps_bitstrm, 4 * 8);
 2973|    650|                    }
 2974|       |
 2975|    382|                    ihevcd_bits_flush(ps_bitstrm, (u4_payload_size - i * 4) * 8);
 2976|    382|                }
 2977|     12|                else
 2978|     12|                {
 2979|     12|                    ihevcd_parse_user_data_registered_itu_t_t35(ps_codec,
 2980|     12|                                                                u4_payload_size);
 2981|     12|                }
 2982|    394|                break;
 2983|       |
 2984|  2.16k|            default:
  ------------------
  |  Branch (2984:13): [True: 2.16k, False: 3.39k]
  ------------------
 2985|  4.86k|                for(i = 0; i < u4_payload_size; i++)
  ------------------
  |  Branch (2985:28): [True: 2.70k, False: 2.16k]
  ------------------
 2986|  2.70k|                {
 2987|  2.70k|                    ihevcd_bits_flush(ps_bitstrm, 8);
 2988|  2.70k|                }
 2989|  2.16k|                break;
 2990|  5.55k|        }
 2991|  5.55k|    }
 2992|    266|    else /* NAL_SUFFIX_SEI */
 2993|    266|    {
 2994|    266|        switch(u4_payload_type)
 2995|    266|        {
 2996|     16|            case SEI_USER_DATA_REGISTERED_ITU_T_T35:
  ------------------
  |  Branch (2996:13): [True: 16, False: 250]
  ------------------
 2997|     16|                ps_parse->s_sei_params.i1_sei_parameters_present_flag = 1;
 2998|     16|                if(ps_parse->s_sei_params.i4_sei_user_data_cnt >= USER_DATA_MAX)
  ------------------
  |  Branch (2998:20): [True: 0, False: 16]
  ------------------
 2999|      0|                {
 3000|      0|                    for(i = 0; i < u4_payload_size / 4; i++)
  ------------------
  |  Branch (3000:32): [True: 0, False: 0]
  ------------------
 3001|      0|                    {
 3002|      0|                        ihevcd_bits_flush(ps_bitstrm, 4 * 8);
 3003|      0|                    }
 3004|       |
 3005|      0|                    ihevcd_bits_flush(ps_bitstrm, (u4_payload_size - i * 4) * 8);
 3006|      0|                }
 3007|     16|                else
 3008|     16|                {
 3009|     16|                    ihevcd_parse_user_data_registered_itu_t_t35(ps_codec,
 3010|     16|                                                                u4_payload_size);
 3011|     16|                }
 3012|     16|                break;
 3013|       |
 3014|    250|            default:
  ------------------
  |  Branch (3014:13): [True: 250, False: 16]
  ------------------
 3015|  27.0k|                for(i = 0; i < u4_payload_size; i++)
  ------------------
  |  Branch (3015:28): [True: 26.8k, False: 250]
  ------------------
 3016|  26.8k|                {
 3017|  26.8k|                    ihevcd_bits_flush(ps_bitstrm, 8);
 3018|  26.8k|                }
 3019|    250|                break;
 3020|    266|        }
 3021|    266|    }
 3022|       |
 3023|       |    /**
 3024|       |     * By definition the underlying bitstream terminates in a byte-aligned manner.
 3025|       |     * 1. Extract all bar the last MIN(bitsremaining,nine) bits as reserved_payload_extension_data
 3026|       |     * 2. Examine the final 8 bits to determine the payload_bit_equal_to_one marker
 3027|       |     * 3. Extract the remainingreserved_payload_extension_data bits.
 3028|       |     *
 3029|       |     * If there are fewer than 9 bits available, extract them.
 3030|       |     */
 3031|       |
 3032|  5.82k|    payload_bits_remaining = ihevcd_bits_num_bits_remaining(ps_bitstrm);
 3033|  5.82k|    if(payload_bits_remaining) /* more_data_in_payload() */
  ------------------
  |  Branch (3033:8): [True: 2.79k, False: 3.03k]
  ------------------
 3034|  2.79k|    {
 3035|  2.79k|        WORD32 final_bits;
 3036|  2.79k|        WORD32 final_payload_bits = 0;
 3037|  2.79k|        WORD32 mask = 0xFF;
 3038|  2.79k|        UWORD32 u4_dummy;
 3039|  2.79k|        UWORD32 u4_reserved_payload_extension_data;
 3040|  2.79k|        UNUSED(u4_dummy);
  ------------------
  |  |   38|  2.79k|#define UNUSED(x) ((void)(x))
  ------------------
 3041|  2.79k|        UNUSED(u4_reserved_payload_extension_data);
  ------------------
  |  |   38|  2.79k|#define UNUSED(x) ((void)(x))
  ------------------
 3042|       |
 3043|  22.9M|        while(payload_bits_remaining > 9)
  ------------------
  |  Branch (3043:15): [True: 22.9M, False: 2.79k]
  ------------------
 3044|  22.9M|        {
 3045|  22.9M|            BITS_PARSE("reserved_payload_extension_data",
  ------------------
  |  |  148|  22.9M|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3046|  22.9M|                       u4_reserved_payload_extension_data, ps_bitstrm, 1);
 3047|  22.9M|            payload_bits_remaining--;
 3048|  22.9M|        }
 3049|       |
 3050|  2.79k|        final_bits = ihevcd_bits_nxt(ps_bitstrm, payload_bits_remaining);
 3051|       |
 3052|  23.6k|        while(final_bits & (mask >> final_payload_bits))
  ------------------
  |  Branch (3052:15): [True: 20.8k, False: 2.79k]
  ------------------
 3053|  20.8k|        {
 3054|  20.8k|            final_payload_bits++;
 3055|  20.8k|            continue;
 3056|  20.8k|        }
 3057|       |
 3058|  23.5k|        while(payload_bits_remaining > (9 - final_payload_bits))
  ------------------
  |  Branch (3058:15): [True: 20.7k, False: 2.79k]
  ------------------
 3059|  20.7k|        {
 3060|  20.7k|            BITS_PARSE("reserved_payload_extension_data",
  ------------------
  |  |  148|  20.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3061|  20.7k|                       u4_reserved_payload_extension_data, ps_bitstrm, 1);
 3062|  20.7k|            payload_bits_remaining--;
 3063|  20.7k|        }
 3064|       |
 3065|  2.79k|        BITS_PARSE("payload_bit_equal_to_one", u4_dummy, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.79k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3066|  2.79k|        payload_bits_remaining--;
 3067|  4.23k|        while(payload_bits_remaining)
  ------------------
  |  Branch (3067:15): [True: 1.43k, False: 2.79k]
  ------------------
 3068|  1.43k|        {
 3069|  1.43k|            BITS_PARSE("payload_bit_equal_to_zero", u4_dummy, ps_bitstrm, 1);
  ------------------
  |  |  148|  1.43k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3070|  1.43k|            payload_bits_remaining--;
 3071|  1.43k|        }
 3072|  2.79k|    }
 3073|       |
 3074|  5.82k|    return;
 3075|  5.82k|}
ihevcd_read_rbsp_trailing_bits:
 3079|     41|{
 3080|     41|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
 3081|     41|    UWORD32 value;
 3082|     41|    WORD32 cnt = 0;
 3083|     41|    BITS_PARSE("rbsp_stop_one_bit", value, &ps_parse->s_bitstrm, 1);
  ------------------
  |  |  148|     41|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3084|     41|    u4_bits_left--;
 3085|     41|    if(value != 1)
  ------------------
  |  Branch (3085:8): [True: 17, False: 24]
  ------------------
 3086|     17|    {
 3087|     17|        return (IHEVCD_ERROR_T)IHEVCD_FAIL;
 3088|     17|    }
 3089|    192|    while(u4_bits_left)
  ------------------
  |  Branch (3089:11): [True: 168, False: 24]
  ------------------
 3090|    168|    {
 3091|    168|        BITS_PARSE("rbsp_alignment_zero_bit", value, &ps_parse->s_bitstrm, 1);
  ------------------
  |  |  148|    168|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3092|    168|        u4_bits_left--;
 3093|    168|        cnt++;
 3094|    168|    }
 3095|     24|    ASSERT(cnt < 8);
  ------------------
  |  |   55|     24|#define ASSERT(x) assert((x))
  ------------------
 3096|       |
 3097|     24|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 3098|     24|}
ihevcd_parse_sei:
 3119|  6.30k|{
 3120|  6.30k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 3121|  6.30k|    parse_ctxt_t *ps_parse = &ps_codec->s_parse;
 3122|  6.30k|    UWORD32 u4_payload_type = 0, u4_last_payload_type_byte = 0;
 3123|  6.30k|    UWORD32 u4_payload_size = 0, u4_last_payload_size_byte = 0;
 3124|  6.30k|    UWORD32 value;
 3125|  6.30k|    bitstrm_t *ps_bitstrm = &ps_parse->s_bitstrm;
 3126|  6.30k|    UWORD32 u4_bits_left;
 3127|       |
 3128|  6.30k|    u4_bits_left = ihevcd_bits_num_bits_remaining(ps_bitstrm);
 3129|       |
 3130|  38.6k|    while(u4_bits_left > 8)
  ------------------
  |  Branch (3130:11): [True: 32.3k, False: 6.30k]
  ------------------
 3131|  32.3k|    {
 3132|   123k|        while(ihevcd_bits_nxt(ps_bitstrm, 8) == 0xFF)
  ------------------
  |  Branch (3132:15): [True: 91.4k, False: 32.3k]
  ------------------
 3133|  91.4k|        {
 3134|  91.4k|            ihevcd_bits_flush(ps_bitstrm, 8); /* equal to 0xFF */
 3135|  91.4k|            u4_payload_type += 255;
 3136|  91.4k|        }
 3137|       |
 3138|  32.3k|        BITS_PARSE("last_payload_type_byte", value, ps_bitstrm, 8);
  ------------------
  |  |  148|  32.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3139|  32.3k|        u4_last_payload_type_byte = value;
 3140|       |
 3141|  32.3k|        u4_payload_type += u4_last_payload_type_byte;
 3142|       |
 3143|   355k|        while(ihevcd_bits_nxt(ps_bitstrm, 8) == 0xFF)
  ------------------
  |  Branch (3143:15): [True: 322k, False: 32.3k]
  ------------------
 3144|   322k|        {
 3145|   322k|            ihevcd_bits_flush(ps_bitstrm, 8); /* equal to 0xFF */
 3146|   322k|            u4_payload_size += 255;
 3147|   322k|        }
 3148|       |
 3149|  32.3k|        BITS_PARSE("last_payload_size_byte", value, ps_bitstrm, 8);
  ------------------
  |  |  148|  32.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 3150|  32.3k|        u4_last_payload_size_byte = value;
 3151|       |
 3152|  32.3k|        u4_payload_size += u4_last_payload_size_byte;
 3153|  32.3k|        u4_bits_left = ihevcd_bits_num_bits_remaining(ps_bitstrm);
 3154|  32.3k|        u4_payload_size = MIN(u4_payload_size, u4_bits_left / 8);
  ------------------
  |  |   43|  32.3k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 26.8k, False: 5.42k]
  |  |  ------------------
  ------------------
 3155|  32.3k|        ihevcd_parse_sei_payload(ps_codec, u4_payload_type, u4_payload_size,
 3156|  32.3k|                                 ps_nal->i1_nal_unit_type);
 3157|       |
 3158|       |        /* Calculate the bits left in the current payload */
 3159|  32.3k|        u4_bits_left = ihevcd_bits_num_bits_remaining(ps_bitstrm);
 3160|  32.3k|    }
 3161|       |
 3162|       |    // read rbsp_trailing_bits
 3163|  6.30k|    if(u4_bits_left)
  ------------------
  |  Branch (3163:8): [True: 41, False: 6.26k]
  ------------------
 3164|     41|    {
 3165|     41|        ihevcd_read_rbsp_trailing_bits(ps_codec, u4_bits_left);
 3166|     41|    }
 3167|       |
 3168|  6.30k|    return ret;
 3169|  6.30k|}
ihevcd_calc_poc:
 3231|  19.2k|{
 3232|  19.2k|    WORD32 i4_abs_poc, i4_poc_msb;
 3233|  19.2k|    WORD32 max_poc_lsb;
 3234|  19.2k|    WORD8 i1_nal_unit_type = ps_nal->i1_nal_unit_type;
 3235|  19.2k|    max_poc_lsb = (1 << i1_log2_max_poc_lsb);
 3236|       |
 3237|  19.2k|    if((!ps_codec->i4_first_pic_done) && (!ps_codec->i4_pic_present))
  ------------------
  |  Branch (3237:8): [True: 2.41k, False: 16.8k]
  |  Branch (3237:42): [True: 2.41k, False: 0]
  ------------------
 3238|  2.41k|        ps_codec->i4_prev_poc_msb = -2 * max_poc_lsb;
 3239|       |
 3240|  19.2k|    if(NAL_IDR_N_LP == i1_nal_unit_type
  ------------------
  |  Branch (3240:8): [True: 5.57k, False: 13.6k]
  ------------------
 3241|  19.2k|                    || NAL_IDR_W_LP == i1_nal_unit_type
  ------------------
  |  Branch (3241:24): [True: 3.88k, False: 9.78k]
  ------------------
 3242|  19.2k|                    || NAL_BLA_N_LP == i1_nal_unit_type
  ------------------
  |  Branch (3242:24): [True: 184, False: 9.60k]
  ------------------
 3243|  19.2k|                    || NAL_BLA_W_DLP == i1_nal_unit_type
  ------------------
  |  Branch (3243:24): [True: 748, False: 8.85k]
  ------------------
 3244|  19.2k|                    || NAL_BLA_W_LP == i1_nal_unit_type
  ------------------
  |  Branch (3244:24): [True: 43, False: 8.81k]
  ------------------
 3245|  19.2k|                    || (NAL_CRA == i1_nal_unit_type && !ps_codec->i4_first_pic_done))
  ------------------
  |  Branch (3245:25): [True: 457, False: 8.35k]
  |  Branch (3245:56): [True: 285, False: 172]
  ------------------
 3246|  10.7k|    {
 3247|  10.7k|        i4_poc_msb = ps_codec->i4_prev_poc_msb + 2 * max_poc_lsb;
 3248|  10.7k|        ps_codec->i4_prev_poc_lsb = 0;
 3249|  10.7k|        ps_codec->i4_max_prev_poc_lsb = 0;
 3250|       |//        ps_codec->i4_prev_poc_msb = 0;
 3251|  10.7k|    }
 3252|  8.52k|    else
 3253|  8.52k|    {
 3254|       |
 3255|  8.52k|        if((i2_poc_lsb < ps_codec->i4_prev_poc_lsb)
  ------------------
  |  Branch (3255:12): [True: 277, False: 8.24k]
  ------------------
 3256|  8.52k|                        && ((ps_codec->i4_prev_poc_lsb - i2_poc_lsb) >= max_poc_lsb / 2))
  ------------------
  |  Branch (3256:28): [True: 0, False: 277]
  ------------------
 3257|      0|        {
 3258|      0|            i4_poc_msb = ps_codec->i4_prev_poc_msb + max_poc_lsb;
 3259|      0|        }
 3260|  8.52k|        else if((i2_poc_lsb > ps_codec->i4_prev_poc_lsb)
  ------------------
  |  Branch (3260:17): [True: 8.23k, False: 291]
  ------------------
 3261|  8.52k|                        && ((i2_poc_lsb - ps_codec->i4_prev_poc_lsb) > max_poc_lsb / 2))
  ------------------
  |  Branch (3261:28): [True: 2.54k, False: 5.68k]
  ------------------
 3262|  2.54k|        {
 3263|  2.54k|            i4_poc_msb = ps_codec->i4_prev_poc_msb - max_poc_lsb;
 3264|  2.54k|        }
 3265|  5.97k|        else
 3266|  5.97k|        {
 3267|  5.97k|            i4_poc_msb = ps_codec->i4_prev_poc_msb;
 3268|  5.97k|        }
 3269|       |
 3270|       |
 3271|  8.52k|    }
 3272|       |
 3273|  19.2k|    i4_abs_poc = i4_poc_msb + i2_poc_lsb;
 3274|  19.2k|    ps_codec->i4_max_prev_poc_lsb = MAX(ps_codec->i4_max_prev_poc_lsb, i2_poc_lsb);
  ------------------
  |  |   42|  19.2k|#define MAX(x,y)    (((x) > (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 1.93k, False: 17.3k]
  |  |  ------------------
  ------------------
 3275|       |
 3276|  19.2k|    {
 3277|  19.2k|        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 (3277:36): [True: 8.35k, False: 10.8k]
  |  Branch (3277:77): [True: 4.45k, False: 3.90k]
  |  Branch (3277:110): [True: 10.8k, False: 3.90k]
  |  Branch (3277:148): [True: 10.8k, False: 0]
  ------------------
 3278|  19.2k|        WORD32 update_prev_poc = ((is_reference_nal) && ((i1_nal_unit_type < NAL_RADL_N) || (i1_nal_unit_type > NAL_RASL_R)));
  ------------------
  |  Branch (3278:35): [True: 15.3k, False: 3.90k]
  |  Branch (3278:58): [True: 4.32k, False: 11.0k]
  |  Branch (3278:93): [True: 10.8k, False: 132]
  ------------------
 3279|       |
 3280|  19.2k|        if((0 == ps_nal->i1_nuh_temporal_id) &&
  ------------------
  |  Branch (3280:12): [True: 6.39k, False: 12.8k]
  ------------------
 3281|  19.2k|                        (update_prev_poc))
  ------------------
  |  Branch (3281:25): [True: 6.17k, False: 216]
  ------------------
 3282|  6.17k|        {
 3283|  6.17k|            ps_codec->i4_prev_poc_lsb = i2_poc_lsb;
 3284|  6.17k|            ps_codec->i4_prev_poc_msb = i4_poc_msb;
 3285|  6.17k|        }
 3286|  19.2k|    }
 3287|       |
 3288|  19.2k|    return i4_abs_poc;
 3289|  19.2k|}
ihevcd_copy_slice_hdr:
 3293|  2.68k|{
 3294|  2.68k|    slice_header_t *ps_slice_hdr, *ps_slice_hdr_ref;
 3295|  2.68k|    WORD32 *pu4_entry_offset_backup;
 3296|       |
 3297|  2.68k|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr_base + slice_idx;
 3298|  2.68k|    ps_slice_hdr_ref = ps_codec->s_parse.ps_slice_hdr_base + slice_idx_ref;
 3299|       |
 3300|  2.68k|    pu4_entry_offset_backup = ps_slice_hdr->pu4_entry_point_offset;
 3301|  2.68k|    memcpy(ps_slice_hdr, ps_slice_hdr_ref, sizeof(slice_header_t));
 3302|  2.68k|    ps_slice_hdr->pu4_entry_point_offset = pu4_entry_offset_backup;
 3303|  2.68k|}
ihevcd_parse_headers.c:ihevcd_profile_tier_level:
 1095|  19.1k|{
 1096|  19.1k|    WORD32 value;
 1097|  19.1k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1098|  19.1k|    WORD32 i;
 1099|       |
 1100|  19.1k|    if(profile_present)
  ------------------
  |  Branch (1100:8): [True: 19.1k, False: 0]
  ------------------
 1101|  19.1k|    {
 1102|  19.1k|        ret = ihevcd_parse_profile_tier_level_layer(ps_bitstrm, &ps_ptl->s_ptl_gen);
 1103|  19.1k|        if((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1103:12): [True: 0, False: 19.1k]
  ------------------
 1104|      0|        {
 1105|      0|            return ret;
 1106|      0|        }
 1107|  19.1k|    }
 1108|       |
 1109|  19.1k|    BITS_PARSE("general_level_idc", value, ps_bitstrm, 8);
  ------------------
  |  |  148|  19.1k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1110|  19.1k|    ps_ptl->s_ptl_gen.u1_level_idc = value;
 1111|       |
 1112|       |
 1113|  28.9k|    for(i = 0; i < max_num_sub_layers; i++)
  ------------------
  |  Branch (1113:16): [True: 9.81k, False: 19.1k]
  ------------------
 1114|  9.81k|    {
 1115|  9.81k|        BITS_PARSE("sub_layer_profile_present_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  9.81k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1116|  9.81k|        ps_ptl->ai1_sub_layer_profile_present_flag[i] = value;
 1117|       |
 1118|  9.81k|        BITS_PARSE("sub_layer_level_present_flag[i]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  9.81k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1119|  9.81k|        ps_ptl->ai1_sub_layer_level_present_flag[i] = value;
 1120|  9.81k|    }
 1121|       |
 1122|  19.1k|    if(max_num_sub_layers > 0)
  ------------------
  |  Branch (1122:8): [True: 2.51k, False: 16.5k]
  ------------------
 1123|  2.51k|    {
 1124|  12.8k|        for(i = max_num_sub_layers; i < 8; i++)
  ------------------
  |  Branch (1124:37): [True: 10.3k, False: 2.51k]
  ------------------
 1125|  10.3k|        {
 1126|  10.3k|            BITS_PARSE("reserved_zero_2bits", value, ps_bitstrm, 2);
  ------------------
  |  |  148|  10.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1127|  10.3k|        }
 1128|  2.51k|    }
 1129|       |
 1130|  28.9k|    for(i = 0; i < max_num_sub_layers; i++)
  ------------------
  |  Branch (1130:16): [True: 9.81k, False: 19.1k]
  ------------------
 1131|  9.81k|    {
 1132|  9.81k|        if(ps_ptl->ai1_sub_layer_profile_present_flag[i])
  ------------------
  |  Branch (1132:12): [True: 256, False: 9.55k]
  ------------------
 1133|    256|        {
 1134|    256|            ret = ihevcd_parse_profile_tier_level_layer(ps_bitstrm,
 1135|    256|                                                        &ps_ptl->as_ptl_sub[i]);
 1136|    256|        }
 1137|  9.81k|        if(ps_ptl->ai1_sub_layer_level_present_flag[i])
  ------------------
  |  Branch (1137:12): [True: 308, False: 9.50k]
  ------------------
 1138|    308|        {
 1139|    308|            BITS_PARSE("sub_layer_level_idc[i]", value, ps_bitstrm, 8);
  ------------------
  |  |  148|    308|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1140|    308|            ps_ptl->as_ptl_sub[i].u1_level_idc = value;
 1141|       |
 1142|    308|        }
 1143|  9.81k|    }
 1144|       |
 1145|       |
 1146|       |
 1147|  19.1k|    return ret;
 1148|  19.1k|}
ihevcd_parse_headers.c:ihevcd_parse_profile_tier_level_layer:
 1020|  19.3k|{
 1021|  19.3k|    WORD32 value;
 1022|  19.3k|    WORD32 i;
 1023|  19.3k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1024|       |
 1025|  19.3k|    BITS_PARSE("XXX_profile_space[]", value, ps_bitstrm, 2);
  ------------------
  |  |  148|  19.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1026|  19.3k|    ps_ptl->i1_profile_space = value;
 1027|       |
 1028|  19.3k|    BITS_PARSE("XXX_tier_flag[]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  19.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1029|  19.3k|    ps_ptl->i1_tier_flag = value;
 1030|       |
 1031|  19.3k|    BITS_PARSE("XXX_profile_idc[]", value, ps_bitstrm, 5);
  ------------------
  |  |  148|  19.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1032|  19.3k|    ps_ptl->i1_profile_idc = value;
 1033|       |
 1034|   638k|    for(i = 0; i < MAX_PROFILE_COMPATBLTY; i++)
  ------------------
  |  |  275|   638k|#define MAX_PROFILE_COMPATBLTY 32
  ------------------
  |  Branch (1034:16): [True: 619k, False: 19.3k]
  ------------------
 1035|   619k|    {
 1036|   619k|        BITS_PARSE("XXX_profile_compatibility_flag[][j]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|   619k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1037|   619k|        ps_ptl->ai1_profile_compatibility_flag[i] = value;
 1038|   619k|    }
 1039|       |
 1040|  19.3k|    BITS_PARSE("general_progressive_source_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  19.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1041|  19.3k|    ps_ptl->i1_general_progressive_source_flag = value;
 1042|       |
 1043|  19.3k|    BITS_PARSE("general_interlaced_source_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  19.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1044|  19.3k|    ps_ptl->i1_general_interlaced_source_flag = value;
 1045|       |
 1046|  19.3k|    BITS_PARSE("general_non_packed_constraint_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  19.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1047|  19.3k|    ps_ptl->i1_general_non_packed_constraint_flag = value;
 1048|       |
 1049|  19.3k|    BITS_PARSE("general_frame_only_constraint_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  19.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1050|  19.3k|    ps_ptl->i1_frame_only_constraint_flag = value;
 1051|       |
 1052|  19.3k|    BITS_PARSE("XXX_reserved_zero_44bits[0..15]", value, ps_bitstrm, 16);
  ------------------
  |  |  148|  19.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1053|       |
 1054|  19.3k|    BITS_PARSE("XXX_reserved_zero_44bits[16..31]", value, ps_bitstrm, 16);
  ------------------
  |  |  148|  19.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1055|       |
 1056|  19.3k|    BITS_PARSE("XXX_reserved_zero_44bits[32..43]", value, ps_bitstrm, 12);
  ------------------
  |  |  148|  19.3k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
 1057|  19.3k|    return ret;
 1058|  19.3k|}
ihevcd_parse_headers.c:ihevcd_parse_vui_parameters:
  772|    733|{
  773|    733|    WORD32 ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  774|    733|    UWORD16 u2_sar_width = 0;
  775|    733|    UWORD16 u2_sar_height = 0;
  776|       |
  777|    733|    BITS_PARSE("aspect_ratio_info_present_flag", ps_vui->u1_aspect_ratio_info_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|    733|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  778|       |
  779|    733|    ps_vui->u1_aspect_ratio_idc = SAR_UNUSED;
  780|    733|    u2_sar_width = 0;
  781|    733|    u2_sar_height = 0;
  782|    733|    if(ps_vui->u1_aspect_ratio_info_present_flag)
  ------------------
  |  Branch (782:8): [True: 189, False: 544]
  ------------------
  783|    189|    {
  784|    189|        BITS_PARSE("aspect_ratio_idc", ps_vui->u1_aspect_ratio_idc, ps_bitstrm, 8);
  ------------------
  |  |  148|    189|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  785|    189|        switch(ps_vui->u1_aspect_ratio_idc)
  786|    189|        {
  787|      0|            case SAR_1_1:
  ------------------
  |  Branch (787:13): [True: 0, False: 189]
  ------------------
  788|      0|                u2_sar_width = 1;
  789|      0|                u2_sar_height = 1;
  790|      0|                break;
  791|      0|            case SAR_12_11:
  ------------------
  |  Branch (791:13): [True: 0, False: 189]
  ------------------
  792|      0|                u2_sar_width = 12;
  793|      0|                u2_sar_height = 11;
  794|      0|                break;
  795|      0|            case SAR_10_11:
  ------------------
  |  Branch (795:13): [True: 0, False: 189]
  ------------------
  796|      0|                u2_sar_width = 10;
  797|      0|                u2_sar_height = 11;
  798|      0|                break;
  799|      0|            case SAR_16_11:
  ------------------
  |  Branch (799:13): [True: 0, False: 189]
  ------------------
  800|      0|                u2_sar_width = 16;
  801|      0|                u2_sar_height = 11;
  802|      0|                break;
  803|      0|            case SAR_40_33:
  ------------------
  |  Branch (803:13): [True: 0, False: 189]
  ------------------
  804|      0|                u2_sar_width = 40;
  805|      0|                u2_sar_height = 33;
  806|      0|                break;
  807|      0|            case SAR_24_11:
  ------------------
  |  Branch (807:13): [True: 0, False: 189]
  ------------------
  808|      0|                u2_sar_width = 24;
  809|      0|                u2_sar_height = 11;
  810|      0|                break;
  811|      0|            case SAR_20_11:
  ------------------
  |  Branch (811:13): [True: 0, False: 189]
  ------------------
  812|      0|                u2_sar_width = 20;
  813|      0|                u2_sar_height = 11;
  814|      0|                break;
  815|      0|            case SAR_32_11:
  ------------------
  |  Branch (815:13): [True: 0, False: 189]
  ------------------
  816|      0|                u2_sar_width = 32;
  817|      0|                u2_sar_height = 11;
  818|      0|                break;
  819|      0|            case SAR_80_33:
  ------------------
  |  Branch (819:13): [True: 0, False: 189]
  ------------------
  820|      0|                u2_sar_width = 80;
  821|      0|                u2_sar_height = 33;
  822|      0|                break;
  823|      0|            case SAR_18_11:
  ------------------
  |  Branch (823:13): [True: 0, False: 189]
  ------------------
  824|      0|                u2_sar_width = 18;
  825|      0|                u2_sar_height = 11;
  826|      0|                break;
  827|      0|            case SAR_15_11:
  ------------------
  |  Branch (827:13): [True: 0, False: 189]
  ------------------
  828|      0|                u2_sar_width = 15;
  829|      0|                u2_sar_height = 11;
  830|      0|                break;
  831|      0|            case SAR_64_33:
  ------------------
  |  Branch (831:13): [True: 0, False: 189]
  ------------------
  832|      0|                u2_sar_width = 64;
  833|      0|                u2_sar_height = 33;
  834|      0|                break;
  835|      3|            case SAR_160_99:
  ------------------
  |  Branch (835:13): [True: 3, False: 186]
  ------------------
  836|      3|                u2_sar_width = 160;
  837|      3|                u2_sar_height = 99;
  838|      3|                break;
  839|      0|            case SAR_4_3:
  ------------------
  |  Branch (839:13): [True: 0, False: 189]
  ------------------
  840|      0|                u2_sar_width = 4;
  841|      0|                u2_sar_height = 3;
  842|      0|                break;
  843|      0|            case SAR_3_2:
  ------------------
  |  Branch (843:13): [True: 0, False: 189]
  ------------------
  844|      0|                u2_sar_width = 3;
  845|      0|                u2_sar_height = 2;
  846|      0|                break;
  847|      6|            case SAR_2_1:
  ------------------
  |  Branch (847:13): [True: 6, False: 183]
  ------------------
  848|      6|                u2_sar_width = 2;
  849|      6|                u2_sar_height = 1;
  850|      6|                break;
  851|     10|            case EXTENDED_SAR:
  ------------------
  |  Branch (851:13): [True: 10, False: 179]
  ------------------
  852|     10|                BITS_PARSE("sar_width", u2_sar_width, ps_bitstrm, 16);
  ------------------
  |  |  148|     10|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  853|     10|                BITS_PARSE("sar_height", u2_sar_height, ps_bitstrm, 16);
  ------------------
  |  |  148|     10|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  854|     10|                break;
  855|    170|            default:
  ------------------
  |  Branch (855:13): [True: 170, False: 19]
  ------------------
  856|    170|                u2_sar_width = 0;
  857|    170|                u2_sar_height = 0;
  858|    170|                break;
  859|    189|        }
  860|    189|    }
  861|       |
  862|    733|    ps_vui->u2_sar_width    = u2_sar_width;
  863|    733|    ps_vui->u2_sar_height   = u2_sar_height;
  864|       |
  865|    733|    BITS_PARSE("overscan_info_present_flag", ps_vui->u1_overscan_info_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|    733|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  866|    733|    ps_vui->u1_overscan_appropriate_flag = 0;
  867|    733|    if(ps_vui->u1_overscan_info_present_flag)
  ------------------
  |  Branch (867:8): [True: 129, False: 604]
  ------------------
  868|    129|        BITS_PARSE("overscan_appropriate_flag", ps_vui->u1_overscan_appropriate_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|    129|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  869|       |
  870|    733|    BITS_PARSE("video_signal_type_present_flag", ps_vui->u1_video_signal_type_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|    733|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  871|    733|    ps_vui->u1_video_format = VID_FMT_UNSPECIFIED;
  872|    733|    ps_vui->u1_video_full_range_flag = 0;
  873|    733|    ps_vui->u1_colour_description_present_flag = 0;
  874|    733|    ps_vui->u1_colour_primaries = 2;
  875|    733|    ps_vui->u1_transfer_characteristics = 2;
  876|    733|    ps_vui->u1_matrix_coefficients = 2;
  877|       |
  878|    733|    if(ps_vui->u1_video_signal_type_present_flag)
  ------------------
  |  Branch (878:8): [True: 32, False: 701]
  ------------------
  879|     32|    {
  880|     32|        BITS_PARSE("video_format", ps_vui->u1_video_format, ps_bitstrm, 3);
  ------------------
  |  |  148|     32|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  881|     32|        BITS_PARSE("video_full_range_flag", ps_vui->u1_video_full_range_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|     32|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  882|     32|        BITS_PARSE("colour_description_present_flag", ps_vui->u1_colour_description_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|     32|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  883|     32|        if(ps_vui->u1_colour_description_present_flag)
  ------------------
  |  Branch (883:12): [True: 21, False: 11]
  ------------------
  884|     21|        {
  885|     21|            BITS_PARSE("colour_primaries", ps_vui->u1_colour_primaries, ps_bitstrm, 8);
  ------------------
  |  |  148|     21|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  886|     21|            BITS_PARSE("transfer_characteristics", ps_vui->u1_transfer_characteristics, ps_bitstrm, 8);
  ------------------
  |  |  148|     21|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  887|     21|            BITS_PARSE("matrix_coeffs", ps_vui->u1_matrix_coefficients, ps_bitstrm, 8);
  ------------------
  |  |  148|     21|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  888|     21|        }
  889|     32|    }
  890|       |
  891|    733|    BITS_PARSE("chroma_loc_info_present_flag", ps_vui->u1_chroma_loc_info_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|    733|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  892|    733|    ps_vui->u1_chroma_sample_loc_type_top_field = 0;
  893|    733|    ps_vui->u1_chroma_sample_loc_type_bottom_field = 0;
  894|    733|    if(ps_vui->u1_chroma_loc_info_present_flag)
  ------------------
  |  Branch (894:8): [True: 49, False: 684]
  ------------------
  895|     49|    {
  896|     49|        UEV_PARSE("chroma_sample_loc_type_top_field", ps_vui->u1_chroma_sample_loc_type_top_field, ps_bitstrm);
  ------------------
  |  |  155|     49|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  897|     49|        if(ps_vui->u1_chroma_sample_loc_type_top_field > CHROMA_FMT_IDC_YUV444_PLANES + 1)
  ------------------
  |  Branch (897:12): [True: 0, False: 49]
  ------------------
  898|      0|        {
  899|      0|            return IHEVCD_INVALID_PARAMETER;
  900|      0|        }
  901|     49|        UEV_PARSE("chroma_sample_loc_type_bottom_field", ps_vui->u1_chroma_sample_loc_type_bottom_field, ps_bitstrm);
  ------------------
  |  |  155|     49|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  902|     49|        if(ps_vui->u1_chroma_sample_loc_type_bottom_field > CHROMA_FMT_IDC_YUV444_PLANES + 1)
  ------------------
  |  Branch (902:12): [True: 0, False: 49]
  ------------------
  903|      0|        {
  904|      0|            return IHEVCD_INVALID_PARAMETER;
  905|      0|        }
  906|     49|    }
  907|       |
  908|    733|    BITS_PARSE("neutral_chroma_indication_flag", ps_vui->u1_neutral_chroma_indication_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|    733|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  909|    733|    BITS_PARSE("field_seq_flag", ps_vui->u1_field_seq_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|    733|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  910|    733|    BITS_PARSE("frame_field_info_present_flag", ps_vui->u1_frame_field_info_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|    733|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  911|    733|    BITS_PARSE("default_display_window_flag", ps_vui->u1_default_display_window_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|    733|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  912|    733|    ps_vui->u4_def_disp_win_left_offset = 0;
  913|    733|    ps_vui->u4_def_disp_win_right_offset = 0;
  914|    733|    ps_vui->u4_def_disp_win_top_offset = 0;
  915|    733|    ps_vui->u4_def_disp_win_bottom_offset = 0;
  916|    733|    if(ps_vui->u1_default_display_window_flag)
  ------------------
  |  Branch (916:8): [True: 12, False: 721]
  ------------------
  917|     12|    {
  918|     12|        UEV_PARSE("def_disp_win_left_offset", ps_vui->u4_def_disp_win_left_offset, ps_bitstrm);
  ------------------
  |  |  155|     12|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  919|     12|        UEV_PARSE("def_disp_win_right_offset", ps_vui->u4_def_disp_win_right_offset, ps_bitstrm);
  ------------------
  |  |  155|     12|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  920|     12|        UEV_PARSE("def_disp_win_top_offset", ps_vui->u4_def_disp_win_top_offset, ps_bitstrm);
  ------------------
  |  |  155|     12|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  921|     12|        UEV_PARSE("def_disp_win_bottom_offset", ps_vui->u4_def_disp_win_bottom_offset, ps_bitstrm);
  ------------------
  |  |  155|     12|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  922|     12|    }
  923|       |
  924|    733|    BITS_PARSE("vui_timing_info_present_flag", ps_vui->u1_vui_timing_info_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|    733|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  925|    733|    if(ps_vui->u1_vui_timing_info_present_flag)
  ------------------
  |  Branch (925:8): [True: 110, False: 623]
  ------------------
  926|    110|    {
  927|    110|        BITS_PARSE("vui_num_units_in_tick", ps_vui->u4_vui_num_units_in_tick, ps_bitstrm, 32);
  ------------------
  |  |  148|    110|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  928|    110|        BITS_PARSE("vui_time_scale", ps_vui->u4_vui_time_scale, ps_bitstrm, 32);
  ------------------
  |  |  148|    110|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  929|    110|        BITS_PARSE("vui_poc_proportional_to_timing_flag", ps_vui->u1_poc_proportional_to_timing_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|    110|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  930|    110|        if(ps_vui->u1_poc_proportional_to_timing_flag)
  ------------------
  |  Branch (930:12): [True: 49, False: 61]
  ------------------
  931|     49|        {
  932|     49|            UEV_PARSE("vui_num_ticks_poc_diff_one_minus1", ps_vui->u4_num_ticks_poc_diff_one_minus1, ps_bitstrm);
  ------------------
  |  |  155|     49|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  933|     49|            if(ps_vui->u4_num_ticks_poc_diff_one_minus1 > UINT_MAX - 1)
  ------------------
  |  Branch (933:16): [True: 0, False: 49]
  ------------------
  934|      0|            {
  935|      0|                return IHEVCD_INVALID_PARAMETER;
  936|      0|            }
  937|     49|        }
  938|    110|        BITS_PARSE("vui_hrd_parameters_present_flag", ps_vui->u1_vui_hrd_parameters_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|    110|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  939|    110|        if(ps_vui->u1_vui_hrd_parameters_present_flag)
  ------------------
  |  Branch (939:12): [True: 93, False: 17]
  ------------------
  940|     93|        {
  941|     93|            ret = ihevcd_parse_hrd_parameters(ps_bitstrm, &ps_vui->s_vui_hrd_parameters, 1, sps_max_sub_layers_minus1);
  942|     93|            RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|     93|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 9, False: 84]
  |  |  ------------------
  ------------------
  943|     84|        }
  944|    110|    }
  945|       |
  946|    724|    BITS_PARSE("bitstream_restriction_flag", ps_vui->u1_bitstream_restriction_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|    724|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  947|    724|    ps_vui->u1_tiles_fixed_structure_flag = 0;
  948|    724|    ps_vui->u1_motion_vectors_over_pic_boundaries_flag = 1;
  949|    724|    ps_vui->u1_restricted_ref_pic_lists_flag = 0;
  950|    724|    ps_vui->u4_min_spatial_segmentation_idc = 0;
  951|    724|    ps_vui->u1_max_bytes_per_pic_denom = 2;
  952|    724|    ps_vui->u1_max_bits_per_mincu_denom = 1;
  953|    724|    ps_vui->u1_log2_max_mv_length_horizontal = 15;
  954|    724|    ps_vui->u1_log2_max_mv_length_vertical = 15;
  955|    724|    if(ps_vui->u1_bitstream_restriction_flag)
  ------------------
  |  Branch (955:8): [True: 61, False: 663]
  ------------------
  956|     61|    {
  957|     61|        BITS_PARSE("tiles_fixed_structure_flag", ps_vui->u1_tiles_fixed_structure_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|     61|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  958|     61|        BITS_PARSE("motion_vectors_over_pic_boundaries_flag", ps_vui->u1_motion_vectors_over_pic_boundaries_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|     61|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  959|     61|        BITS_PARSE("restricted_ref_pic_lists_flag", ps_vui->u1_restricted_ref_pic_lists_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|     61|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  960|       |
  961|     61|        UEV_PARSE("min_spatial_segmentation_idc", ps_vui->u4_min_spatial_segmentation_idc, ps_bitstrm);
  ------------------
  |  |  155|     61|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  962|     61|        if(ps_vui->u4_min_spatial_segmentation_idc > 4095)
  ------------------
  |  Branch (962:12): [True: 5, False: 56]
  ------------------
  963|      5|        {
  964|      5|            return IHEVCD_INVALID_PARAMETER;
  965|      5|        }
  966|     56|        UEV_PARSE("max_bytes_per_pic_denom", ps_vui->u1_max_bytes_per_pic_denom, ps_bitstrm);
  ------------------
  |  |  155|     56|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  967|     56|        if(ps_vui->u1_max_bytes_per_pic_denom > 16)
  ------------------
  |  Branch (967:12): [True: 0, False: 56]
  ------------------
  968|      0|        {
  969|      0|            return IHEVCD_INVALID_PARAMETER;
  970|      0|        }
  971|     56|        UEV_PARSE("max_bits_per_min_cu_denom", ps_vui->u1_max_bits_per_mincu_denom, ps_bitstrm);
  ------------------
  |  |  155|     56|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  972|     56|        if(ps_vui->u1_max_bits_per_mincu_denom > 16)
  ------------------
  |  Branch (972:12): [True: 0, False: 56]
  ------------------
  973|      0|        {
  974|      0|            return IHEVCD_INVALID_PARAMETER;
  975|      0|        }
  976|     56|        UEV_PARSE("log2_max_mv_length_horizontal", ps_vui->u1_log2_max_mv_length_horizontal, ps_bitstrm);
  ------------------
  |  |  155|     56|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  977|     56|        if(ps_vui->u1_max_bits_per_mincu_denom > 16)
  ------------------
  |  Branch (977:12): [True: 0, False: 56]
  ------------------
  978|      0|        {
  979|      0|            return IHEVCD_INVALID_PARAMETER;
  980|      0|        }
  981|     56|        UEV_PARSE("log2_max_mv_length_vertical", ps_vui->u1_log2_max_mv_length_vertical, ps_bitstrm);
  ------------------
  |  |  155|     56|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  982|     56|        if(ps_vui->u1_max_bits_per_mincu_denom > 15)
  ------------------
  |  Branch (982:12): [True: 0, False: 56]
  ------------------
  983|      0|        {
  984|      0|            return IHEVCD_INVALID_PARAMETER;
  985|      0|        }
  986|     56|    }
  987|       |
  988|    719|    return ret;
  989|    724|}
ihevcd_parse_headers.c:ihevcd_parse_hrd_parameters:
  668|     93|{
  669|     93|    WORD32 ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  670|     93|    WORD32 i;
  671|       |
  672|     93|    ps_hrd->u1_nal_hrd_parameters_present_flag = 0;
  673|     93|    ps_hrd->u1_vcl_hrd_parameters_present_flag = 0;
  674|       |
  675|     93|    ps_hrd->u1_sub_pic_cpb_params_present_flag = 0;
  676|       |
  677|     93|    ps_hrd->u1_tick_divisor_minus2 = 0;
  678|     93|    ps_hrd->u1_du_cpb_removal_delay_increment_length_minus1 = 0;
  679|     93|    ps_hrd->u1_sub_pic_cpb_params_in_pic_timing_sei_flag = 0;
  680|     93|    ps_hrd->u1_dpb_output_delay_du_length_minus1 = 0;
  681|       |
  682|     93|    ps_hrd->u4_bit_rate_scale = 0;
  683|     93|    ps_hrd->u4_cpb_size_scale = 0;
  684|     93|    ps_hrd->u4_cpb_size_du_scale = 0;
  685|       |
  686|     93|    ps_hrd->u1_initial_cpb_removal_delay_length_minus1 = 23;
  687|     93|    ps_hrd->u1_au_cpb_removal_delay_length_minus1 = 23;
  688|     93|    ps_hrd->u1_dpb_output_delay_length_minus1 = 23;
  689|       |
  690|     93|    if(common_info_present_flag)
  ------------------
  |  Branch (690:8): [True: 93, False: 0]
  ------------------
  691|     93|    {
  692|     93|        BITS_PARSE("nal_hrd_parameters_present_flag", ps_hrd->u1_nal_hrd_parameters_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|     93|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  693|     93|        BITS_PARSE("vcl_hrd_parameters_present_flag", ps_hrd->u1_vcl_hrd_parameters_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|     93|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  694|       |
  695|     93|        if(ps_hrd->u1_nal_hrd_parameters_present_flag  ||  ps_hrd->u1_vcl_hrd_parameters_present_flag)
  ------------------
  |  Branch (695:12): [True: 76, False: 17]
  |  Branch (695:60): [True: 16, False: 1]
  ------------------
  696|     92|        {
  697|     92|            BITS_PARSE("sub_pic_cpb_params_present_flag", ps_hrd->u1_sub_pic_cpb_params_present_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|     92|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  698|     92|            if(ps_hrd->u1_sub_pic_cpb_params_present_flag)
  ------------------
  |  Branch (698:16): [True: 71, False: 21]
  ------------------
  699|     71|            {
  700|     71|                BITS_PARSE("tick_divisor_minus2", ps_hrd->u1_tick_divisor_minus2, ps_bitstrm, 8);
  ------------------
  |  |  148|     71|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  701|     71|                BITS_PARSE("du_cpb_removal_delay_increment_length_minus1", ps_hrd->u1_du_cpb_removal_delay_increment_length_minus1, ps_bitstrm, 5);
  ------------------
  |  |  148|     71|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  702|     71|                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|     71|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  703|     71|                BITS_PARSE("dpb_output_delay_du_length_minus1", ps_hrd->u1_dpb_output_delay_du_length_minus1, ps_bitstrm, 5);
  ------------------
  |  |  148|     71|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  704|     71|            }
  705|       |
  706|     92|            BITS_PARSE("bit_rate_scale", ps_hrd->u4_bit_rate_scale, ps_bitstrm, 4);
  ------------------
  |  |  148|     92|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  707|     92|            BITS_PARSE("cpb_size_scale", ps_hrd->u4_cpb_size_scale, ps_bitstrm, 4);
  ------------------
  |  |  148|     92|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  708|     92|            if(ps_hrd->u1_sub_pic_cpb_params_present_flag)
  ------------------
  |  Branch (708:16): [True: 71, False: 21]
  ------------------
  709|     71|                BITS_PARSE("cpb_size_du_scale", ps_hrd->u4_cpb_size_du_scale, ps_bitstrm, 4);
  ------------------
  |  |  148|     71|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  710|       |
  711|     92|            BITS_PARSE("initial_cpb_removal_delay_length_minus1", ps_hrd->u1_initial_cpb_removal_delay_length_minus1, ps_bitstrm, 5);
  ------------------
  |  |  148|     92|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  712|     92|            BITS_PARSE("au_cpb_removal_delay_length_minus1", ps_hrd->u1_au_cpb_removal_delay_length_minus1, ps_bitstrm, 5);
  ------------------
  |  |  148|     92|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  713|     92|            BITS_PARSE("dpb_output_delay_length_minus1", ps_hrd->u1_dpb_output_delay_length_minus1, ps_bitstrm, 5);
  ------------------
  |  |  148|     92|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  714|     92|        }
  715|     93|    }
  716|       |
  717|       |
  718|    235|    for(i = 0; i <= max_num_sub_layers_minus1; i++)
  ------------------
  |  Branch (718:16): [True: 151, False: 84]
  ------------------
  719|    151|    {
  720|    151|        BITS_PARSE("fixed_pic_rate_general_flag[ i ]", ps_hrd->au1_fixed_pic_rate_general_flag[i], ps_bitstrm, 1);
  ------------------
  |  |  148|    151|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  721|       |
  722|    151|        ps_hrd->au1_fixed_pic_rate_within_cvs_flag[i] = 1;
  723|    151|        ps_hrd->au2_elemental_duration_in_tc_minus1[i] = 0;
  724|    151|        ps_hrd->au1_low_delay_hrd_flag[i] = 0;
  725|    151|        ps_hrd->au1_cpb_cnt_minus1[i] = 0;
  726|       |
  727|    151|        if(!ps_hrd->au1_fixed_pic_rate_general_flag[i])
  ------------------
  |  Branch (727:12): [True: 114, False: 37]
  ------------------
  728|    114|            BITS_PARSE("fixed_pic_rate_within_cvs_flag[ i ]", ps_hrd->au1_fixed_pic_rate_within_cvs_flag[i], ps_bitstrm, 1);
  ------------------
  |  |  148|    114|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  729|       |
  730|    151|        if(ps_hrd->au1_fixed_pic_rate_within_cvs_flag[i])
  ------------------
  |  Branch (730:12): [True: 85, False: 66]
  ------------------
  731|     85|        {
  732|     85|            UEV_PARSE("elemental_duration_in_tc_minus1[ i ]", ps_hrd->au2_elemental_duration_in_tc_minus1[i], ps_bitstrm);
  ------------------
  |  |  155|     85|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  733|     85|            if(ps_hrd->au2_elemental_duration_in_tc_minus1[i] > 2047)
  ------------------
  |  Branch (733:16): [True: 0, False: 85]
  ------------------
  734|      0|            {
  735|      0|                return IHEVCD_INVALID_PARAMETER;
  736|      0|            }
  737|     85|        }
  738|     66|        else
  739|     66|        {
  740|     66|            BITS_PARSE("low_delay_hrd_flag[ i ]", ps_hrd->au1_low_delay_hrd_flag[i], ps_bitstrm, 1);
  ------------------
  |  |  148|     66|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  741|     66|        }
  742|       |
  743|    151|        if(!ps_hrd->au1_low_delay_hrd_flag[i])
  ------------------
  |  Branch (743:12): [True: 134, False: 17]
  ------------------
  744|    134|        {
  745|    134|            UEV_PARSE("cpb_cnt_minus1[ i ]", ps_hrd->au1_cpb_cnt_minus1[i], ps_bitstrm);
  ------------------
  |  |  155|    134|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  746|    134|            if(ps_hrd->au1_cpb_cnt_minus1[i] > (MAX_CPB_CNT - 1))
  ------------------
  |  |  523|    134|#define MAX_CPB_CNT 32
  ------------------
  |  Branch (746:16): [True: 9, False: 125]
  ------------------
  747|      9|            {
  748|      9|                return IHEVCD_INVALID_PARAMETER;
  749|      9|            }
  750|    134|        }
  751|       |
  752|    142|        if(ps_hrd->u1_nal_hrd_parameters_present_flag)
  ------------------
  |  Branch (752:12): [True: 127, False: 15]
  ------------------
  753|    127|            ihevcd_parse_sub_layer_hrd_parameters(ps_bitstrm,
  754|    127|                                                  &ps_hrd->as_sub_layer_hrd_params[i],
  755|    127|                                                  ps_hrd->au1_cpb_cnt_minus1[i],
  756|    127|                                                  ps_hrd->u1_sub_pic_cpb_params_present_flag);
  757|       |
  758|    142|        if(ps_hrd->u1_vcl_hrd_parameters_present_flag)
  ------------------
  |  Branch (758:12): [True: 87, False: 55]
  ------------------
  759|     87|            ihevcd_parse_sub_layer_hrd_parameters(ps_bitstrm,
  760|     87|                                                  &ps_hrd->as_sub_layer_hrd_params[i],
  761|     87|                                                  ps_hrd->au1_cpb_cnt_minus1[i],
  762|     87|                                                  ps_hrd->u1_sub_pic_cpb_params_present_flag);
  763|    142|    }
  764|       |
  765|     84|    return ret;
  766|     93|}
ihevcd_parse_headers.c:ihevcd_parse_sub_layer_hrd_parameters:
  628|    214|{
  629|    214|    WORD32 ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  630|    214|    WORD32 i;
  631|       |
  632|    682|    for(i = 0; i <= cpb_cnt; i++)
  ------------------
  |  Branch (632:16): [True: 468, False: 214]
  ------------------
  633|    468|    {
  634|    468|        UEV_PARSE("bit_rate_value_minus1[ i ]", ps_sub_layer_hrd_params->au4_bit_rate_value_minus1[i], ps_bitstrm);
  ------------------
  |  |  155|    468|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  635|    468|        if(ps_sub_layer_hrd_params->au4_bit_rate_value_minus1[i] > UINT_MAX - 1)
  ------------------
  |  Branch (635:12): [True: 0, False: 468]
  ------------------
  636|      0|        {
  637|      0|            return IHEVCD_INVALID_PARAMETER;
  638|      0|        }
  639|    468|        UEV_PARSE("cpb_size_value_minus1[ i ]", ps_sub_layer_hrd_params->au4_cpb_size_value_minus1[i], ps_bitstrm);
  ------------------
  |  |  155|    468|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  640|    468|        if(ps_sub_layer_hrd_params->au4_cpb_size_value_minus1[i] > UINT_MAX - 1)
  ------------------
  |  Branch (640:12): [True: 0, False: 468]
  ------------------
  641|      0|        {
  642|      0|            return IHEVCD_INVALID_PARAMETER;
  643|      0|        }
  644|    468|        if(sub_pic_cpb_params_present_flag)
  ------------------
  |  Branch (644:12): [True: 304, False: 164]
  ------------------
  645|    304|        {
  646|    304|            UEV_PARSE("cpb_size_du_value_minus1[ i ]", ps_sub_layer_hrd_params->au4_cpb_size_du_value_minus1[i], ps_bitstrm);
  ------------------
  |  |  155|    304|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  647|    304|            if(ps_sub_layer_hrd_params->au4_cpb_size_du_value_minus1[i] > UINT_MAX - 1)
  ------------------
  |  Branch (647:16): [True: 0, False: 304]
  ------------------
  648|      0|            {
  649|      0|                return IHEVCD_INVALID_PARAMETER;
  650|      0|            }
  651|    304|            UEV_PARSE("bit_rate_du_value_minus1[ i ]", ps_sub_layer_hrd_params->au4_bit_rate_du_value_minus1[i], ps_bitstrm);
  ------------------
  |  |  155|    304|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  652|    304|            if(ps_sub_layer_hrd_params->au4_bit_rate_du_value_minus1[i] > UINT_MAX - 1)
  ------------------
  |  Branch (652:16): [True: 0, False: 304]
  ------------------
  653|      0|            {
  654|      0|                return IHEVCD_INVALID_PARAMETER;
  655|      0|            }
  656|    304|        }
  657|    468|        BITS_PARSE("cbr_flag[ i ]", ps_sub_layer_hrd_params->au1_cbr_flag[i], ps_bitstrm, 1);
  ------------------
  |  |  148|    468|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  658|    468|    }
  659|       |
  660|    214|    return ret;
  661|    214|}

ihevcd_parse_residual_coding:
  185|  7.83M|{
  186|  7.83M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  187|  7.83M|    WORD32 transform_skip_flag;
  188|  7.83M|    WORD32 value;
  189|  7.83M|    pps_t *ps_pps;
  190|  7.83M|    WORD32 last_scan_pos, last_sub_blk;
  191|  7.83M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  192|  7.83M|    WORD32 last_significant_coeff_x_prefix, last_significant_coeff_y_prefix;
  193|  7.83M|    WORD32 last_significant_coeff_x, last_significant_coeff_y;
  194|  7.83M|    const UWORD8 *pu1_scan_blk = NULL, *pu1_scan_coeff;
  195|  7.83M|    WORD32 scan_idx;
  196|  7.83M|    WORD32 i;
  197|  7.83M|    WORD32 sign_data_hiding_flag;
  198|  7.83M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  199|  7.83M|    WORD32 gt1_ctxt = 1;
  200|  7.83M|    WORD32 c_max;
  201|  7.83M|    UWORD16 au2_csbf[9];
  202|  7.83M|    tu_sblk_coeff_data_t *ps_tu_sblk_coeff_data;
  203|  7.83M|    WORD8 *pi1_num_coded_subblks;
  204|  7.83M|    WORD32 num_subblks;
  205|  7.83M|    WORD32 sig_coeff_base_ctxt, abs_gt1_base_ctxt;
  206|  7.83M|    UNUSED(x0);
  ------------------
  |  |   38|  7.83M|#define UNUSED(x) ((void)(x))
  ------------------
  207|  7.83M|    UNUSED(y0);
  ------------------
  |  |   38|  7.83M|#define UNUSED(x) ((void)(x))
  ------------------
  208|  7.83M|    ps_pps = ps_codec->s_parse.ps_pps;
  209|       |
  210|  7.83M|    sign_data_hiding_flag = ps_pps->i1_sign_data_hiding_flag;
  211|  7.83M|    transform_skip_flag = 0;
  212|  7.83M|    if(ps_pps->i1_transform_skip_enabled_flag &&
  ------------------
  |  Branch (212:8): [True: 7.53M, False: 296k]
  ------------------
  213|  7.83M|       !ps_codec->s_parse.s_cu.i4_cu_transquant_bypass &&
  ------------------
  |  Branch (213:8): [True: 7.53M, False: 1.13k]
  ------------------
  214|  7.83M|       (log2_trafo_size == 2))
  ------------------
  |  Branch (214:8): [True: 1.03M, False: 6.49M]
  ------------------
  215|  1.03M|    {
  216|  1.03M|        WORD32 ctxt_idx;
  217|       |
  218|  1.03M|        if(!c_idx)
  ------------------
  |  Branch (218:12): [True: 484k, False: 551k]
  ------------------
  219|   484k|        {
  220|   484k|            ctxt_idx = IHEVC_CAB_TFM_SKIP0;
  221|   484k|        }
  222|   551k|        else
  223|   551k|        {
  224|   551k|            ctxt_idx = IHEVC_CAB_TFM_SKIP12;
  225|   551k|        }
  226|  1.03M|        TRACE_CABAC_CTXT("transform_skip_flag", ps_cabac->u4_range, ctxt_idx);
  227|  1.03M|        value = ihevcd_cabac_decode_bin(ps_cabac,
  228|  1.03M|                                        ps_bitstrm,
  229|  1.03M|                                        ctxt_idx);
  230|  1.03M|        AEV_TRACE("transform_skip_flag", value, ps_cabac->u4_range);
  231|  1.03M|        transform_skip_flag = value;
  232|  1.03M|    }
  233|       |
  234|       |    /* code the last_coeff_x_prefix as tunary binarized code */
  235|  7.83M|    {
  236|  7.83M|        WORD32 ctxt_idx_x, ctxt_idx_y, ctx_shift;
  237|  7.83M|        WORD32 ctx_offset;
  238|  7.83M|        c_max = (log2_trafo_size << 1) - 1;
  239|       |
  240|  7.83M|        if(!c_idx)
  ------------------
  |  Branch (240:12): [True: 5.42M, False: 2.40M]
  ------------------
  241|  5.42M|        {
  242|  5.42M|            ctx_offset = (3 * (log2_trafo_size - 2)) + ((log2_trafo_size - 1) >> 2);
  243|  5.42M|            ctxt_idx_x = IHEVC_CAB_COEFFX_PREFIX + ctx_offset;
  244|  5.42M|            ctxt_idx_y = IHEVC_CAB_COEFFY_PREFIX + ctx_offset;
  245|  5.42M|            ctx_shift  = (log2_trafo_size + 1) >> 2;
  246|  5.42M|        }
  247|  2.40M|        else
  248|  2.40M|        {
  249|  2.40M|            ctxt_idx_x = IHEVC_CAB_COEFFX_PREFIX + 15;
  250|  2.40M|            ctxt_idx_y = IHEVC_CAB_COEFFY_PREFIX + 15;
  251|  2.40M|            ctx_shift  = log2_trafo_size  - 2;
  252|  2.40M|        }
  253|       |
  254|  7.83M|        TRACE_CABAC_CTXT("last_coeff_x_prefix", ps_cabac->u4_range, ctxt_idx_x);
  255|  7.83M|        last_significant_coeff_x_prefix = ihevcd_cabac_decode_bins_tunary(ps_cabac,
  256|  7.83M|                                                                          ps_bitstrm,
  257|  7.83M|                                                                          c_max,
  258|  7.83M|                                                                          ctxt_idx_x,
  259|  7.83M|                                                                          ctx_shift,
  260|  7.83M|                                                                          c_max);
  261|       |
  262|  7.83M|        AEV_TRACE("last_coeff_x_prefix", last_significant_coeff_x_prefix, ps_cabac->u4_range);
  263|       |
  264|  7.83M|        TRACE_CABAC_CTXT("last_coeff_y_prefix", ps_cabac->u4_range, ctxt_idx_y);
  265|  7.83M|        last_significant_coeff_y_prefix = ihevcd_cabac_decode_bins_tunary(ps_cabac,
  266|  7.83M|                                                                          ps_bitstrm,
  267|  7.83M|                                                                          c_max,
  268|  7.83M|                                                                          ctxt_idx_y,
  269|  7.83M|                                                                          ctx_shift,
  270|  7.83M|                                                                          c_max);
  271|       |
  272|  7.83M|        AEV_TRACE("last_coeff_y_prefix", last_significant_coeff_y_prefix, ps_cabac->u4_range);
  273|       |
  274|       |
  275|  7.83M|        last_significant_coeff_x = last_significant_coeff_x_prefix;
  276|  7.83M|        if(last_significant_coeff_x_prefix > 3)
  ------------------
  |  Branch (276:12): [True: 1.86M, False: 5.96M]
  ------------------
  277|  1.86M|        {
  278|  1.86M|            WORD32 suf_length = ((last_significant_coeff_x_prefix - 2) >> 1);
  279|       |
  280|  1.86M|            value = ihevcd_cabac_decode_bypass_bins(ps_cabac,
  281|  1.86M|                                                    ps_bitstrm,
  282|  1.86M|                                                    suf_length);
  283|       |
  284|  1.86M|            AEV_TRACE("last_coeff_x_suffix", value, ps_cabac->u4_range);
  285|       |
  286|       |
  287|  1.86M|            last_significant_coeff_x =
  288|  1.86M|                            (1 << ((last_significant_coeff_x_prefix >> 1) - 1)) *
  289|  1.86M|                            (2 + (last_significant_coeff_x_prefix & 1)) + value;
  290|  1.86M|        }
  291|       |
  292|       |
  293|  7.83M|        last_significant_coeff_y = last_significant_coeff_y_prefix;
  294|  7.83M|        if(last_significant_coeff_y_prefix > 3)
  ------------------
  |  Branch (294:12): [True: 1.92M, False: 5.90M]
  ------------------
  295|  1.92M|        {
  296|  1.92M|            WORD32 suf_length = ((last_significant_coeff_y_prefix - 2) >> 1);
  297|  1.92M|            value = ihevcd_cabac_decode_bypass_bins(ps_cabac,
  298|  1.92M|                                                    ps_bitstrm,
  299|  1.92M|                                                    suf_length);
  300|       |
  301|  1.92M|            AEV_TRACE("last_coeff_y_suffix", value, ps_cabac->u4_range);
  302|  1.92M|            last_significant_coeff_y =
  303|  1.92M|                            (1 << ((last_significant_coeff_y_prefix >> 1) - 1)) *
  304|  1.92M|                            (2 + (last_significant_coeff_y_prefix & 1)) + value;
  305|  1.92M|        }
  306|       |
  307|  7.83M|    }
  308|       |
  309|       |    /* Choose a scan matrix based on intra flag, intra pred mode, transform size
  310|       |     and luma/chroma */
  311|  7.83M|    scan_idx = SCAN_DIAG_UPRIGHT;
  312|  7.83M|    if(PRED_MODE_INTRA == ps_codec->s_parse.s_cu.i4_pred_mode)
  ------------------
  |  Branch (312:8): [True: 7.73M, False: 94.7k]
  ------------------
  313|  7.73M|    {
  314|  7.73M|        if((2 == log2_trafo_size) || ((3 == log2_trafo_size) && (0 == c_idx)))
  ------------------
  |  Branch (314:12): [True: 1.05M, False: 6.67M]
  |  Branch (314:39): [True: 1.86M, False: 4.81M]
  |  Branch (314:65): [True: 822k, False: 1.03M]
  ------------------
  315|  1.87M|        {
  316|  1.87M|            if((6 <= intra_pred_mode) &&
  ------------------
  |  Branch (316:16): [True: 1.00M, False: 872k]
  ------------------
  317|  1.87M|               (14 >= intra_pred_mode))
  ------------------
  |  Branch (317:16): [True: 228k, False: 777k]
  ------------------
  318|   228k|            {
  319|   228k|                scan_idx = SCAN_VERT;
  320|   228k|            }
  321|  1.65M|            else if((22 <= intra_pred_mode) &&
  ------------------
  |  Branch (321:21): [True: 621k, False: 1.02M]
  ------------------
  322|  1.65M|                    (30 >= intra_pred_mode))
  ------------------
  |  Branch (322:21): [True: 515k, False: 105k]
  ------------------
  323|   515k|            {
  324|   515k|                scan_idx = SCAN_HORZ;
  325|   515k|            }
  326|  1.87M|        }
  327|  7.73M|    }
  328|       |
  329|       |    /* In case the scan is vertical, then swap  X and Y positions */
  330|  7.83M|    if(SCAN_VERT == scan_idx)
  ------------------
  |  Branch (330:8): [True: 228k, False: 7.60M]
  ------------------
  331|   228k|    {
  332|   228k|        SWAP(last_significant_coeff_x, last_significant_coeff_y);
  ------------------
  |  |   87|   228k|#define SWAP(X,Y)                   \
  |  |   88|   228k|{                                   \
  |  |   89|   228k|    (X) = (X) ^ (Y);                \
  |  |   90|   228k|    (Y) = (X) ^ (Y);                \
  |  |   91|   228k|    (X) = (X) ^ (Y);                \
  |  |   92|   228k|}
  ------------------
  333|   228k|    }
  334|       |
  335|  7.83M|    {
  336|  7.83M|        WORD8 *pi1_scan_idx;
  337|  7.83M|        WORD8 *pi1_buf = (WORD8 *)ps_codec->s_parse.pv_tu_coeff_data;
  338|       |
  339|       |        /* First WORD8 gives number of coded subblocks */
  340|  7.83M|        pi1_num_coded_subblks = pi1_buf++;
  341|       |
  342|       |        /* Set number of coded subblocks in the current TU to zero */
  343|       |        /* This will be updated later */
  344|  7.83M|        *pi1_num_coded_subblks = 0;
  345|       |
  346|       |        /* Second WORD8 gives (scan idx << 1) | trans_skip */
  347|  7.83M|        pi1_scan_idx = pi1_buf++;
  348|  7.83M|        *pi1_scan_idx = (scan_idx << 1) | transform_skip_flag;
  349|       |
  350|       |        /* Store the incremented pointer in pv_tu_coeff_data */
  351|  7.83M|        ps_codec->s_parse.pv_tu_coeff_data = pi1_buf;
  352|       |
  353|  7.83M|    }
  354|       |    /**
  355|       |     * Given last_significant_coeff_y and last_significant_coeff_x find last sub block
  356|       |     * This is done by ignoring lower two bits of last_significant_coeff_y and last_significant_coeff_x
  357|       |     * and using scan matrix for lookup
  358|       |     */
  359|       |
  360|       |    /* If transform is 4x4, last_sub_blk is zero */
  361|  7.83M|    last_sub_blk = 0;
  362|       |
  363|       |    /* If transform is larger than 4x4, then based on scan_idx and transform size, choose a scan table */
  364|       |
  365|  7.83M|    if(log2_trafo_size > 2)
  ------------------
  |  Branch (365:8): [True: 6.73M, False: 1.09M]
  ------------------
  366|  6.73M|    {
  367|  6.73M|        WORD32 scan_pos;
  368|  6.73M|        WORD32 scan_mat_size;
  369|  6.73M|        pu1_scan_blk = (UWORD8 *)gapv_ihevc_scan[scan_idx * 3 + (log2_trafo_size - 2 - 1)];
  370|       |
  371|       |
  372|       |        /* Divide the current transform to 4x4 subblocks and count number of 4x4 in the first row */
  373|       |        /* This will be size of scan matrix to be used for subblock scanning */
  374|  6.73M|        scan_mat_size = 1 << (log2_trafo_size - 2);
  375|  6.73M|        scan_pos = ((last_significant_coeff_y >> 2) * scan_mat_size) +
  376|  6.73M|                        (last_significant_coeff_x >> 2);
  377|       |
  378|  6.73M|        last_sub_blk = pu1_scan_blk[scan_pos];
  379|  6.73M|    }
  380|  7.83M|    pu1_scan_coeff  = &gau1_ihevc_scan4x4[scan_idx][0];
  381|       |
  382|  7.83M|    {
  383|  7.83M|        WORD32 scan_pos;
  384|       |
  385|  7.83M|        scan_pos = ((last_significant_coeff_y & 3) << 2) +
  386|  7.83M|                        (last_significant_coeff_x & 3);
  387|       |
  388|  7.83M|        last_scan_pos = pu1_scan_coeff[scan_pos];
  389|  7.83M|    }
  390|  7.83M|    if(log2_trafo_size > 2)
  ------------------
  |  Branch (390:8): [True: 6.73M, False: 1.09M]
  ------------------
  391|  6.73M|        pu1_scan_blk = (UWORD8 *)gapv_ihevc_invscan[scan_idx * 3 + (log2_trafo_size - 2 - 1)];
  392|  7.83M|    pu1_scan_coeff  = &gau1_ihevc_invscan4x4[scan_idx][0];
  393|       |
  394|       |    /* Set CSBF array to zero */
  395|  7.83M|    {
  396|  7.83M|        UWORD32 *pu4_csbf;
  397|  7.83M|        pu4_csbf = (void *)au2_csbf;
  398|  7.83M|        *pu4_csbf++ = 0;
  399|  7.83M|        *pu4_csbf++ = 0;
  400|  7.83M|        *pu4_csbf++ = 0;
  401|  7.83M|        *pu4_csbf = 0;
  402|       |        /* To avoid a check for y pos, 9th WORD16 in the array is set to zero */
  403|  7.83M|        au2_csbf[8] = 0;
  404|  7.83M|    }
  405|       |
  406|       |    /*************************************************************************/
  407|       |    /* derive base context index for sig coeff as per section 9.3.3.1.4      */
  408|       |    /* TODO; convert to look up based on luma/chroma, scan type and tfr size */
  409|       |    /*************************************************************************/
  410|  7.83M|    if(!c_idx)
  ------------------
  |  Branch (410:8): [True: 5.42M, False: 2.40M]
  ------------------
  411|  5.42M|    {
  412|  5.42M|        sig_coeff_base_ctxt = IHEVC_CAB_COEFF_FLAG;
  413|  5.42M|        abs_gt1_base_ctxt = IHEVC_CAB_COEFABS_GRTR1_FLAG;
  414|       |
  415|  5.42M|        if(3 == log2_trafo_size)
  ------------------
  |  Branch (415:12): [True: 837k, False: 4.59M]
  ------------------
  416|   837k|        {
  417|       |            /* 8x8 transform size */
  418|   837k|            sig_coeff_base_ctxt += (scan_idx == SCAN_DIAG_UPRIGHT) ? 9 : 15;
  ------------------
  |  Branch (418:36): [True: 524k, False: 312k]
  ------------------
  419|   837k|        }
  420|  4.59M|        else  if(3 < log2_trafo_size)
  ------------------
  |  Branch (420:18): [True: 4.07M, False: 514k]
  ------------------
  421|  4.07M|        {
  422|       |            /* larger transform sizes */
  423|  4.07M|            sig_coeff_base_ctxt += 21;
  424|  4.07M|        }
  425|  5.42M|    }
  426|  2.40M|    else
  427|  2.40M|    {
  428|       |        /* chroma context initializations */
  429|  2.40M|        sig_coeff_base_ctxt = IHEVC_CAB_COEFF_FLAG + 27;
  430|  2.40M|        abs_gt1_base_ctxt = IHEVC_CAB_COEFABS_GRTR1_FLAG + 16;
  431|       |
  432|  2.40M|        if(3 == log2_trafo_size)
  ------------------
  |  Branch (432:12): [True: 1.04M, False: 1.35M]
  ------------------
  433|  1.04M|        {
  434|       |            /* 8x8 transform size */
  435|  1.04M|            sig_coeff_base_ctxt += 9;
  436|  1.04M|        }
  437|  1.35M|        else  if(3 < log2_trafo_size)
  ------------------
  |  Branch (437:18): [True: 771k, False: 584k]
  ------------------
  438|   771k|        {
  439|       |            /* larger transform sizes */
  440|   771k|            sig_coeff_base_ctxt += 12;
  441|   771k|        }
  442|  2.40M|    }
  443|  7.83M|    num_subblks = 0;
  444|       |    /* Parse each 4x4 subblocks */
  445|  29.4M|    for(i = last_sub_blk; i >= 0; i--)
  ------------------
  |  Branch (445:27): [True: 21.6M, False: 7.83M]
  ------------------
  446|  21.6M|    {
  447|  21.6M|        WORD32 sub_blk_pos;
  448|  21.6M|        WORD32 infer_sig_coeff_flag;
  449|  21.6M|        WORD32 cur_csbf;
  450|       |
  451|  21.6M|        WORD32 n;
  452|  21.6M|        WORD32 num_coeff;
  453|       |        /* Sig coeff map for 16 entries in raster scan order. Upper 16 bits are used.
  454|       |         * MSB gives sig coeff flag for 0th coeff and so on
  455|       |         * UWORD16 would have been enough but kept as UWORD32 for code optimizations
  456|       |         * In arm unnecessary masking operations are saved
  457|       |         */
  458|  21.6M|        UWORD32 u4_sig_coeff_map_raster;
  459|  21.6M|        WORD32 sign_hidden;
  460|       |
  461|       |        /* Sig coeff map in scan order */
  462|  21.6M|        UWORD32 u4_sig_coeff_map;
  463|  21.6M|        WORD32 coeff_abs_level_greater2_flag;
  464|  21.6M|        UWORD32 u4_coeff_abs_level_greater1_map;
  465|  21.6M|        UWORD32 u4_coeff_abs_level_greater2_map;
  466|  21.6M|        UWORD32 u4_coeff_sign_map;
  467|  21.6M|        WORD32 first_sig_scan_pos, last_sig_scan_pos, num_greater1_flag, first_greater1_scan_pos;
  468|  21.6M|        WORD32  num_sig_coeff, sum_abs_level;
  469|  21.6M|        WORD32 nbr_csbf;
  470|       |
  471|       |
  472|  21.6M|        WORD32 ctxt_set;
  473|  21.6M|        WORD32 rice_param;
  474|  21.6M|        WORD32 xs, ys;
  475|       |
  476|       |
  477|  21.6M|        sub_blk_pos  = 0;
  478|  21.6M|        if(i && (log2_trafo_size > 2))
  ------------------
  |  Branch (478:12): [True: 13.7M, False: 7.83M]
  |  Branch (478:17): [True: 13.7M, False: 0]
  ------------------
  479|  13.7M|            sub_blk_pos = pu1_scan_blk[i];
  480|       |
  481|       |        /* Get xs and ys from scan position */
  482|       |        /* This is needed for context modelling of significant coeff flag */
  483|  21.6M|        xs = sub_blk_pos & ((1 << (log2_trafo_size - 2)) - 1);
  484|  21.6M|        ys = sub_blk_pos >> (log2_trafo_size - 2);
  485|       |
  486|       |
  487|       |        /* Check if neighbor subblocks are coded */
  488|  21.6M|        {
  489|       |
  490|  21.6M|            nbr_csbf = 0;
  491|       |
  492|       |            /* Get Bottom sub blocks CSBF */
  493|  21.6M|            nbr_csbf |= (au2_csbf[ys + 1] >> xs) & 1;
  494|  21.6M|            nbr_csbf <<= 1;
  495|       |
  496|       |            /* Get Right sub blocks CSBF */
  497|       |            /* Even if xs is equal to (1 << (log2_trafo_size - 2 )) - 1,
  498|       |               since au2_csbf is set to zero at the beginning, csbf for
  499|       |               neighbor will be read as 0 */
  500|       |
  501|  21.6M|            nbr_csbf |= (au2_csbf[ys] >> (xs + 1)) & 1;
  502|       |
  503|       |
  504|  21.6M|        }
  505|  21.6M|        cur_csbf = 0;
  506|       |
  507|       |        /* DC coeff is inferred, only if coded_sub_block is explicitly parsed as 1 */
  508|       |        /* i.e. it is not inferred for first and last subblock */
  509|  21.6M|        infer_sig_coeff_flag = 0;
  510|  21.6M|        if((i < last_sub_blk) && (i > 0))
  ------------------
  |  Branch (510:12): [True: 13.7M, False: 7.83M]
  |  Branch (510:34): [True: 10.8M, False: 2.98M]
  ------------------
  511|  10.8M|        {
  512|  10.8M|            WORD32 ctxt_idx  = IHEVC_CAB_CODED_SUBLK_IDX;
  513|       |
  514|       |            /* ctxt based on right / bottom avail csbf, section 9.3.3.1.3 */
  515|  10.8M|            ctxt_idx += (nbr_csbf) ? 1 : 0;
  ------------------
  |  Branch (515:25): [True: 4.20M, False: 6.59M]
  ------------------
  516|       |
  517|       |            /* Ctxt based on luma or chroma */
  518|  10.8M|            ctxt_idx += c_idx  ? 2 : 0;
  ------------------
  |  Branch (518:25): [True: 1.00M, False: 9.79M]
  ------------------
  519|  10.8M|            TRACE_CABAC_CTXT("coded_sub_block_flag", ps_cabac->u4_range, ctxt_idx);
  520|  43.2M|            IHEVCD_CABAC_DECODE_BIN(cur_csbf, ps_cabac, ps_bitstrm, ctxt_idx);
  ------------------
  |  |   59|  10.8M|#define IHEVCD_CABAC_DECODE_BIN(u4_bin, ps_cabac, ps_bitstrm, ctxt_index)       \
  |  |   60|  10.8M|{                                                                               \
  |  |   61|  10.8M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |   62|  10.8M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |   63|  10.8M|    UWORD32 u4_rlps;                                                            \
  |  |   64|  10.8M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];            \
  |  |   65|  10.8M|    WORD32 state_mps = *pu1_ctxt_model;                                         \
  |  |   66|  10.8M|    WORD32 clz;                                                                 \
  |  |   67|  10.8M|    UWORD32 u4_qnt_range;                                                       \
  |  |   68|  10.8M|                                                                                \
  |  |   69|  10.8M|    /* Sanity checks */                                                         \
  |  |   70|  10.8M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  10.8M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   71|  10.8M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  10.8M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   72|  10.8M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));             \
  |  |  ------------------
  |  |  |  |   55|  10.8M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   73|  10.8M|    ASSERT(state_mps < 128);                                                    \
  |  |  ------------------
  |  |  |  |   55|  10.8M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   74|  10.8M|    clz = CLZ(u4_range);                                                        \
  |  |   75|  10.8M|    clz -= (32 - RANGE_NUMBITS);                                                \
  |  |  ------------------
  |  |  |  |   40|  10.8M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |   76|  10.8M|    u4_qnt_range = u4_range << clz;                                             \
  |  |   77|  10.8M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;                   \
  |  |  ------------------
  |  |  |  |   41|  10.8M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  10.8M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|  10.8M|    /* Get the lps range from LUT based on quantized range and state */         \
  |  |   79|  10.8M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];              \
  |  |   80|  10.8M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);                                   \
  |  |  ------------------
  |  |  |  |   41|  10.8M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  10.8M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  10.8M|    u4_range -= u4_rlps;                                                        \
  |  |   82|  10.8M|                                                                                \
  |  |   83|  10.8M|    u4_bin = state_mps & 1;                                                     \
  |  |   84|  10.8M|                                                                                \
  |  |   85|  10.8M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (85:8): [True: 486k, False: 10.3M]
  |  |  ------------------
  |  |   86|  10.8M|    {                                                                           \
  |  |   87|   486k|        u4_bin = 1 - u4_bin;                                                    \
  |  |   88|   486k|        u4_ofst -= u4_range;                                                    \
  |  |   89|   486k|        u4_range = u4_rlps;                                                     \
  |  |   90|   486k|    }                                                                           \
  |  |   91|  10.8M|                                                                                \
  |  |   92|  10.8M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];         \
  |  |   93|  10.8M|                                                                                \
  |  |   94|  10.8M|    /*****************************************************************/         \
  |  |   95|  10.8M|    /* Re-normalization; calculate bits generated based on range(R)  */         \
  |  |   96|  10.8M|    /*****************************************************************/         \
  |  |   97|  10.8M|    if(u4_range < (1 << 8))                                                     \
  |  |  ------------------
  |  |  |  Branch (97:8): [True: 74.7k, False: 10.7M]
  |  |  ------------------
  |  |   98|  10.8M|    {                                                                           \
  |  |   99|  74.7k|        UWORD32 u4_bits;                                                        \
  |  |  100|  74.7k|        WORD32 numbits;                                                         \
  |  |  101|  74.7k|        numbits = CLZ(u4_range);                                                \
  |  |  102|  74.7k|        numbits -= (32 - RANGE_NUMBITS);                                        \
  |  |  ------------------
  |  |  |  |   40|  74.7k|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |  103|  74.7k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  74.7k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  74.7k|{                                                               \
  |  |  |  |  152|  74.7k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  74.7k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  74.7k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  74.7k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  74.7k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   149k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 50.6k, False: 24.0k]
  |  |  |  |  ------------------
  |  |  |  |  156|  74.7k|    {                                                           \
  |  |  |  |  157|  50.6k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  50.6k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 50.6k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|  50.6k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|  50.6k|    }                                                           \
  |  |  |  |  160|  74.7k|                                                                \
  |  |  |  |  161|  74.7k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   149k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 52.5k, False: 22.1k]
  |  |  |  |  ------------------
  |  |  |  |  162|  74.7k|    {                                                           \
  |  |  |  |  163|  52.5k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|  52.5k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|  52.5k|        /* Getting the next word */                             \
  |  |  |  |  166|  52.5k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|  52.5k|                                                                \
  |  |  |  |  168|  52.5k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  52.5k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|  52.5k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|  52.5k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  52.5k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  52.5k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  52.5k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  52.5k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|  52.5k|    }                                                           \
  |  |  |  |  172|  74.7k|}
  |  |  ------------------
  |  |  104|  74.7k|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);    \
  |  |  105|  74.7k|                                                                                \
  |  |  106|  74.7k|        u4_ofst <<= numbits;                                                    \
  |  |  107|  74.7k|        u4_ofst |= u4_bits;                                                     \
  |  |  108|  74.7k|        u4_range <<= numbits;                                                   \
  |  |  109|  74.7k|                                                                                \
  |  |  110|  74.7k|    }                                                                           \
  |  |  111|  10.8M|    /* Update the cabac context */                                              \
  |  |  112|  10.8M|    ps_cabac->u4_range = u4_range;                                              \
  |  |  113|  10.8M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  114|  10.8M|                                                                                \
  |  |  115|  10.8M|}
  ------------------
  521|  43.2M|            AEV_TRACE("coded_sub_block_flag", cur_csbf, ps_cabac->u4_range);
  522|       |
  523|  43.2M|            infer_sig_coeff_flag = 1;
  524|  43.2M|        }
  525|  10.8M|        else /* if((i == last_sub_blk) || (sub_blk_pos == 0)) */
  526|  10.8M|        {
  527|       |            /* CSBF is set to 1 for first and last subblock */
  528|       |            /* Note for these subblocks sig_coeff_map is not inferred but instead parsed */
  529|  10.8M|            cur_csbf = 1;
  530|  10.8M|        }
  531|       |
  532|       |        /* Set current sub blocks CSBF */
  533|  21.6M|        {
  534|  21.6M|            UWORD32 u4_mask = 1 << xs;
  535|  21.6M|            if(cur_csbf)
  ------------------
  |  Branch (535:16): [True: 14.1M, False: 7.44M]
  ------------------
  536|  14.1M|                au2_csbf[ys] |= u4_mask;
  537|  7.44M|            else
  538|  7.44M|                au2_csbf[ys] &= ~u4_mask;
  539|       |
  540|  21.6M|        }
  541|       |
  542|       |        /* If current subblock is not coded, proceed to the next subblock */
  543|  21.6M|        if(0 == cur_csbf)
  ------------------
  |  Branch (543:12): [True: 7.44M, False: 14.1M]
  ------------------
  544|  7.44M|            continue;
  545|       |
  546|  14.1M|        n = 15;
  547|  14.1M|        u4_sig_coeff_map_raster = 0;
  548|  14.1M|        u4_sig_coeff_map = 0;
  549|  14.1M|        num_coeff = 0;
  550|  14.1M|        if(i == last_sub_blk)
  ------------------
  |  Branch (550:12): [True: 7.83M, False: 6.34M]
  ------------------
  551|  7.83M|        {
  552|  7.83M|            WORD32 pos = ((last_significant_coeff_y & 3) << 2) +
  553|  7.83M|                            (last_significant_coeff_x & 3);
  554|  7.83M|            n = (last_scan_pos - 1);
  555|       |            /* Set Significant coeff map for last significant coeff flag as 1 */
  556|  7.83M|            u4_sig_coeff_map_raster = 1 << pos;
  557|  7.83M|            u4_sig_coeff_map = 1 << last_scan_pos;
  558|  7.83M|            num_coeff = 1;
  559|  7.83M|        }
  560|       |
  561|   133M|        for(; n >= 0; n--)
  ------------------
  |  Branch (561:15): [True: 119M, False: 14.1M]
  ------------------
  562|   119M|        {
  563|   119M|            WORD32 significant_coeff_flag;
  564|       |
  565|   119M|            if((n > 0 || !infer_sig_coeff_flag))
  ------------------
  |  Branch (565:17): [True: 109M, False: 9.81M]
  |  Branch (565:26): [True: 7.67M, False: 2.13M]
  ------------------
  566|   117M|            {
  567|       |                //WORD32 coeff_pos;
  568|   117M|                WORD32 sig_ctxinc;
  569|   117M|                WORD32 ctxt_idx;
  570|       |
  571|       |                /* Coefficient position is needed for deriving context index for significant_coeff_flag */
  572|       |                //coeff_pos = pu1_scan_coeff[n];
  573|       |                /* derive the context inc as per section 9.3.3.1.4 */
  574|   117M|                sig_ctxinc = 0;
  575|   117M|                if(2 == log2_trafo_size)
  ------------------
  |  Branch (575:20): [True: 5.18M, False: 112M]
  ------------------
  576|  5.18M|                {
  577|       |
  578|       |                    /* 4x4 transform size increment uses lookup */
  579|  5.18M|                    sig_ctxinc = gau1_ihevcd_sigcoeff_ctxtinc_tr4[scan_idx][n];
  580|  5.18M|                }
  581|   112M|                else if(n || i)
  ------------------
  |  Branch (581:25): [True: 105M, False: 6.93M]
  |  Branch (581:30): [True: 2.37M, False: 4.56M]
  ------------------
  582|   107M|                {
  583|       |                    /* ctxt for AC coeff depends on curpos and neigbour csbf */
  584|   107M|                    sig_ctxinc = gau1_ihevcd_sigcoeff_ctxtinc[scan_idx][nbr_csbf][n];
  585|       |
  586|       |                    /* based on luma subblock pos */
  587|   107M|                    sig_ctxinc += (i && (!c_idx)) ? 3 : 0;
  ------------------
  |  Branch (587:36): [True: 57.6M, False: 49.9M]
  |  Branch (587:41): [True: 49.5M, False: 8.08M]
  ------------------
  588|       |
  589|   107M|                }
  590|  4.56M|                else
  591|  4.56M|                {
  592|       |                    /* DC coeff has fixed context for luma and chroma */
  593|  4.56M|                    sig_coeff_base_ctxt = (0 == c_idx) ? IHEVC_CAB_COEFF_FLAG :
  ------------------
  |  Branch (593:43): [True: 3.60M, False: 961k]
  ------------------
  594|  4.56M|                                                         (IHEVC_CAB_COEFF_FLAG + 27);
  595|  4.56M|                }
  596|       |
  597|   117M|                ctxt_idx = sig_ctxinc + sig_coeff_base_ctxt;
  598|   117M|                TRACE_CABAC_CTXT("significant_coeff_flag", ps_cabac->u4_range, ctxt_idx);
  599|   469M|                IHEVCD_CABAC_DECODE_BIN(significant_coeff_flag, ps_cabac,
  ------------------
  |  |   59|   117M|#define IHEVCD_CABAC_DECODE_BIN(u4_bin, ps_cabac, ps_bitstrm, ctxt_index)       \
  |  |   60|   117M|{                                                                               \
  |  |   61|   117M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |   62|   117M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |   63|   117M|    UWORD32 u4_rlps;                                                            \
  |  |   64|   117M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];            \
  |  |   65|   117M|    WORD32 state_mps = *pu1_ctxt_model;                                         \
  |  |   66|   117M|    WORD32 clz;                                                                 \
  |  |   67|   117M|    UWORD32 u4_qnt_range;                                                       \
  |  |   68|   117M|                                                                                \
  |  |   69|   117M|    /* Sanity checks */                                                         \
  |  |   70|   117M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|   117M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   71|   117M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|   117M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   72|   117M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));             \
  |  |  ------------------
  |  |  |  |   55|   117M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   73|   117M|    ASSERT(state_mps < 128);                                                    \
  |  |  ------------------
  |  |  |  |   55|   117M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   74|   117M|    clz = CLZ(u4_range);                                                        \
  |  |   75|   117M|    clz -= (32 - RANGE_NUMBITS);                                                \
  |  |  ------------------
  |  |  |  |   40|   117M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |   76|   117M|    u4_qnt_range = u4_range << clz;                                             \
  |  |   77|   117M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;                   \
  |  |  ------------------
  |  |  |  |   41|   117M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|   117M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|   117M|    /* Get the lps range from LUT based on quantized range and state */         \
  |  |   79|   117M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];              \
  |  |   80|   117M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);                                   \
  |  |  ------------------
  |  |  |  |   41|   117M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|   117M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|   117M|    u4_range -= u4_rlps;                                                        \
  |  |   82|   117M|                                                                                \
  |  |   83|   117M|    u4_bin = state_mps & 1;                                                     \
  |  |   84|   117M|                                                                                \
  |  |   85|   117M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (85:8): [True: 9.01M, False: 108M]
  |  |  ------------------
  |  |   86|   117M|    {                                                                           \
  |  |   87|  9.01M|        u4_bin = 1 - u4_bin;                                                    \
  |  |   88|  9.01M|        u4_ofst -= u4_range;                                                    \
  |  |   89|  9.01M|        u4_range = u4_rlps;                                                     \
  |  |   90|  9.01M|    }                                                                           \
  |  |   91|   117M|                                                                                \
  |  |   92|   117M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];         \
  |  |   93|   117M|                                                                                \
  |  |   94|   117M|    /*****************************************************************/         \
  |  |   95|   117M|    /* Re-normalization; calculate bits generated based on range(R)  */         \
  |  |   96|   117M|    /*****************************************************************/         \
  |  |   97|   117M|    if(u4_range < (1 << 8))                                                     \
  |  |  ------------------
  |  |  |  Branch (97:8): [True: 1.24M, False: 116M]
  |  |  ------------------
  |  |   98|   117M|    {                                                                           \
  |  |   99|  1.24M|        UWORD32 u4_bits;                                                        \
  |  |  100|  1.24M|        WORD32 numbits;                                                         \
  |  |  101|  1.24M|        numbits = CLZ(u4_range);                                                \
  |  |  102|  1.24M|        numbits -= (32 - RANGE_NUMBITS);                                        \
  |  |  ------------------
  |  |  |  |   40|  1.24M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |  103|  1.24M|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  1.24M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  1.24M|{                                                               \
  |  |  |  |  152|  1.24M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  1.24M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.24M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  1.24M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  1.24M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.48M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 886k, False: 355k]
  |  |  |  |  ------------------
  |  |  |  |  156|  1.24M|    {                                                           \
  |  |  |  |  157|   886k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   886k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 886k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   886k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   886k|    }                                                           \
  |  |  |  |  160|  1.24M|                                                                \
  |  |  |  |  161|  1.24M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.48M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 924k, False: 317k]
  |  |  |  |  ------------------
  |  |  |  |  162|  1.24M|    {                                                           \
  |  |  |  |  163|   924k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   924k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   924k|        /* Getting the next word */                             \
  |  |  |  |  166|   924k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   924k|                                                                \
  |  |  |  |  168|   924k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   924k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   924k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   924k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   924k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   924k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   924k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   924k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   924k|    }                                                           \
  |  |  |  |  172|  1.24M|}
  |  |  ------------------
  |  |  104|  1.24M|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);    \
  |  |  105|  1.24M|                                                                                \
  |  |  106|  1.24M|        u4_ofst <<= numbits;                                                    \
  |  |  107|  1.24M|        u4_ofst |= u4_bits;                                                     \
  |  |  108|  1.24M|        u4_range <<= numbits;                                                   \
  |  |  109|  1.24M|                                                                                \
  |  |  110|  1.24M|    }                                                                           \
  |  |  111|   117M|    /* Update the cabac context */                                              \
  |  |  112|   117M|    ps_cabac->u4_range = u4_range;                                              \
  |  |  113|   117M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  114|   117M|                                                                                \
  |  |  115|   117M|}
  ------------------
  600|   469M|                                        ps_bitstrm,
  601|   469M|                                        ctxt_idx);
  602|   469M|                AEV_TRACE("significant_coeff_flag", significant_coeff_flag, ps_cabac->u4_range);
  603|       |
  604|       |
  605|       |                /* If at least one non-zero coeff is signalled then do not infer sig coeff map */
  606|       |                /* for (0,0) coeff in the current sub block */
  607|   469M|                if(significant_coeff_flag)
  ------------------
  |  Branch (607:20): [True: 26.7M, False: 90.6M]
  ------------------
  608|  26.7M|                    infer_sig_coeff_flag = 0;
  609|       |
  610|       |//                u4_sig_coeff_map_raster |= significant_coeff_flag
  611|       |//                              << coeff_pos;
  612|   469M|                u4_sig_coeff_map |= significant_coeff_flag << n;
  613|   469M|                num_coeff += significant_coeff_flag;
  614|   469M|            }
  615|       |
  616|       |
  617|   119M|        }
  618|       |        /*********************************************************************/
  619|       |        /* If infer_sig_coeff_flag is 1 then treat the 0th coeff as non zero */
  620|       |        /* If infer_sig_coeff_flag is zero, then last significant_coeff_flag */
  621|       |        /* is parsed in the above loop                                       */
  622|       |        /*********************************************************************/
  623|  14.1M|        if(infer_sig_coeff_flag)
  ------------------
  |  Branch (623:12): [True: 2.13M, False: 12.0M]
  ------------------
  624|  2.13M|        {
  625|  2.13M|            u4_sig_coeff_map_raster |= 1;
  626|  2.13M|            u4_sig_coeff_map |= 1;
  627|  2.13M|            num_coeff++;
  628|  2.13M|        }
  629|       |
  630|       |        /*********************************************************************/
  631|       |        /* First subblock does not get an explicit csbf. It is assumed to    */
  632|       |        /* be 1. For this subblock there is chance of getting all            */
  633|       |        /* sig_coeff_flags to be zero. In such a case proceed to the next    */
  634|       |        /* subblock(which is end of parsing for the current transform block) */
  635|       |        /*********************************************************************/
  636|       |
  637|  14.1M|        if(0 == num_coeff)
  ------------------
  |  Branch (637:12): [True: 783k, False: 13.3M]
  ------------------
  638|   783k|            continue;
  639|       |
  640|       |        /* Increment number of coded subblocks for the current TU */
  641|  13.3M|        num_subblks++;
  642|       |
  643|       |        /* Set sig coeff map and subblock position */
  644|  13.3M|        ps_tu_sblk_coeff_data = (tu_sblk_coeff_data_t *)ps_codec->s_parse.pv_tu_coeff_data;
  645|  13.3M|        ps_tu_sblk_coeff_data->u2_sig_coeff_map = u4_sig_coeff_map;
  646|  13.3M|        ps_tu_sblk_coeff_data->u2_subblk_pos = (ys << 8) | xs;
  647|       |
  648|  13.3M|        first_sig_scan_pos = 16;
  649|  13.3M|        last_sig_scan_pos = -1;
  650|  13.3M|        num_greater1_flag = 0;
  651|  13.3M|        first_greater1_scan_pos = -1;
  652|  13.3M|        u4_coeff_abs_level_greater1_map = 0;
  653|       |
  654|       |
  655|       |        /* context set based on luma subblock pos */
  656|  13.3M|        ctxt_set = (i && (!c_idx)) ? 2 : 0;
  ------------------
  |  Branch (656:21): [True: 6.34M, False: 7.04M]
  |  Branch (656:26): [True: 5.47M, False: 870k]
  ------------------
  657|       |
  658|       |        /* See section 9.3.3.1.5           */
  659|  13.3M|        ctxt_set += (0 == gt1_ctxt) ? 1 : 0;
  ------------------
  |  Branch (659:21): [True: 1.19M, False: 12.1M]
  ------------------
  660|       |
  661|  13.3M|        gt1_ctxt = 1;
  662|       |        /* Instead of initializing n to 15, set it to 31-CLZ(sig coeff map) */
  663|  13.3M|        {
  664|  13.3M|            UWORD32 u4_sig_coeff_map_shift;
  665|  13.3M|            UWORD32 clz;
  666|  13.3M|            clz = CLZ(u4_sig_coeff_map);
  667|  13.3M|            n = 31 - clz;
  668|  13.3M|            u4_sig_coeff_map_shift = u4_sig_coeff_map << clz;
  669|       |            /* For loop for n changed to do while to break early if sig_coeff_map_shift becomes zero */
  670|  13.3M|            do
  671|  33.8M|            {
  672|       |                //WORD32 coeff_pos;
  673|  33.8M|                WORD32 ctxt_idx;
  674|       |
  675|       |                //TODO: Scan lookup will be removed later and instead u4_sig_coeff_map will be used
  676|       |                //coeff_pos = pu1_scan_coeff[n];
  677|       |
  678|  33.8M|                if((u4_sig_coeff_map_shift >> 31) & 1)
  ------------------
  |  Branch (678:20): [True: 33.8M, False: 0]
  ------------------
  679|  33.8M|                {
  680|       |
  681|       |                    /* abs_level_greater1_flag is sent for only first 8 non-zero levels in a subblock */
  682|  33.8M|                    if(num_greater1_flag < 8)
  ------------------
  |  Branch (682:24): [True: 32.8M, False: 996k]
  ------------------
  683|  32.8M|                    {
  684|  32.8M|                        WORD32 coeff_abs_level_greater1_flag;
  685|       |
  686|  32.8M|                        ctxt_idx = (ctxt_set * 4) + abs_gt1_base_ctxt + gt1_ctxt;
  687|       |
  688|  32.8M|                        TRACE_CABAC_CTXT("coeff_abs_level_greater1_flag", ps_cabac->u4_range, ctxt_idx);
  689|   131M|                        IHEVCD_CABAC_DECODE_BIN(coeff_abs_level_greater1_flag, ps_cabac, ps_bitstrm, ctxt_idx);
  ------------------
  |  |   59|  32.8M|#define IHEVCD_CABAC_DECODE_BIN(u4_bin, ps_cabac, ps_bitstrm, ctxt_index)       \
  |  |   60|  32.8M|{                                                                               \
  |  |   61|  32.8M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |   62|  32.8M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |   63|  32.8M|    UWORD32 u4_rlps;                                                            \
  |  |   64|  32.8M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];            \
  |  |   65|  32.8M|    WORD32 state_mps = *pu1_ctxt_model;                                         \
  |  |   66|  32.8M|    WORD32 clz;                                                                 \
  |  |   67|  32.8M|    UWORD32 u4_qnt_range;                                                       \
  |  |   68|  32.8M|                                                                                \
  |  |   69|  32.8M|    /* Sanity checks */                                                         \
  |  |   70|  32.8M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  32.8M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   71|  32.8M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  32.8M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   72|  32.8M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));             \
  |  |  ------------------
  |  |  |  |   55|  32.8M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   73|  32.8M|    ASSERT(state_mps < 128);                                                    \
  |  |  ------------------
  |  |  |  |   55|  32.8M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   74|  32.8M|    clz = CLZ(u4_range);                                                        \
  |  |   75|  32.8M|    clz -= (32 - RANGE_NUMBITS);                                                \
  |  |  ------------------
  |  |  |  |   40|  32.8M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |   76|  32.8M|    u4_qnt_range = u4_range << clz;                                             \
  |  |   77|  32.8M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;                   \
  |  |  ------------------
  |  |  |  |   41|  32.8M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  32.8M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|  32.8M|    /* Get the lps range from LUT based on quantized range and state */         \
  |  |   79|  32.8M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];              \
  |  |   80|  32.8M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);                                   \
  |  |  ------------------
  |  |  |  |   41|  32.8M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  32.8M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  32.8M|    u4_range -= u4_rlps;                                                        \
  |  |   82|  32.8M|                                                                                \
  |  |   83|  32.8M|    u4_bin = state_mps & 1;                                                     \
  |  |   84|  32.8M|                                                                                \
  |  |   85|  32.8M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (85:8): [True: 3.50M, False: 29.3M]
  |  |  ------------------
  |  |   86|  32.8M|    {                                                                           \
  |  |   87|  3.50M|        u4_bin = 1 - u4_bin;                                                    \
  |  |   88|  3.50M|        u4_ofst -= u4_range;                                                    \
  |  |   89|  3.50M|        u4_range = u4_rlps;                                                     \
  |  |   90|  3.50M|    }                                                                           \
  |  |   91|  32.8M|                                                                                \
  |  |   92|  32.8M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];         \
  |  |   93|  32.8M|                                                                                \
  |  |   94|  32.8M|    /*****************************************************************/         \
  |  |   95|  32.8M|    /* Re-normalization; calculate bits generated based on range(R)  */         \
  |  |   96|  32.8M|    /*****************************************************************/         \
  |  |   97|  32.8M|    if(u4_range < (1 << 8))                                                     \
  |  |  ------------------
  |  |  |  Branch (97:8): [True: 494k, False: 32.3M]
  |  |  ------------------
  |  |   98|  32.8M|    {                                                                           \
  |  |   99|   494k|        UWORD32 u4_bits;                                                        \
  |  |  100|   494k|        WORD32 numbits;                                                         \
  |  |  101|   494k|        numbits = CLZ(u4_range);                                                \
  |  |  102|   494k|        numbits -= (32 - RANGE_NUMBITS);                                        \
  |  |  ------------------
  |  |  |  |   40|   494k|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |  103|   494k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|   494k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|   494k|{                                                               \
  |  |  |  |  152|   494k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|   494k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   494k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|   494k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|   494k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   989k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 349k, False: 145k]
  |  |  |  |  ------------------
  |  |  |  |  156|   494k|    {                                                           \
  |  |  |  |  157|   349k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   349k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 349k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   349k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   349k|    }                                                           \
  |  |  |  |  160|   494k|                                                                \
  |  |  |  |  161|   494k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   989k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 364k, False: 129k]
  |  |  |  |  ------------------
  |  |  |  |  162|   494k|    {                                                           \
  |  |  |  |  163|   364k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   364k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   364k|        /* Getting the next word */                             \
  |  |  |  |  166|   364k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   364k|                                                                \
  |  |  |  |  168|   364k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   364k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   364k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   364k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   364k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   364k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   364k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   364k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   364k|    }                                                           \
  |  |  |  |  172|   494k|}
  |  |  ------------------
  |  |  104|   494k|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);    \
  |  |  105|   494k|                                                                                \
  |  |  106|   494k|        u4_ofst <<= numbits;                                                    \
  |  |  107|   494k|        u4_ofst |= u4_bits;                                                     \
  |  |  108|   494k|        u4_range <<= numbits;                                                   \
  |  |  109|   494k|                                                                                \
  |  |  110|   494k|    }                                                                           \
  |  |  111|  32.8M|    /* Update the cabac context */                                              \
  |  |  112|  32.8M|    ps_cabac->u4_range = u4_range;                                              \
  |  |  113|  32.8M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  114|  32.8M|                                                                                \
  |  |  115|  32.8M|}
  ------------------
  690|   131M|                        AEV_TRACE("coeff_abs_level_greater1_flag", coeff_abs_level_greater1_flag, ps_cabac->u4_range);
  691|       |
  692|   131M|                        u4_coeff_abs_level_greater1_map |= coeff_abs_level_greater1_flag << n;
  693|   131M|                        num_greater1_flag++;
  694|       |
  695|       |                        /* first_greater1_scan_pos is obtained using CLZ on u4_coeff_abs_level_greater1_map*/
  696|       |                        /*  outside the loop instead of the following check inside the loop                */
  697|       |                        /* if( coeff_abs_level_greater1_flag && first_greater1_scan_pos == -1) */
  698|       |                        /*    first_greater1_scan_pos = n;                                     */
  699|       |
  700|   131M|                        if(coeff_abs_level_greater1_flag)
  ------------------
  |  Branch (700:28): [True: 7.45M, False: 25.3M]
  ------------------
  701|  7.45M|                        {
  702|  7.45M|                            gt1_ctxt = 0;
  703|  7.45M|                        }
  704|  25.3M|                        else if(gt1_ctxt && (gt1_ctxt < 3))
  ------------------
  |  Branch (704:33): [True: 20.8M, False: 4.54M]
  |  Branch (704:45): [True: 15.0M, False: 5.79M]
  ------------------
  705|  15.0M|                        {
  706|  15.0M|                            gt1_ctxt++;
  707|  15.0M|                        }
  708|       |
  709|   131M|                    }
  710|   996k|                    else
  711|   996k|                        break;
  712|       |
  713|       |                    /* instead of computing last and first significan scan position using checks below */
  714|       |                    /* They are computed outside the loop using CLZ and CTZ on sig_coeff_map */
  715|       |                    /* if(last_sig_scan_pos == -1)                          */
  716|       |                    /*    last_sig_scan_pos = n;                            */
  717|       |                    /*  first_sig_scan_pos = n;                             */
  718|  33.8M|                }
  719|  32.8M|                u4_sig_coeff_map_shift <<= 1;
  720|  32.8M|                n--;
  721|       |                /* If there are zero coeffs, then shift by as many zero coeffs and decrement n */
  722|  32.8M|                clz = CLZ(u4_sig_coeff_map_shift);
  723|  32.8M|                u4_sig_coeff_map_shift <<= clz;
  724|  32.8M|                n -= (WORD32)clz;
  725|  32.8M|            }while(u4_sig_coeff_map_shift);
  ------------------
  |  Branch (725:20): [True: 20.4M, False: 12.4M]
  ------------------
  726|  13.3M|        }
  727|       |        /* At this level u4_sig_coeff_map is non-zero i.e. has atleast one non-zero coeff */
  728|  13.3M|        last_sig_scan_pos = (31 - CLZ(u4_sig_coeff_map));
  729|  13.3M|        first_sig_scan_pos = CTZ(u4_sig_coeff_map);
  730|  13.3M|        sign_hidden = (((last_sig_scan_pos - first_sig_scan_pos) > 3) && !ps_codec->s_parse.s_cu.i4_cu_transquant_bypass);
  ------------------
  |  Branch (730:24): [True: 3.89M, False: 9.50M]
  |  Branch (730:74): [True: 3.86M, False: 24.9k]
  ------------------
  731|       |
  732|  13.3M|        u4_coeff_abs_level_greater2_map = 0;
  733|       |
  734|  13.3M|        if(u4_coeff_abs_level_greater1_map)
  ------------------
  |  Branch (734:12): [True: 3.93M, False: 9.46M]
  ------------------
  735|  3.93M|        {
  736|       |            /* Check if the first level > 1 is greater than 2 */
  737|  3.93M|            WORD32 ctxt_idx;
  738|  3.93M|            first_greater1_scan_pos = (31 - CLZ(u4_coeff_abs_level_greater1_map));
  739|       |
  740|       |
  741|  3.93M|            ctxt_idx = IHEVC_CAB_COEFABS_GRTR2_FLAG;
  742|       |
  743|  3.93M|            ctxt_idx += (!c_idx) ? ctxt_set : (ctxt_set + 4);
  ------------------
  |  Branch (743:25): [True: 2.53M, False: 1.40M]
  ------------------
  744|  3.93M|            TRACE_CABAC_CTXT("coeff_abs_level_greater2_flag", ps_cabac->u4_range, ctxt_idx);
  745|  15.7M|            IHEVCD_CABAC_DECODE_BIN(coeff_abs_level_greater2_flag, ps_cabac, ps_bitstrm, ctxt_idx);
  ------------------
  |  |   59|  3.93M|#define IHEVCD_CABAC_DECODE_BIN(u4_bin, ps_cabac, ps_bitstrm, ctxt_index)       \
  |  |   60|  3.93M|{                                                                               \
  |  |   61|  3.93M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |   62|  3.93M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |   63|  3.93M|    UWORD32 u4_rlps;                                                            \
  |  |   64|  3.93M|    UWORD8 *pu1_ctxt_model = &ps_cabac->au1_ctxt_models[ctxt_index];            \
  |  |   65|  3.93M|    WORD32 state_mps = *pu1_ctxt_model;                                         \
  |  |   66|  3.93M|    WORD32 clz;                                                                 \
  |  |   67|  3.93M|    UWORD32 u4_qnt_range;                                                       \
  |  |   68|  3.93M|                                                                                \
  |  |   69|  3.93M|    /* Sanity checks */                                                         \
  |  |   70|  3.93M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  3.93M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   71|  3.93M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  3.93M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   72|  3.93M|    ASSERT((ctxt_index >= 0) && (ctxt_index < IHEVC_CAB_CTXT_END));             \
  |  |  ------------------
  |  |  |  |   55|  3.93M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   73|  3.93M|    ASSERT(state_mps < 128);                                                    \
  |  |  ------------------
  |  |  |  |   55|  3.93M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |   74|  3.93M|    clz = CLZ(u4_range);                                                        \
  |  |   75|  3.93M|    clz -= (32 - RANGE_NUMBITS);                                                \
  |  |  ------------------
  |  |  |  |   40|  3.93M|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |   76|  3.93M|    u4_qnt_range = u4_range << clz;                                             \
  |  |   77|  3.93M|    u4_qnt_range = (u4_qnt_range >> (RANGE_SHIFT + 6)) & 0x3;                   \
  |  |  ------------------
  |  |  |  |   41|  3.93M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  3.93M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   78|  3.93M|    /* Get the lps range from LUT based on quantized range and state */         \
  |  |   79|  3.93M|    u4_rlps = gau1_ihevc_cabac_rlps[state_mps >> 1][u4_qnt_range];              \
  |  |   80|  3.93M|    u4_rlps = u4_rlps << (RANGE_SHIFT - clz);                                   \
  |  |  ------------------
  |  |  |  |   41|  3.93M|#define RANGE_SHIFT  (RANGE_NUMBITS - 9)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  3.93M|#define RANGE_NUMBITS 31
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   81|  3.93M|    u4_range -= u4_rlps;                                                        \
  |  |   82|  3.93M|                                                                                \
  |  |   83|  3.93M|    u4_bin = state_mps & 1;                                                     \
  |  |   84|  3.93M|                                                                                \
  |  |   85|  3.93M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (85:8): [True: 586k, False: 3.34M]
  |  |  ------------------
  |  |   86|  3.93M|    {                                                                           \
  |  |   87|   586k|        u4_bin = 1 - u4_bin;                                                    \
  |  |   88|   586k|        u4_ofst -= u4_range;                                                    \
  |  |   89|   586k|        u4_range = u4_rlps;                                                     \
  |  |   90|   586k|    }                                                                           \
  |  |   91|  3.93M|                                                                                \
  |  |   92|  3.93M|    *pu1_ctxt_model = gau1_ihevc_next_state[(state_mps << 1) | u4_bin];         \
  |  |   93|  3.93M|                                                                                \
  |  |   94|  3.93M|    /*****************************************************************/         \
  |  |   95|  3.93M|    /* Re-normalization; calculate bits generated based on range(R)  */         \
  |  |   96|  3.93M|    /*****************************************************************/         \
  |  |   97|  3.93M|    if(u4_range < (1 << 8))                                                     \
  |  |  ------------------
  |  |  |  Branch (97:8): [True: 83.4k, False: 3.85M]
  |  |  ------------------
  |  |   98|  3.93M|    {                                                                           \
  |  |   99|  83.4k|        UWORD32 u4_bits;                                                        \
  |  |  100|  83.4k|        WORD32 numbits;                                                         \
  |  |  101|  83.4k|        numbits = CLZ(u4_range);                                                \
  |  |  102|  83.4k|        numbits -= (32 - RANGE_NUMBITS);                                        \
  |  |  ------------------
  |  |  |  |   40|  83.4k|#define RANGE_NUMBITS 31
  |  |  ------------------
  |  |  103|  83.4k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  83.4k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  83.4k|{                                                               \
  |  |  |  |  152|  83.4k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  83.4k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  83.4k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  83.4k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  83.4k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   166k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 57.7k, False: 25.7k]
  |  |  |  |  ------------------
  |  |  |  |  156|  83.4k|    {                                                           \
  |  |  |  |  157|  57.7k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  57.7k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 57.7k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|  57.7k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|  57.7k|    }                                                           \
  |  |  |  |  160|  83.4k|                                                                \
  |  |  |  |  161|  83.4k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   166k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 63.4k, False: 20.0k]
  |  |  |  |  ------------------
  |  |  |  |  162|  83.4k|    {                                                           \
  |  |  |  |  163|  63.4k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|  63.4k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|  63.4k|        /* Getting the next word */                             \
  |  |  |  |  166|  63.4k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|  63.4k|                                                                \
  |  |  |  |  168|  63.4k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  63.4k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|  63.4k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|  63.4k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  63.4k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  63.4k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  63.4k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  63.4k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|  63.4k|    }                                                           \
  |  |  |  |  172|  83.4k|}
  |  |  ------------------
  |  |  104|  83.4k|                 ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbits);    \
  |  |  105|  83.4k|                                                                                \
  |  |  106|  83.4k|        u4_ofst <<= numbits;                                                    \
  |  |  107|  83.4k|        u4_ofst |= u4_bits;                                                     \
  |  |  108|  83.4k|        u4_range <<= numbits;                                                   \
  |  |  109|  83.4k|                                                                                \
  |  |  110|  83.4k|    }                                                                           \
  |  |  111|  3.93M|    /* Update the cabac context */                                              \
  |  |  112|  3.93M|    ps_cabac->u4_range = u4_range;                                              \
  |  |  113|  3.93M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  114|  3.93M|                                                                                \
  |  |  115|  3.93M|}
  ------------------
  746|  15.7M|            AEV_TRACE("coeff_abs_level_greater2_flag", coeff_abs_level_greater2_flag, ps_cabac->u4_range);
  747|  15.7M|            u4_coeff_abs_level_greater2_map = coeff_abs_level_greater2_flag << first_greater1_scan_pos;
  748|  15.7M|        }
  749|       |
  750|       |
  751|  13.3M|        u4_coeff_sign_map = 0;
  752|       |
  753|       |        /* Parse sign flags */
  754|  13.3M|        if(!sign_data_hiding_flag || !sign_hidden)
  ------------------
  |  Branch (754:12): [True: 10.9M, False: 2.42M]
  |  Branch (754:38): [True: 1.22M, False: 1.20M]
  ------------------
  755|  12.1M|        {
  756|  48.7M|            IHEVCD_CABAC_DECODE_BYPASS_BINS(value, ps_cabac, ps_bitstrm, num_coeff);
  ------------------
  |  |  156|  12.1M|#define IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_bins, ps_cabac, ps_bitstrm, numbins) \
  |  |  157|  12.1M|{                                                                               \
  |  |  158|  12.1M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  159|  12.1M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  160|  12.1M|    UWORD32 u4_bits;                                                            \
  |  |  161|  12.1M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  12.1M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  162|  12.1M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  12.1M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  163|  12.1M|    ASSERT(numbins > 0);                                                        \
  |  |  ------------------
  |  |  |  |   55|  12.1M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  164|  12.1M|    {                                                                           \
  |  |  165|  12.1M|        WORD32 numbins_tmp = numbins;                                           \
  |  |  166|  12.1M|        /* Sanity checks */                                                     \
  |  |  167|  12.1M|        ASSERT(numbins < 17);                                                   \
  |  |  ------------------
  |  |  |  |   55|  12.1M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  168|  12.1M|                                                                                \
  |  |  169|  12.1M|        u4_bins = 0;                                                            \
  |  |  170|  12.1M|                                                                                \
  |  |  171|  12.1M|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  12.1M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  12.1M|{                                                               \
  |  |  |  |  152|  12.1M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  12.1M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  12.1M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  12.1M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  12.1M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  24.3M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 502k, False: 11.6M]
  |  |  |  |  ------------------
  |  |  |  |  156|  12.1M|    {                                                           \
  |  |  |  |  157|   502k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   502k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 502k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   502k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   502k|    }                                                           \
  |  |  |  |  160|  12.1M|                                                                \
  |  |  |  |  161|  12.1M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  24.3M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 884k, False: 11.3M]
  |  |  |  |  ------------------
  |  |  |  |  162|  12.1M|    {                                                           \
  |  |  |  |  163|   884k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   884k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   884k|        /* Getting the next word */                             \
  |  |  |  |  166|   884k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   884k|                                                                \
  |  |  |  |  168|   884k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   884k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   884k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   884k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   884k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   884k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   884k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   884k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   884k|    }                                                           \
  |  |  |  |  172|  12.1M|}
  |  |  ------------------
  |  |  172|  12.1M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins); \
  |  |  173|  12.1M|        do                                                                      \
  |  |  174|  28.5M|        {                                                                       \
  |  |  175|  28.5M|            UWORD32 u4_bit;                                                     \
  |  |  176|  28.5M|            numbins_tmp--;                                                      \
  |  |  177|  28.5M|            u4_bit = (u4_bits >> numbins_tmp) & 1;                              \
  |  |  178|  28.5M|            u4_ofst <<= 1;                                                      \
  |  |  179|  28.5M|            u4_ofst |= u4_bit;                                                  \
  |  |  180|  28.5M|                                                                                \
  |  |  181|  28.5M|            u4_bins <<= 1;                                                      \
  |  |  182|  28.5M|            if(u4_ofst >= u4_range)                                             \
  |  |  ------------------
  |  |  |  Branch (182:16): [True: 8.79M, False: 19.7M]
  |  |  ------------------
  |  |  183|  28.5M|            {                                                                   \
  |  |  184|  8.79M|                u4_bins += 1;                                                   \
  |  |  185|  8.79M|                u4_ofst -= u4_range;                                            \
  |  |  186|  8.79M|            }                                                                   \
  |  |  187|  28.5M|        }while(numbins_tmp);                                                    \
  |  |  ------------------
  |  |  |  Branch (187:16): [True: 16.3M, False: 12.1M]
  |  |  ------------------
  |  |  188|  12.1M|                                                                                \
  |  |  189|  12.1M|        /* Update the cabac context */                                          \
  |  |  190|  12.1M|        ps_cabac->u4_ofst = u4_ofst;                                            \
  |  |  191|  12.1M|    }                                                                           \
  |  |  192|  12.1M|}
  ------------------
  757|  48.7M|            AEV_TRACE("sign_flags", value, ps_cabac->u4_range);
  758|  48.7M|            u4_coeff_sign_map = value << (32 - num_coeff);
  759|  48.7M|        }
  760|  1.20M|        else
  761|  1.20M|        {
  762|  4.81M|            IHEVCD_CABAC_DECODE_BYPASS_BINS(value, ps_cabac, ps_bitstrm, (num_coeff - 1));
  ------------------
  |  |  156|  1.20M|#define IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_bins, ps_cabac, ps_bitstrm, numbins) \
  |  |  157|  1.20M|{                                                                               \
  |  |  158|  1.20M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  159|  1.20M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  160|  1.20M|    UWORD32 u4_bits;                                                            \
  |  |  161|  1.20M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  1.20M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  162|  1.20M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  1.20M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  163|  1.20M|    ASSERT(numbins > 0);                                                        \
  |  |  ------------------
  |  |  |  |   55|  1.20M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  164|  1.20M|    {                                                                           \
  |  |  165|  1.20M|        WORD32 numbins_tmp = numbins;                                           \
  |  |  166|  1.20M|        /* Sanity checks */                                                     \
  |  |  167|  1.20M|        ASSERT(numbins < 17);                                                   \
  |  |  ------------------
  |  |  |  |   55|  1.20M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  168|  1.20M|                                                                                \
  |  |  169|  1.20M|        u4_bins = 0;                                                            \
  |  |  170|  1.20M|                                                                                \
  |  |  171|  1.20M|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  1.20M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  1.20M|{                                                               \
  |  |  |  |  152|  1.20M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  1.20M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.20M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  1.20M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  1.20M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.40M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 181k, False: 1.02M]
  |  |  |  |  ------------------
  |  |  |  |  156|  1.20M|    {                                                           \
  |  |  |  |  157|   181k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|   181k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 181k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|   181k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|   181k|    }                                                           \
  |  |  |  |  160|  1.20M|                                                                \
  |  |  |  |  161|  1.20M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.40M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 223k, False: 979k]
  |  |  |  |  ------------------
  |  |  |  |  162|  1.20M|    {                                                           \
  |  |  |  |  163|   223k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|   223k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|   223k|        /* Getting the next word */                             \
  |  |  |  |  166|   223k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|   223k|                                                                \
  |  |  |  |  168|   223k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   223k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|   223k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|   223k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   223k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   223k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   223k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   223k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|   223k|    }                                                           \
  |  |  |  |  172|  1.20M|}
  |  |  ------------------
  |  |  172|  1.20M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins); \
  |  |  173|  1.20M|        do                                                                      \
  |  |  174|  6.99M|        {                                                                       \
  |  |  175|  6.99M|            UWORD32 u4_bit;                                                     \
  |  |  176|  6.99M|            numbins_tmp--;                                                      \
  |  |  177|  6.99M|            u4_bit = (u4_bits >> numbins_tmp) & 1;                              \
  |  |  178|  6.99M|            u4_ofst <<= 1;                                                      \
  |  |  179|  6.99M|            u4_ofst |= u4_bit;                                                  \
  |  |  180|  6.99M|                                                                                \
  |  |  181|  6.99M|            u4_bins <<= 1;                                                      \
  |  |  182|  6.99M|            if(u4_ofst >= u4_range)                                             \
  |  |  ------------------
  |  |  |  Branch (182:16): [True: 3.25M, False: 3.73M]
  |  |  ------------------
  |  |  183|  6.99M|            {                                                                   \
  |  |  184|  3.25M|                u4_bins += 1;                                                   \
  |  |  185|  3.25M|                u4_ofst -= u4_range;                                            \
  |  |  186|  3.25M|            }                                                                   \
  |  |  187|  6.99M|        }while(numbins_tmp);                                                    \
  |  |  ------------------
  |  |  |  Branch (187:16): [True: 5.79M, False: 1.20M]
  |  |  ------------------
  |  |  188|  1.20M|                                                                                \
  |  |  189|  1.20M|        /* Update the cabac context */                                          \
  |  |  190|  1.20M|        ps_cabac->u4_ofst = u4_ofst;                                            \
  |  |  191|  1.20M|    }                                                                           \
  |  |  192|  1.20M|}
  ------------------
  763|  4.81M|            AEV_TRACE("sign_flags", value, ps_cabac->u4_range);
  764|  4.81M|            u4_coeff_sign_map = value << (32 - (num_coeff - 1));
  765|  4.81M|        }
  766|       |
  767|  13.3M|        num_sig_coeff = 0;
  768|  13.3M|        sum_abs_level = 0;
  769|  13.3M|        rice_param = 0;
  770|  13.3M|        {
  771|  13.3M|            UWORD32 clz;
  772|  13.3M|            UWORD32 u4_sig_coeff_map_shift;
  773|  13.3M|            clz = CLZ(u4_sig_coeff_map);
  774|  13.3M|            n = 31 - clz;
  775|  13.3M|            u4_sig_coeff_map_shift = u4_sig_coeff_map << clz;
  776|       |            /* For loop for n changed to do while to break early if sig_coeff_map_shift becomes zero */
  777|  13.3M|            do
  778|  36.7M|            {
  779|       |
  780|  36.7M|                if((u4_sig_coeff_map_shift >> 31) & 1)
  ------------------
  |  Branch (780:20): [True: 36.7M, False: 0]
  ------------------
  781|  36.7M|                {
  782|  36.7M|                    WORD32 base_lvl;
  783|  36.7M|                    WORD32 coeff_abs_level_remaining;
  784|  36.7M|                    WORD32 level;
  785|  36.7M|                    base_lvl = 1;
  786|       |
  787|       |                    /* Update base_lvl if it is greater than 1 */
  788|  36.7M|                    if((u4_coeff_abs_level_greater1_map >> n) & 1)
  ------------------
  |  Branch (788:24): [True: 7.45M, False: 29.2M]
  ------------------
  789|  7.45M|                        base_lvl++;
  790|       |
  791|       |                    /* Update base_lvl if it is greater than 2 */
  792|  36.7M|                    if((u4_coeff_abs_level_greater2_map >> n) & 1)
  ------------------
  |  Branch (792:24): [True: 886k, False: 35.8M]
  ------------------
  793|   886k|                        base_lvl++;
  794|       |
  795|       |                    /* If level is greater than 3/2/1 based on the greater1 and greater2 maps,
  796|       |                     * decode remaining level (level - base_lvl) will be signalled as bypass bins
  797|       |                     */
  798|  36.7M|                    coeff_abs_level_remaining = 0;
  799|  36.7M|                    if(base_lvl == ((num_sig_coeff < 8) ? ((n == first_greater1_scan_pos) ? 3 : 2) : 1))
  ------------------
  |  Branch (799:24): [True: 8.30M, False: 28.4M]
  |  Branch (799:37): [True: 32.8M, False: 3.89M]
  |  Branch (799:60): [True: 3.93M, False: 28.8M]
  ------------------
  800|  8.30M|                    {
  801|  8.30M|                        UWORD32 u4_prefix;
  802|  8.30M|                        WORD32 bin;
  803|       |
  804|  8.30M|                        u4_prefix = 0;
  805|       |
  806|  8.30M|                        do
  807|  14.9M|                        {
  808|  29.8M|                            IHEVCD_CABAC_DECODE_BYPASS_BIN(bin, ps_cabac, ps_bitstrm);
  ------------------
  |  |  122|  14.9M|#define IHEVCD_CABAC_DECODE_BYPASS_BIN(u4_bin, ps_cabac, ps_bitstrm)            \
  |  |  123|  14.9M|{                                                                               \
  |  |  124|  14.9M|                                                                                \
  |  |  125|  14.9M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  126|  14.9M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  127|  14.9M|    UWORD32 u4_bits;                                                            \
  |  |  128|  14.9M|                                                                                \
  |  |  129|  14.9M|    /* Sanity checks */                                                         \
  |  |  130|  14.9M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  14.9M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  131|  14.9M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  14.9M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  132|  14.9M|                                                                                \
  |  |  133|  14.9M|    BIT_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,              \
  |  |  ------------------
  |  |  |  |  182|  14.9M|                          m_u4_cur_word,m_u4_nxt_word)          \
  |  |  |  |  183|  14.9M|{                                                               \
  |  |  |  |  184|  14.9M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  185|  14.9M|                             >> (WORD_SIZE_MINUS1);             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|  14.9M|#define WORD_SIZE_MINUS1  (WORD_SIZE - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  14.9M|#define WORD_SIZE         32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  186|  14.9M|    m_u4_bit_ofst++;                                            \
  |  |  |  |  187|  14.9M|                                                                \
  |  |  |  |  188|  14.9M|    if(m_u4_bit_ofst ==  WORD_SIZE)                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  29.8M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (188:8): [True: 462k, False: 14.4M]
  |  |  |  |  ------------------
  |  |  |  |  189|  14.9M|    {                                                           \
  |  |  |  |  190|   462k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  191|   462k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  192|   462k|        /* Getting the next word */                             \
  |  |  |  |  193|   462k|        pu4_word_tmp = *m_pu4_buf++;                            \
  |  |  |  |  194|   462k|                                                                \
  |  |  |  |  195|   462k|        m_u4_bit_ofst = 0;                                      \
  |  |  |  |  196|   462k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  197|   462k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|   462k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|   462k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|   462k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|   462k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  198|   462k|    }                                                           \
  |  |  |  |  199|  14.9M|}
  |  |  ------------------
  |  |  134|  14.9M|            ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word);                  \
  |  |  135|  14.9M|                                                                                \
  |  |  136|  14.9M|    u4_ofst <<= 1;                                                              \
  |  |  137|  14.9M|    u4_ofst |= u4_bits;                                                         \
  |  |  138|  14.9M|                                                                                \
  |  |  139|  14.9M|    u4_bin = 0;                                                                 \
  |  |  140|  14.9M|    if(u4_ofst >= u4_range)                                                     \
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 6.60M, False: 8.30M]
  |  |  ------------------
  |  |  141|  14.9M|    {                                                                           \
  |  |  142|  6.60M|        u4_bin = 1;                                                             \
  |  |  143|  6.60M|        u4_ofst -= u4_range;                                                    \
  |  |  144|  6.60M|    }                                                                           \
  |  |  145|  14.9M|                                                                                \
  |  |  146|  14.9M|    /* Update the cabac context */                                              \
  |  |  147|  14.9M|    ps_cabac->u4_ofst = u4_ofst;                                                \
  |  |  148|  14.9M|}
  ------------------
  809|  29.8M|                            u4_prefix++;
  810|       |
  811|  29.8M|                            if((WORD32)u4_prefix == 19 - rice_param)
  ------------------
  |  Branch (811:32): [True: 4.69k, False: 14.9M]
  ------------------
  812|  4.69k|                            {
  813|  4.69k|                                bin = 1;
  814|  4.69k|                                break;
  815|  4.69k|                            }
  816|       |
  817|  29.8M|                        }while(bin);
  ------------------
  |  Branch (817:32): [True: 6.59M, False: 8.30M]
  ------------------
  818|       |
  819|  8.30M|                        u4_prefix = u4_prefix - 1;
  820|  8.30M|                        if(u4_prefix < 3)
  ------------------
  |  Branch (820:28): [True: 7.50M, False: 806k]
  ------------------
  821|  7.50M|                        {
  822|  7.50M|                            UWORD32 u4_suffix;
  823|       |
  824|  7.50M|                            coeff_abs_level_remaining = (u4_prefix << rice_param);
  825|  7.50M|                            if(rice_param)
  ------------------
  |  Branch (825:32): [True: 2.18M, False: 5.31M]
  ------------------
  826|  2.18M|                            {
  827|  8.73M|                                IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_suffix, ps_cabac, ps_bitstrm, rice_param);
  ------------------
  |  |  156|  2.18M|#define IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_bins, ps_cabac, ps_bitstrm, numbins) \
  |  |  157|  2.18M|{                                                                               \
  |  |  158|  2.18M|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  159|  2.18M|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  160|  2.18M|    UWORD32 u4_bits;                                                            \
  |  |  161|  2.18M|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|  2.18M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  162|  2.18M|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|  2.18M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  163|  2.18M|    ASSERT(numbins > 0);                                                        \
  |  |  ------------------
  |  |  |  |   55|  2.18M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  164|  2.18M|    {                                                                           \
  |  |  165|  2.18M|        WORD32 numbins_tmp = numbins;                                           \
  |  |  166|  2.18M|        /* Sanity checks */                                                     \
  |  |  167|  2.18M|        ASSERT(numbins < 17);                                                   \
  |  |  ------------------
  |  |  |  |   55|  2.18M|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  168|  2.18M|                                                                                \
  |  |  169|  2.18M|        u4_bins = 0;                                                            \
  |  |  170|  2.18M|                                                                                \
  |  |  171|  2.18M|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|  2.18M|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|  2.18M|{                                                               \
  |  |  |  |  152|  2.18M|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|  2.18M|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.18M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|  2.18M|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|  2.18M|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  4.36M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 24.2k, False: 2.15M]
  |  |  |  |  ------------------
  |  |  |  |  156|  2.18M|    {                                                           \
  |  |  |  |  157|  24.2k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  24.2k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 24.2k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|  24.2k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|  24.2k|    }                                                           \
  |  |  |  |  160|  2.18M|                                                                \
  |  |  |  |  161|  2.18M|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  4.36M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 94.5k, False: 2.08M]
  |  |  |  |  ------------------
  |  |  |  |  162|  2.18M|    {                                                           \
  |  |  |  |  163|  94.5k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|  94.5k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|  94.5k|        /* Getting the next word */                             \
  |  |  |  |  166|  94.5k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|  94.5k|                                                                \
  |  |  |  |  168|  94.5k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  94.5k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|  94.5k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|  94.5k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  94.5k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  94.5k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  94.5k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  94.5k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|  94.5k|    }                                                           \
  |  |  |  |  172|  2.18M|}
  |  |  ------------------
  |  |  172|  2.18M|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins); \
  |  |  173|  2.18M|        do                                                                      \
  |  |  174|  2.99M|        {                                                                       \
  |  |  175|  2.99M|            UWORD32 u4_bit;                                                     \
  |  |  176|  2.99M|            numbins_tmp--;                                                      \
  |  |  177|  2.99M|            u4_bit = (u4_bits >> numbins_tmp) & 1;                              \
  |  |  178|  2.99M|            u4_ofst <<= 1;                                                      \
  |  |  179|  2.99M|            u4_ofst |= u4_bit;                                                  \
  |  |  180|  2.99M|                                                                                \
  |  |  181|  2.99M|            u4_bins <<= 1;                                                      \
  |  |  182|  2.99M|            if(u4_ofst >= u4_range)                                             \
  |  |  ------------------
  |  |  |  Branch (182:16): [True: 1.49M, False: 1.50M]
  |  |  ------------------
  |  |  183|  2.99M|            {                                                                   \
  |  |  184|  1.49M|                u4_bins += 1;                                                   \
  |  |  185|  1.49M|                u4_ofst -= u4_range;                                            \
  |  |  186|  1.49M|            }                                                                   \
  |  |  187|  2.99M|        }while(numbins_tmp);                                                    \
  |  |  ------------------
  |  |  |  Branch (187:16): [True: 810k, False: 2.18M]
  |  |  ------------------
  |  |  188|  2.18M|                                                                                \
  |  |  189|  2.18M|        /* Update the cabac context */                                          \
  |  |  190|  2.18M|        ps_cabac->u4_ofst = u4_ofst;                                            \
  |  |  191|  2.18M|    }                                                                           \
  |  |  192|  2.18M|}
  ------------------
  828|       |
  829|  8.73M|                                coeff_abs_level_remaining |= u4_suffix;
  830|  8.73M|                            }
  831|  7.50M|                        }
  832|   806k|                        else
  833|   806k|                        {
  834|   806k|                            UWORD32 u4_suffix;
  835|   806k|                            UWORD32 u4_numbins;
  836|       |
  837|       |                            //u4_prefix = CLIP3(u4_prefix, 0, 19 - rice_param);
  838|       |
  839|   806k|                            u4_numbins = (u4_prefix - 3 + rice_param);
  840|   806k|                            coeff_abs_level_remaining = (((1 << (u4_prefix - 3)) + 3 - 1) << rice_param);
  841|   806k|                            if(u4_numbins)
  ------------------
  |  Branch (841:32): [True: 556k, False: 249k]
  ------------------
  842|   556k|                            {
  843|  2.22M|                                IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_suffix, ps_cabac, ps_bitstrm, u4_numbins);
  ------------------
  |  |  156|   556k|#define IHEVCD_CABAC_DECODE_BYPASS_BINS(u4_bins, ps_cabac, ps_bitstrm, numbins) \
  |  |  157|   556k|{                                                                               \
  |  |  158|   556k|    UWORD32 u4_range = ps_cabac->u4_range;                                      \
  |  |  159|   556k|    UWORD32 u4_ofst = ps_cabac->u4_ofst;                                        \
  |  |  160|   556k|    UWORD32 u4_bits;                                                            \
  |  |  161|   556k|    ASSERT(FULLRANGE == 1);                                                     \
  |  |  ------------------
  |  |  |  |   55|   556k|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  162|   556k|    ASSERT(u4_range >= 256);                                                    \
  |  |  ------------------
  |  |  |  |   55|   556k|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  163|   556k|    ASSERT(numbins > 0);                                                        \
  |  |  ------------------
  |  |  |  |   55|   556k|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  164|   556k|    {                                                                           \
  |  |  165|   556k|        WORD32 numbins_tmp = numbins;                                           \
  |  |  166|   556k|        /* Sanity checks */                                                     \
  |  |  167|   556k|        ASSERT(numbins < 17);                                                   \
  |  |  ------------------
  |  |  |  |   55|   556k|#define ASSERT(x) assert((x))
  |  |  ------------------
  |  |  168|   556k|                                                                                \
  |  |  169|   556k|        u4_bins = 0;                                                            \
  |  |  170|   556k|                                                                                \
  |  |  171|   556k|        BITS_GET(u4_bits, ps_bitstrm->pu4_buf, ps_bitstrm->u4_bit_ofst,         \
  |  |  ------------------
  |  |  |  |  150|   556k|                          m_u4_cur_word,m_u4_nxt_word, m_cnt)   \
  |  |  |  |  151|   556k|{                                                               \
  |  |  |  |  152|   556k|    m_u4_bits = (m_u4_cur_word << m_u4_bit_ofst)                \
  |  |  |  |  153|   556k|                             >> (WORD_SIZE - m_cnt);            \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   556k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  154|   556k|    m_u4_bit_ofst += m_cnt;                                     \
  |  |  |  |  155|   556k|    if(m_u4_bit_ofst > WORD_SIZE)                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.11M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:8): [True: 24.8k, False: 531k]
  |  |  |  |  ------------------
  |  |  |  |  156|   556k|    {                                                           \
  |  |  |  |  157|  24.8k|        m_u4_bits |= SHR(m_u4_nxt_word,                         \
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  24.8k|#define SHR(x,y) (((y) < 32) ? ((x) >> (y)) : 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:19): [True: 24.8k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  158|  24.8k|                     (DBL_WORD_SIZE - m_u4_bit_ofst));          \
  |  |  |  |  159|  24.8k|    }                                                           \
  |  |  |  |  160|   556k|                                                                \
  |  |  |  |  161|   556k|    if( m_u4_bit_ofst >=   WORD_SIZE )                          \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.11M|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (161:9): [True: 40.2k, False: 516k]
  |  |  |  |  ------------------
  |  |  |  |  162|   556k|    {                                                           \
  |  |  |  |  163|  40.2k|        UWORD32 pu4_word_tmp;                                   \
  |  |  |  |  164|  40.2k|        m_u4_cur_word  = m_u4_nxt_word;                         \
  |  |  |  |  165|  40.2k|        /* Getting the next word */                             \
  |  |  |  |  166|  40.2k|        pu4_word_tmp = *(m_pu4_buf++);                          \
  |  |  |  |  167|  40.2k|                                                                \
  |  |  |  |  168|  40.2k|        m_u4_bit_ofst -= WORD_SIZE;                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  40.2k|#define WORD_SIZE         32
  |  |  |  |  ------------------
  |  |  |  |  169|  40.2k|        /* Swapping little endian to big endian conversion*/    \
  |  |  |  |  170|  40.2k|        m_u4_nxt_word  = ITT_BIG_ENDIAN(pu4_word_tmp);              \
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  40.2k|#define ITT_BIG_ENDIAN(x)       ((x << 24))                |   \
  |  |  |  |  |  |   64|  40.2k|                            ((x & 0x0000ff00) << 8)    |   \
  |  |  |  |  |  |   65|  40.2k|                            ((x & 0x00ff0000) >> 8)    |   \
  |  |  |  |  |  |   66|  40.2k|                            ((UWORD32)x >> 24);
  |  |  |  |  ------------------
  |  |  |  |  171|  40.2k|    }                                                           \
  |  |  |  |  172|   556k|}
  |  |  ------------------
  |  |  172|   556k|                    ps_bitstrm->u4_cur_word, ps_bitstrm->u4_nxt_word, numbins); \
  |  |  173|   556k|        do                                                                      \
  |  |  174|  1.27M|        {                                                                       \
  |  |  175|  1.27M|            UWORD32 u4_bit;                                                     \
  |  |  176|  1.27M|            numbins_tmp--;                                                      \
  |  |  177|  1.27M|            u4_bit = (u4_bits >> numbins_tmp) & 1;                              \
  |  |  178|  1.27M|            u4_ofst <<= 1;                                                      \
  |  |  179|  1.27M|            u4_ofst |= u4_bit;                                                  \
  |  |  180|  1.27M|                                                                                \
  |  |  181|  1.27M|            u4_bins <<= 1;                                                      \
  |  |  182|  1.27M|            if(u4_ofst >= u4_range)                                             \
  |  |  ------------------
  |  |  |  Branch (182:16): [True: 665k, False: 612k]
  |  |  ------------------
  |  |  183|  1.27M|            {                                                                   \
  |  |  184|   665k|                u4_bins += 1;                                                   \
  |  |  185|   665k|                u4_ofst -= u4_range;                                            \
  |  |  186|   665k|            }                                                                   \
  |  |  187|  1.27M|        }while(numbins_tmp);                                                    \
  |  |  ------------------
  |  |  |  Branch (187:16): [True: 721k, False: 556k]
  |  |  ------------------
  |  |  188|   556k|                                                                                \
  |  |  189|   556k|        /* Update the cabac context */                                          \
  |  |  190|   556k|        ps_cabac->u4_ofst = u4_ofst;                                            \
  |  |  191|   556k|    }                                                                           \
  |  |  192|   556k|}
  ------------------
  844|  2.22M|                                coeff_abs_level_remaining += u4_suffix;
  845|  2.22M|                            }
  846|   806k|                        }
  847|       |
  848|       |
  849|  8.30M|                        AEV_TRACE("coeff_abs_level_remaining", coeff_abs_level_remaining, ps_cabac->u4_range);
  850|  8.30M|                        base_lvl += coeff_abs_level_remaining;
  851|       |
  852|  8.30M|                    }
  853|       |
  854|       |                    /* update the rice param based on coeff level */
  855|  36.7M|                    if((base_lvl > (3 << rice_param)) && (rice_param < 4))
  ------------------
  |  Branch (855:24): [True: 1.42M, False: 35.3M]
  |  Branch (855:58): [True: 1.41M, False: 6.29k]
  ------------------
  856|  1.41M|                    {
  857|  1.41M|                        rice_param++;
  858|  1.41M|                    }
  859|       |
  860|       |                    /* Compute absolute level */
  861|  36.7M|                    level = base_lvl;
  862|       |
  863|       |                    /* Update level with the sign */
  864|  36.7M|                    if((u4_coeff_sign_map >> 31) & 1)
  ------------------
  |  Branch (864:24): [True: 12.0M, False: 24.6M]
  ------------------
  865|  12.0M|                        level = -level;
  866|       |
  867|  36.7M|                    u4_coeff_sign_map <<= 1;
  868|       |                    /* Update sign in case sign is hidden */
  869|  36.7M|                    if(sign_data_hiding_flag && sign_hidden)
  ------------------
  |  Branch (869:24): [True: 10.1M, False: 26.5M]
  |  Branch (869:49): [True: 8.19M, False: 1.97M]
  ------------------
  870|  8.19M|                    {
  871|  8.19M|                        sum_abs_level += base_lvl;
  872|       |
  873|  8.19M|                        if(n == first_sig_scan_pos && ((sum_abs_level % 2) == 1))
  ------------------
  |  Branch (873:28): [True: 1.20M, False: 6.99M]
  |  Branch (873:55): [True: 601k, False: 602k]
  ------------------
  874|   601k|                            level = -level;
  875|  8.19M|                    }
  876|       |
  877|       |                    /* Store the resulting level in non-zero level array */
  878|  36.7M|                    ps_tu_sblk_coeff_data->ai2_level[num_sig_coeff++] = level;
  879|       |                    //AEV_TRACE("level", level, 0);
  880|  36.7M|                }
  881|  36.7M|                u4_sig_coeff_map_shift <<= 1;
  882|  36.7M|                n--;
  883|       |                /* If there are zero coeffs, then shift by as many zero coeffs and decrement n */
  884|  36.7M|                clz = CLZ(u4_sig_coeff_map_shift);
  885|  36.7M|                u4_sig_coeff_map_shift <<= clz;
  886|  36.7M|                n -= (WORD32)clz;
  887|       |
  888|       |
  889|  36.7M|            }while(u4_sig_coeff_map_shift);
  ------------------
  |  Branch (889:20): [True: 23.3M, False: 13.3M]
  ------------------
  890|  13.3M|        }
  891|       |
  892|       |        /* Increment the pv_tu_sblk_coeff_data */
  893|  13.3M|        {
  894|  13.3M|            UWORD8 *pu1_buf = (UWORD8 *)ps_codec->s_parse.pv_tu_coeff_data;
  895|  13.3M|            pu1_buf += sizeof(tu_sblk_coeff_data_t) - SUBBLK_COEFF_CNT * sizeof(WORD16);
  ------------------
  |  |  412|  13.3M|#define SUBBLK_COEFF_CNT    16
  ------------------
  896|  13.3M|            pu1_buf += num_coeff * sizeof(WORD16);
  897|  13.3M|            ps_codec->s_parse.pv_tu_coeff_data = pu1_buf;
  898|       |
  899|  13.3M|        }
  900|       |
  901|  13.3M|    }
  902|       |    /* Set number of coded sub blocks in the current TU */
  903|  7.83M|    *pi1_num_coded_subblks = num_subblks;
  904|       |
  905|  7.83M|    return ret;
  906|  7.83M|}

ihevcd_parse_transform_tree:
  124|  10.6M|{
  125|  10.6M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  126|  10.6M|    sps_t *ps_sps;
  127|  10.6M|    pps_t *ps_pps;
  128|  10.6M|    WORD32 value;
  129|  10.6M|    WORD32 x1, y1;
  130|  10.6M|    WORD32 max_trafo_depth;
  131|       |
  132|  10.6M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  133|  10.6M|    WORD32 intra_split_flag;
  134|  10.6M|    WORD32 split_transform_flag;
  135|  10.6M|    WORD32 ctxt_idx;
  136|  10.6M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  137|       |
  138|  10.6M|    max_trafo_depth = ps_codec->s_parse.s_cu.i4_max_trafo_depth;
  139|  10.6M|    ps_sps = ps_codec->s_parse.ps_sps;
  140|  10.6M|    ps_pps = ps_codec->s_parse.ps_pps;
  141|  10.6M|    intra_split_flag = ps_codec->s_parse.s_cu.i4_intra_split_flag;
  142|       |
  143|  10.6M|    {
  144|  10.6M|        split_transform_flag = 0;
  145|  10.6M|        if((log2_trafo_size <= ps_sps->i1_log2_max_transform_block_size) &&
  ------------------
  |  Branch (145:12): [True: 9.92M, False: 723k]
  ------------------
  146|  10.6M|                        (log2_trafo_size > ps_sps->i1_log2_min_transform_block_size) &&
  ------------------
  |  Branch (146:25): [True: 8.33M, False: 1.58M]
  ------------------
  147|  10.6M|                        (trafo_depth < max_trafo_depth) &&
  ------------------
  |  Branch (147:25): [True: 2.15M, False: 6.17M]
  ------------------
  148|  10.6M|                        !(intra_split_flag && (trafo_depth == 0)))
  ------------------
  |  Branch (148:27): [True: 508k, False: 1.64M]
  |  Branch (148:47): [True: 506k, False: 2.04k]
  ------------------
  149|  1.64M|        {
  150|       |            /* encode the split transform flag, context derived as per Table9-37 */
  151|  1.64M|            ctxt_idx = IHEVC_CAB_SPLIT_TFM + (5 - log2_trafo_size);
  152|       |
  153|  1.64M|            TRACE_CABAC_CTXT("split_transform_flag", ps_cabac->u4_range, ctxt_idx);
  154|  1.64M|            split_transform_flag = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  155|  1.64M|            AEV_TRACE("split_transform_flag", split_transform_flag,
  156|  1.64M|                      ps_cabac->u4_range);
  157|       |
  158|  1.64M|        }
  159|  8.99M|        else
  160|  8.99M|        {
  161|  8.99M|            WORD32 inter_split_flag = 0;
  162|       |
  163|  8.99M|            if((0 == ps_sps->i1_max_transform_hierarchy_depth_inter) &&
  ------------------
  |  Branch (163:16): [True: 6.78M, False: 2.20M]
  ------------------
  164|  8.99M|                            (PRED_MODE_INTER == ps_codec->s_parse.s_cu.i4_pred_mode) &&
  ------------------
  |  Branch (164:29): [True: 23.7k, False: 6.76M]
  ------------------
  165|  8.99M|                            (PART_2Nx2N != ps_codec->s_parse.s_cu.i4_part_mode) &&
  ------------------
  |  Branch (165:29): [True: 21.0k, False: 2.66k]
  ------------------
  166|  8.99M|                            (0 == trafo_depth))
  ------------------
  |  Branch (166:29): [True: 4.21k, False: 16.8k]
  ------------------
  167|  4.21k|            {
  168|  4.21k|                inter_split_flag = 1;
  169|  4.21k|            }
  170|       |
  171|  8.99M|            if((log2_trafo_size > ps_sps->i1_log2_max_transform_block_size) ||
  ------------------
  |  Branch (171:16): [True: 723k, False: 8.27M]
  ------------------
  172|  8.99M|                            ((1 == intra_split_flag) && (0 == trafo_depth)) ||
  ------------------
  |  Branch (172:30): [True: 2.57M, False: 5.69M]
  |  Branch (172:57): [True: 506k, False: 2.06M]
  ------------------
  173|  8.99M|                            (1 == inter_split_flag))
  ------------------
  |  Branch (173:29): [True: 1.91k, False: 7.76M]
  ------------------
  174|  1.23M|            {
  175|  1.23M|                split_transform_flag = 1;
  176|  1.23M|            }
  177|  8.99M|        }
  178|       |
  179|  10.6M|        if(0 == trafo_depth)
  ------------------
  |  Branch (179:12): [True: 5.04M, False: 5.60M]
  ------------------
  180|  5.04M|        {
  181|  5.04M|            ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth] = 0;
  182|  5.04M|            ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth] = 0;
  183|  5.04M|        }
  184|  5.60M|        else
  185|  5.60M|        {
  186|  5.60M|            ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth] = ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth - 1];
  187|  5.60M|            ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth] = ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth - 1];
  188|  5.60M|        }
  189|  10.6M|        if(trafo_depth == 0 || log2_trafo_size > 2)
  ------------------
  |  Branch (189:12): [True: 5.04M, False: 5.60M]
  |  Branch (189:32): [True: 4.01M, False: 1.58M]
  ------------------
  190|  9.05M|        {
  191|  9.05M|            ctxt_idx = IHEVC_CAB_CBCR_IDX + trafo_depth;
  192|       |            /* CBF for Cb/Cr is sent only if the parent CBF for Cb/Cr is non-zero */
  193|  9.05M|            if((trafo_depth == 0) || ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth - 1])
  ------------------
  |  Branch (193:16): [True: 5.04M, False: 4.01M]
  |  Branch (193:38): [True: 1.30M, False: 2.70M]
  ------------------
  194|  6.35M|            {
  195|  6.35M|                TRACE_CABAC_CTXT("cbf_cb", ps_cabac->u4_range, ctxt_idx);
  196|  6.35M|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  197|  6.35M|                AEV_TRACE("cbf_cb", value, ps_cabac->u4_range);
  198|  6.35M|                ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth] = value;
  199|  6.35M|            }
  200|       |
  201|  9.05M|            if((trafo_depth == 0) || ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth - 1])
  ------------------
  |  Branch (201:16): [True: 5.04M, False: 4.01M]
  |  Branch (201:38): [True: 1.30M, False: 2.70M]
  ------------------
  202|  6.35M|            {
  203|  6.35M|                TRACE_CABAC_CTXT("cbf_cr", ps_cabac->u4_range, ctxt_idx);
  204|  6.35M|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  205|  6.35M|                AEV_TRACE("cbf_cr", value, ps_cabac->u4_range);
  206|  6.35M|                ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth] = value;
  207|  6.35M|            }
  208|  9.05M|        }
  209|  10.6M|        if(split_transform_flag)
  ------------------
  |  Branch (209:12): [True: 1.40M, False: 9.24M]
  ------------------
  210|  1.40M|        {
  211|  1.40M|            WORD32 intra_pred_mode_tmp;
  212|  1.40M|            x1 = x0 + ((1 << log2_trafo_size) >> 1);
  213|  1.40M|            y1 = y0 + ((1 << log2_trafo_size) >> 1);
  214|       |
  215|       |            /* For transform depth of zero, intra pred mode as decoded at CU */
  216|       |            /* level is sent to the transform tree nodes */
  217|       |            /* When depth is non-zero intra pred mode of parent node is sent */
  218|       |            /* This takes care of passing correct mode to all the child nodes */
  219|  1.40M|            intra_pred_mode_tmp = trafo_depth ? intra_pred_mode : ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0];
  ------------------
  |  Branch (219:35): [True: 218k, False: 1.18M]
  ------------------
  220|  1.40M|            ret = ihevcd_parse_transform_tree(ps_codec, x0, y0, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 0, intra_pred_mode_tmp);
  221|  1.40M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.40M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 127, False: 1.40M]
  |  |  ------------------
  ------------------
  222|       |
  223|  1.40M|            intra_pred_mode_tmp = trafo_depth ? intra_pred_mode : ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[1];
  ------------------
  |  Branch (223:35): [True: 218k, False: 1.18M]
  ------------------
  224|  1.40M|            ret = ihevcd_parse_transform_tree(ps_codec, x1, y0, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 1, intra_pred_mode_tmp);
  225|  1.40M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.40M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 4, False: 1.40M]
  |  |  ------------------
  ------------------
  226|       |
  227|  1.40M|            intra_pred_mode_tmp = trafo_depth ? intra_pred_mode : ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[2];
  ------------------
  |  Branch (227:35): [True: 218k, False: 1.18M]
  ------------------
  228|  1.40M|            ret = ihevcd_parse_transform_tree(ps_codec, x0, y1, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 2, intra_pred_mode_tmp);
  229|  1.40M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.40M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 3, False: 1.40M]
  |  |  ------------------
  ------------------
  230|       |
  231|  1.40M|            intra_pred_mode_tmp = trafo_depth ? intra_pred_mode : ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[3];
  ------------------
  |  Branch (231:35): [True: 218k, False: 1.18M]
  ------------------
  232|  1.40M|            ret = ihevcd_parse_transform_tree(ps_codec, x1, y1, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 3, intra_pred_mode_tmp);
  233|  1.40M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.40M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.40M]
  |  |  ------------------
  ------------------
  234|       |
  235|  1.40M|        }
  236|  9.24M|        else
  237|  9.24M|        {
  238|  9.24M|            WORD32 ctb_x_base;
  239|  9.24M|            WORD32 ctb_y_base;
  240|  9.24M|            WORD32 cu_qp_delta_abs;
  241|       |
  242|       |
  243|       |
  244|  9.24M|            tu_t *ps_tu = ps_codec->s_parse.ps_tu;
  245|  9.24M|            cu_qp_delta_abs = 0;
  246|  9.24M|            ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size;
  247|  9.24M|            ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size;
  248|       |
  249|  9.24M|            if((ps_codec->s_parse.s_cu.i4_pred_mode == PRED_MODE_INTRA) ||
  ------------------
  |  Branch (249:16): [True: 8.95M, False: 292k]
  ------------------
  250|  9.24M|                            (trafo_depth != 0) ||
  ------------------
  |  Branch (250:29): [True: 274k, False: 18.2k]
  ------------------
  251|  9.24M|                            (ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth]) ||
  ------------------
  |  Branch (251:29): [True: 2.70k, False: 15.4k]
  ------------------
  252|  9.24M|                            (ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth]))
  ------------------
  |  Branch (252:29): [True: 1.34k, False: 14.1k]
  ------------------
  253|  9.23M|            {
  254|  9.23M|                ctxt_idx = IHEVC_CAB_CBF_LUMA_IDX;
  255|  9.23M|                ctxt_idx += (trafo_depth == 0) ? 1 : 0;
  ------------------
  |  Branch (255:29): [True: 3.84M, False: 5.38M]
  ------------------
  256|       |
  257|  9.23M|                TRACE_CABAC_CTXT("cbf_luma", ps_cabac->u4_range, ctxt_idx);
  258|  9.23M|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  259|  9.23M|                AEV_TRACE("cbf_luma", value, ps_cabac->u4_range);
  260|       |
  261|  9.23M|                ps_codec->s_parse.s_cu.i1_cbf_luma = value;
  262|  9.23M|            }
  263|  14.1k|            else
  264|  14.1k|            {
  265|  14.1k|                ps_codec->s_parse.s_cu.i1_cbf_luma = 1;
  266|  14.1k|            }
  267|       |
  268|       |            /* Initialize ps_tu to default values */
  269|       |            /* If required change this to WORD32 packed write */
  270|  9.24M|            ps_tu->b1_cb_cbf = 0;
  271|  9.24M|            ps_tu->b1_cr_cbf = 0;
  272|  9.24M|            ps_tu->b1_y_cbf = 0;
  273|  9.24M|            ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2);
  274|  9.24M|            ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2);
  275|  9.24M|            ps_tu->b1_transquant_bypass = ps_codec->s_parse.s_cu.i4_cu_transquant_bypass;
  276|  9.24M|            ps_tu->b3_size = (log2_trafo_size - 2);
  277|  9.24M|            ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
  278|       |
  279|  9.24M|            ps_tu->b6_luma_intra_mode = intra_pred_mode;
  280|  9.24M|            ps_tu->b3_chroma_intra_mode_idx = ps_codec->s_parse.s_cu.i4_intra_chroma_pred_mode_idx;
  281|       |
  282|       |            /* Section:7.3.12  Transform unit syntax inlined here */
  283|  9.24M|            if(ps_codec->s_parse.s_cu.i1_cbf_luma ||
  ------------------
  |  Branch (283:16): [True: 5.42M, False: 3.81M]
  ------------------
  284|  9.24M|                            ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth] ||
  ------------------
  |  Branch (284:29): [True: 664k, False: 3.15M]
  ------------------
  285|  9.24M|                            ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth])
  ------------------
  |  Branch (285:29): [True: 250k, False: 2.90M]
  ------------------
  286|  6.34M|            {
  287|  6.34M|                WORD32 intra_pred_mode_chroma;
  288|  6.34M|                if(ps_pps->i1_cu_qp_delta_enabled_flag && !ps_codec->s_parse.i4_is_cu_qp_delta_coded)
  ------------------
  |  Branch (288:20): [True: 1.55M, False: 4.78M]
  |  Branch (288:59): [True: 240k, False: 1.31M]
  ------------------
  289|   240k|                {
  290|       |
  291|       |
  292|   240k|                    WORD32 c_max        = TU_MAX_QP_DELTA_ABS;
  ------------------
  |  |  160|   240k|#define TU_MAX_QP_DELTA_ABS     5
  ------------------
  293|   240k|                    WORD32 ctxt_inc     = IHEVC_CAB_QP_DELTA_ABS;
  294|   240k|                    WORD32 ctxt_inc_max = CTXT_MAX_QP_DELTA_ABS;
  ------------------
  |  |  163|   240k|#define CTXT_MAX_QP_DELTA_ABS   1
  ------------------
  295|       |
  296|   240k|                    TRACE_CABAC_CTXT("cu_qp_delta_abs", ps_cabac->u4_range, ctxt_inc);
  297|       |                    /* qp_delta_abs is coded as combination of tunary and eg0 code  */
  298|       |                    /* See Table 9-32 and Table 9-37 for details on cu_qp_delta_abs */
  299|   240k|                    cu_qp_delta_abs = ihevcd_cabac_decode_bins_tunary(ps_cabac,
  300|   240k|                                                                      ps_bitstrm,
  301|   240k|                                                                      c_max,
  302|   240k|                                                                      ctxt_inc,
  303|   240k|                                                                      0,
  304|   240k|                                                                      ctxt_inc_max);
  305|   240k|                    if(cu_qp_delta_abs >= c_max)
  ------------------
  |  Branch (305:24): [True: 10.7k, False: 230k]
  ------------------
  306|  10.7k|                    {
  307|  10.7k|                        value = ihevcd_cabac_decode_bypass_bins_egk(ps_cabac, ps_bitstrm, 0);
  308|  10.7k|                        cu_qp_delta_abs += value;
  309|  10.7k|                    }
  310|   240k|                    AEV_TRACE("cu_qp_delta_abs", cu_qp_delta_abs, ps_cabac->u4_range);
  311|       |
  312|   240k|                    ps_codec->s_parse.i4_is_cu_qp_delta_coded = 1;
  313|       |
  314|       |
  315|   240k|                    if(cu_qp_delta_abs)
  ------------------
  |  Branch (315:24): [True: 114k, False: 126k]
  ------------------
  316|   114k|                    {
  317|   114k|                        value = ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
  318|   114k|                        AEV_TRACE("cu_qp_delta_sign", value, ps_cabac->u4_range);
  319|       |
  320|   114k|                        if(value)
  ------------------
  |  Branch (320:28): [True: 55.0k, False: 59.4k]
  ------------------
  321|  55.0k|                            cu_qp_delta_abs = -cu_qp_delta_abs;
  322|       |
  323|   114k|                    }
  324|       |
  325|   240k|                    if (cu_qp_delta_abs < MIN_CU_QP_DELTA_ABS(ps_sps->i1_bit_depth_luma_minus8)
  ------------------
  |  |   85|   481k|#define MIN_CU_QP_DELTA_ABS(x) (-26 + ((x) * 6) / 2)
  ------------------
  |  Branch (325:25): [True: 130, False: 240k]
  ------------------
  326|   240k|                                    || cu_qp_delta_abs > MAX_CU_QP_DELTA_ABS(ps_sps->i1_bit_depth_luma_minus8))
  ------------------
  |  |   86|   240k|#define MAX_CU_QP_DELTA_ABS(x) (25 + ((x) * 6) / 2)
  ------------------
  |  Branch (326:40): [True: 18, False: 240k]
  ------------------
  327|    148|                    {
  328|    148|                        return IHEVCD_INVALID_PARAMETER;
  329|    148|                    }
  330|       |
  331|   240k|                    ps_codec->s_parse.s_cu.i4_cu_qp_delta = cu_qp_delta_abs;
  332|       |
  333|   240k|                }
  334|       |
  335|  6.34M|                if(ps_codec->s_parse.s_cu.i1_cbf_luma)
  ------------------
  |  Branch (335:20): [True: 5.42M, False: 914k]
  ------------------
  336|  5.42M|                {
  337|  5.42M|                    ps_tu->b1_y_cbf = 1;
  338|  5.42M|                    ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size, 0, intra_pred_mode);
  339|  5.42M|                }
  340|       |
  341|  6.34M|                if(4 == ps_codec->s_parse.s_cu.i4_intra_chroma_pred_mode_idx)
  ------------------
  |  Branch (341:20): [True: 5.56M, False: 779k]
  ------------------
  342|  5.56M|                    intra_pred_mode_chroma = ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0];
  343|   779k|                else
  344|   779k|                {
  345|   779k|                    intra_pred_mode_chroma = gau1_intra_pred_chroma_modes[ps_codec->s_parse.s_cu.i4_intra_chroma_pred_mode_idx];
  346|       |
  347|   779k|                    if(intra_pred_mode_chroma ==
  ------------------
  |  Branch (347:24): [True: 167k, False: 612k]
  ------------------
  348|   779k|                                    ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0])
  349|   167k|                    {
  350|   167k|                        intra_pred_mode_chroma = INTRA_ANGULAR(34);
  ------------------
  |  |  507|   167k|#define INTRA_ANGULAR(x) (x)
  ------------------
  351|   167k|                    }
  352|       |
  353|   779k|                }
  354|  6.34M|                if(log2_trafo_size > 2)
  ------------------
  |  Branch (354:20): [True: 5.60M, False: 740k]
  ------------------
  355|  5.60M|                {
  356|  5.60M|                    if(ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth])
  ------------------
  |  Branch (356:24): [True: 1.13M, False: 4.46M]
  ------------------
  357|  1.13M|                    {
  358|  1.13M|                        ps_tu->b1_cb_cbf = 1;
  359|  1.13M|                        ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size - 1, 1, intra_pred_mode_chroma);
  360|  1.13M|                    }
  361|       |
  362|  5.60M|                    if(ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth])
  ------------------
  |  Branch (362:24): [True: 1.13M, False: 4.46M]
  ------------------
  363|  1.13M|                    {
  364|  1.13M|                        ps_tu->b1_cr_cbf = 1;
  365|  1.13M|                        ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size - 1, 2, intra_pred_mode_chroma);
  366|  1.13M|                    }
  367|  5.60M|                }
  368|   740k|                else if(blk_idx == 3)
  ------------------
  |  Branch (368:25): [True: 184k, False: 555k]
  ------------------
  369|   184k|                {
  370|   184k|                    if(ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth])
  ------------------
  |  Branch (370:24): [True: 64.8k, False: 119k]
  ------------------
  371|  64.8k|                    {
  372|  64.8k|                        ps_tu->b1_cb_cbf = 1;
  373|  64.8k|                        ihevcd_parse_residual_coding(ps_codec, cu_x_base, cu_y_base, log2_trafo_size, 1, intra_pred_mode_chroma);
  374|  64.8k|                    }
  375|       |
  376|   184k|                    if(ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth])
  ------------------
  |  Branch (376:24): [True: 62.5k, False: 122k]
  ------------------
  377|  62.5k|                    {
  378|  62.5k|                        ps_tu->b1_cr_cbf = 1;
  379|  62.5k|                        ihevcd_parse_residual_coding(ps_codec, cu_x_base, cu_y_base, log2_trafo_size, 2, intra_pred_mode_chroma);
  380|  62.5k|                    }
  381|   184k|                }
  382|   555k|                else
  383|   555k|                {
  384|       |                    //ps_tu->b1_chroma_present = 0;
  385|   555k|                    ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  518|   555k|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
  386|   555k|                }
  387|  6.34M|            }
  388|  2.90M|            else
  389|  2.90M|            {
  390|  2.90M|                if((3 != blk_idx) && (2 == log2_trafo_size))
  ------------------
  |  Branch (390:20): [True: 2.32M, False: 574k]
  |  Branch (390:38): [True: 636k, False: 1.69M]
  ------------------
  391|   636k|                {
  392|   636k|                    ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  518|   636k|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
  393|   636k|                }
  394|  2.90M|            }
  395|       |
  396|       |            /* Set the first TU in CU flag */
  397|  9.24M|            {
  398|  9.24M|                if((ps_codec->s_parse.s_cu.i4_pos_x << 3) == (ps_tu->b4_pos_x << 2) &&
  ------------------
  |  Branch (398:20): [True: 6.30M, False: 2.93M]
  ------------------
  399|  9.24M|                                (ps_codec->s_parse.s_cu.i4_pos_y << 3) == (ps_tu->b4_pos_y << 2))
  ------------------
  |  Branch (399:33): [True: 5.04M, False: 1.26M]
  ------------------
  400|  5.04M|                {
  401|  5.04M|                    ps_tu->b1_first_tu_in_cu = 1;
  402|  5.04M|                }
  403|  4.20M|                else
  404|  4.20M|                {
  405|  4.20M|                    ps_tu->b1_first_tu_in_cu = 0;
  406|  4.20M|                }
  407|  9.24M|            }
  408|  9.24M|            ps_codec->s_parse.ps_tu++;
  409|  9.24M|            ps_codec->s_parse.s_cu.i4_tu_cnt++;
  410|  9.24M|            ps_codec->s_parse.i4_pic_tu_idx++;
  411|  9.24M|        }
  412|  10.6M|    }
  413|  10.6M|    return ret;
  414|  10.6M|}
ihevcd_parse_mvd:
  435|   184k|{
  436|   184k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  437|   184k|    WORD32 value;
  438|   184k|    WORD32 abs_mvd;
  439|   184k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  440|   184k|    WORD32 abs_mvd_greater0_flag[2];
  441|   184k|    WORD32 abs_mvd_greater1_flag[2];
  442|   184k|    WORD32 ctxt_idx;
  443|   184k|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  444|       |
  445|       |
  446|   184k|    ctxt_idx  = IHEVC_CAB_MVD_GRT0;
  447|       |    /* encode absmvd_x > 0 */
  448|   184k|    TRACE_CABAC_CTXT("abs_mvd_greater0_flag[0]", ps_cabac->u4_range, ctxt_idx);
  449|   184k|    abs_mvd_greater0_flag[0] = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  450|   184k|    AEV_TRACE("abs_mvd_greater0_flag[0]", abs_mvd_greater0_flag[0], ps_cabac->u4_range);
  451|       |
  452|       |    /* encode absmvd_y > 0 */
  453|   184k|    TRACE_CABAC_CTXT("abs_mvd_greater0_flag[1]", ps_cabac->u4_range, ctxt_idx);
  454|   184k|    abs_mvd_greater0_flag[1] = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  455|   184k|    AEV_TRACE("abs_mvd_greater0_flag[1]", abs_mvd_greater0_flag[1], ps_cabac->u4_range);
  456|       |
  457|   184k|    ctxt_idx  = IHEVC_CAB_MVD_GRT1;
  458|   184k|    abs_mvd_greater1_flag[0] = 0;
  459|   184k|    abs_mvd_greater1_flag[1] = 0;
  460|       |
  461|   184k|    if(abs_mvd_greater0_flag[0])
  ------------------
  |  Branch (461:8): [True: 94.2k, False: 89.9k]
  ------------------
  462|  94.2k|    {
  463|  94.2k|        TRACE_CABAC_CTXT("abs_mvd_greater1_flag[0]", ps_cabac->u4_range, ctxt_idx);
  464|  94.2k|        abs_mvd_greater1_flag[0] = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  465|  94.2k|        AEV_TRACE("abs_mvd_greater1_flag[0]", abs_mvd_greater1_flag[0], ps_cabac->u4_range);
  466|  94.2k|    }
  467|   184k|    if(abs_mvd_greater0_flag[1])
  ------------------
  |  Branch (467:8): [True: 99.1k, False: 85.1k]
  ------------------
  468|  99.1k|    {
  469|  99.1k|        TRACE_CABAC_CTXT("abs_mvd_greater1_flag[1]", ps_cabac->u4_range, ctxt_idx);
  470|  99.1k|        abs_mvd_greater1_flag[1] = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  471|  99.1k|        AEV_TRACE("abs_mvd_greater1_flag[1]", abs_mvd_greater1_flag[1], ps_cabac->u4_range);
  472|  99.1k|    }
  473|   184k|    abs_mvd = 0;
  474|   184k|    if(abs_mvd_greater0_flag[0])
  ------------------
  |  Branch (474:8): [True: 94.2k, False: 89.9k]
  ------------------
  475|  94.2k|    {
  476|  94.2k|        abs_mvd = 1;
  477|  94.2k|        if(abs_mvd_greater1_flag[0])
  ------------------
  |  Branch (477:12): [True: 32.1k, False: 62.1k]
  ------------------
  478|  32.1k|        {
  479|  32.1k|            value = ihevcd_cabac_decode_bypass_bins_egk(ps_cabac, ps_bitstrm, 1);
  480|  32.1k|            AEV_TRACE("abs_mvd_minus2[0]", value, ps_cabac->u4_range);
  481|  32.1k|            abs_mvd = value + 2;
  482|  32.1k|        }
  483|  94.2k|        value = ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
  484|  94.2k|        AEV_TRACE("mvd_sign_flag[0]", value, ps_cabac->u4_range);
  485|  94.2k|        if(value)
  ------------------
  |  Branch (485:12): [True: 46.8k, False: 47.4k]
  ------------------
  486|  46.8k|        {
  487|  46.8k|            abs_mvd = -abs_mvd;
  488|  46.8k|        }
  489|       |
  490|  94.2k|    }
  491|   184k|    ps_mv->i2_mvx = abs_mvd;
  492|   184k|    abs_mvd = 0;
  493|   184k|    if(abs_mvd_greater0_flag[1])
  ------------------
  |  Branch (493:8): [True: 99.1k, False: 85.1k]
  ------------------
  494|  99.1k|    {
  495|  99.1k|        abs_mvd = 1;
  496|  99.1k|        if(abs_mvd_greater1_flag[1])
  ------------------
  |  Branch (496:12): [True: 35.6k, False: 63.4k]
  ------------------
  497|  35.6k|        {
  498|  35.6k|            value = ihevcd_cabac_decode_bypass_bins_egk(ps_cabac, ps_bitstrm, 1);
  499|  35.6k|            AEV_TRACE("abs_mvd_minus2[1]", value, ps_cabac->u4_range);
  500|  35.6k|            abs_mvd = value + 2;
  501|       |
  502|  35.6k|        }
  503|  99.1k|        value = ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
  504|  99.1k|        AEV_TRACE("mvd_sign_flag[1]", value, ps_cabac->u4_range);
  505|       |
  506|  99.1k|        if(value)
  ------------------
  |  Branch (506:12): [True: 49.0k, False: 50.0k]
  ------------------
  507|  49.0k|        {
  508|  49.0k|            abs_mvd = -abs_mvd;
  509|  49.0k|        }
  510|  99.1k|    }
  511|   184k|    ps_mv->i2_mvy = abs_mvd;
  512|       |
  513|   184k|    return ret;
  514|   184k|}
ihevcd_parse_pcm_sample:
  541|      7|{
  542|      7|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  543|      7|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  544|      7|    sps_t *ps_sps;
  545|       |
  546|      7|    WORD32 value;
  547|      7|    WORD32 i;
  548|       |
  549|      7|    WORD32 num_bits;
  550|      7|    UWORD32 u4_sig_coeff_map;
  551|      7|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  552|      7|    tu_t *ps_tu = ps_codec->s_parse.ps_tu;
  553|      7|    tu_sblk_coeff_data_t *ps_tu_sblk_coeff_data;
  554|      7|    UWORD8 *pu1_coeff_data;
  555|      7|    ps_sps = ps_codec->s_parse.ps_sps;
  556|       |
  557|      7|    UNUSED(value);
  ------------------
  |  |   38|      7|#define UNUSED(x) ((void)(x))
  ------------------
  558|      7|    UNUSED(ps_tu);
  ------------------
  |  |   38|      7|#define UNUSED(x) ((void)(x))
  ------------------
  559|      7|    UNUSED(ps_cabac);
  ------------------
  |  |   38|      7|#define UNUSED(x) ((void)(x))
  ------------------
  560|      7|    UNUSED(x0);
  ------------------
  |  |   38|      7|#define UNUSED(x) ((void)(x))
  ------------------
  561|      7|    UNUSED(y0);
  ------------------
  |  |   38|      7|#define UNUSED(x) ((void)(x))
  ------------------
  562|       |
  563|      7|    {
  564|      7|        WORD8 *pi1_scan_idx;
  565|      7|        WORD8 *pi1_buf = (WORD8 *)ps_codec->s_parse.pv_tu_coeff_data;
  566|      7|        WORD8 *pi1_num_coded_subblks;
  567|       |
  568|       |        /* First WORD8 gives number of coded subblocks */
  569|      7|        pi1_num_coded_subblks = pi1_buf++;
  570|       |
  571|       |        /* Set number of coded subblocks in the current TU to zero */
  572|       |        /* For PCM there will be only one subblock which is the same size as CU */
  573|      7|        *pi1_num_coded_subblks = 1;
  574|       |
  575|       |        /* Second WORD8 gives (scan idx << 1) | trans_skip */
  576|      7|        pi1_scan_idx = pi1_buf++;
  577|      7|        *pi1_scan_idx = (0 << 1) | 1;
  578|       |
  579|       |        /* Store the incremented pointer in pv_tu_coeff_data */
  580|      7|        ps_codec->s_parse.pv_tu_coeff_data = pi1_buf;
  581|       |
  582|      7|    }
  583|       |
  584|      7|    u4_sig_coeff_map = 0xFFFFFFFF;
  585|      7|    ps_tu_sblk_coeff_data = (tu_sblk_coeff_data_t *)ps_codec->s_parse.pv_tu_coeff_data;
  586|      7|    ps_tu_sblk_coeff_data->u2_sig_coeff_map = u4_sig_coeff_map;
  587|      7|    ps_tu_sblk_coeff_data->u2_subblk_pos = 0;
  588|       |
  589|      7|    pu1_coeff_data = (UWORD8 *)&ps_tu_sblk_coeff_data->ai2_level[0];
  590|       |
  591|      7|    num_bits = ps_sps->i1_pcm_sample_bit_depth_luma;
  592|       |
  593|    455|    for(i = 0; i < 1 << (log2_cb_size << 1); i++)
  ------------------
  |  Branch (593:16): [True: 448, False: 7]
  ------------------
  594|    448|    {
  595|    448|        TRACE_CABAC_CTXT("pcm_sample_luma", ps_cabac->u4_range, 0);
  596|    448|        BITS_PARSE("pcm_sample_luma", value, ps_bitstrm, num_bits);
  ------------------
  |  |  148|    448|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  597|       |
  598|       |        //ps_pcmsample_t->i1_pcm_sample_luma[i] = value;
  599|    448|        *pu1_coeff_data++ = value << (BIT_DEPTH_LUMA - num_bits);
  ------------------
  |  |  270|    448|#define BIT_DEPTH_LUMA      BIT_DEPTH
  |  |  ------------------
  |  |  |  |  269|    448|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  600|    448|    }
  601|       |
  602|      7|    num_bits = ps_sps->i1_pcm_sample_bit_depth_chroma;
  603|       |
  604|    231|    for(i = 0; i < (1 << (log2_cb_size << 1)) >> 1; i++)
  ------------------
  |  Branch (604:16): [True: 224, False: 7]
  ------------------
  605|    224|    {
  606|    224|        TRACE_CABAC_CTXT("pcm_sample_chroma", ps_cabac->u4_range, 0);
  607|    224|        BITS_PARSE("pcm_sample_chroma", value, ps_bitstrm, num_bits);
  ------------------
  |  |  148|    224|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  608|       |
  609|       |        // ps_pcmsample_t->i1_pcm_sample_chroma[i] = value;
  610|    224|        *pu1_coeff_data++ = value << (BIT_DEPTH_CHROMA - num_bits);
  ------------------
  |  |  271|    224|#define BIT_DEPTH_CHROMA    BIT_DEPTH
  |  |  ------------------
  |  |  |  |  269|    224|#define BIT_DEPTH           8
  |  |  ------------------
  ------------------
  611|    224|    }
  612|       |
  613|      7|    ps_codec->s_parse.pv_tu_coeff_data = pu1_coeff_data;
  614|       |
  615|      7|    return ret;
  616|      7|}
ihevcd_parse_pu_mvp:
  638|   169k|{
  639|   169k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  640|   169k|    WORD32 value;
  641|   169k|    slice_header_t *ps_slice_hdr;
  642|   169k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  643|   169k|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  644|   169k|    WORD32 inter_pred_idc;
  645|       |
  646|   169k|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
  647|       |
  648|   169k|    if(ps_slice_hdr->i1_slice_type == BSLICE)
  ------------------
  |  Branch (648:8): [True: 169k, False: 184]
  ------------------
  649|   169k|    {
  650|   169k|        WORD32 pu_w_plus_pu_h;
  651|   169k|        WORD32 ctxt_idx;
  652|       |        /* required to check if w+h==12 case */
  653|   169k|        pu_w_plus_pu_h = ((ps_pu->b4_wd + 1) << 2) + ((ps_pu->b4_ht + 1) << 2);
  654|   169k|        if(12 == pu_w_plus_pu_h)
  ------------------
  |  Branch (654:12): [True: 107k, False: 61.4k]
  ------------------
  655|   107k|        {
  656|   107k|            ctxt_idx = IHEVC_CAB_INTER_PRED_IDC + 4;
  657|   107k|            TRACE_CABAC_CTXT("inter_pred_idc", ps_cabac->u4_range, ctxt_idx);
  658|   107k|            inter_pred_idc = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm,
  659|   107k|                                                     ctxt_idx);
  660|   107k|        }
  661|  61.4k|        else
  662|  61.4k|        {
  663|       |            /* larger PUs can be encoded as bi_pred/l0/l1 inter_pred_idc */
  664|  61.4k|            WORD32 is_bipred;
  665|       |
  666|  61.4k|            ctxt_idx = IHEVC_CAB_INTER_PRED_IDC + ps_codec->s_parse.i4_ct_depth;
  667|  61.4k|            TRACE_CABAC_CTXT("inter_pred_idc", ps_cabac->u4_range, ctxt_idx);
  668|  61.4k|            is_bipred = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  669|  61.4k|            inter_pred_idc = PRED_BI;
  670|  61.4k|            if(!is_bipred)
  ------------------
  |  Branch (670:16): [True: 45.0k, False: 16.4k]
  ------------------
  671|  45.0k|            {
  672|  45.0k|                ctxt_idx = IHEVC_CAB_INTER_PRED_IDC + 4;
  673|  45.0k|                inter_pred_idc = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm,
  674|  45.0k|                                                         ctxt_idx);
  675|  45.0k|            }
  676|  61.4k|        }
  677|       |
  678|   169k|        AEV_TRACE("inter_pred_idc", inter_pred_idc, ps_cabac->u4_range);
  679|   169k|    }
  680|    184|    else
  681|    184|        inter_pred_idc = PRED_L0;
  682|   169k|    ps_pu->mv.i1_l0_ref_idx = 0;
  683|   169k|    ps_pu->mv.i1_l1_ref_idx = 0;
  684|       |    /* Decode MVD for L0 for PRED_L0 or PRED_BI */
  685|   169k|    if(inter_pred_idc != PRED_L1)
  ------------------
  |  Branch (685:8): [True: 113k, False: 56.5k]
  ------------------
  686|   113k|    {
  687|   113k|        WORD32 active_refs = ps_slice_hdr->i1_num_ref_idx_l0_active;
  688|   113k|        WORD32 ref_idx = 0;
  689|   113k|        WORD32 ctxt_idx;
  690|       |
  691|   113k|        if(active_refs > 1)
  ------------------
  |  Branch (691:12): [True: 99.4k, False: 13.5k]
  ------------------
  692|  99.4k|        {
  693|  99.4k|            ctxt_idx = IHEVC_CAB_INTER_REF_IDX;
  694|       |            /* encode the context modelled first bin */
  695|  99.4k|            TRACE_CABAC_CTXT("ref_idx", ps_cabac->u4_range, ctxt_idx);
  696|  99.4k|            ref_idx = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  697|       |
  698|  99.4k|            if((active_refs > 2) && ref_idx)
  ------------------
  |  Branch (698:16): [True: 5.87k, False: 93.6k]
  |  Branch (698:37): [True: 1.37k, False: 4.49k]
  ------------------
  699|  1.37k|            {
  700|  1.37k|                WORD32 value;
  701|       |                /* encode the context modelled second bin */
  702|  1.37k|                ctxt_idx++;
  703|  1.37k|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  704|  1.37k|                ref_idx += value;
  705|  1.37k|                if((active_refs > 3) && value)
  ------------------
  |  Branch (705:20): [True: 1.25k, False: 123]
  |  Branch (705:41): [True: 514, False: 738]
  ------------------
  706|    514|                {
  707|       |                    /* encode remaining bypass bins */
  708|    514|                    ref_idx = ihevcd_cabac_decode_bypass_bins_tunary(ps_cabac,
  709|    514|                                                                     ps_bitstrm,
  710|    514|                                                                     (active_refs - 3)
  711|    514|                    );
  712|    514|                    ref_idx += 2;
  713|    514|                }
  714|  1.37k|            }
  715|  99.4k|            AEV_TRACE("ref_idx", ref_idx, ps_cabac->u4_range);
  716|  99.4k|        }
  717|       |
  718|   113k|        ref_idx = CLIP3(ref_idx, 0, MAX_DPB_SIZE - 1);
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
  719|   113k|        ps_pu->mv.i1_l0_ref_idx = ref_idx;
  720|       |
  721|   113k|        ihevcd_parse_mvd(ps_codec, &ps_pu->mv.s_l0_mv);
  722|       |
  723|   113k|        ctxt_idx = IHEVC_CAB_MVP_L0L1;
  724|   113k|        value = ihevcd_cabac_decode_bin(ps_cabac,
  725|   113k|                                        ps_bitstrm,
  726|   113k|                                        ctxt_idx);
  727|       |
  728|   113k|        AEV_TRACE("mvp_l0/l1_flag", value, ps_cabac->u4_range);
  729|       |
  730|   113k|        ps_pu->b1_l0_mvp_idx = value;
  731|       |
  732|   113k|    }
  733|       |    /* Decode MVD for L1 for PRED_L1 or PRED_BI */
  734|   169k|    if(inter_pred_idc != PRED_L0)
  ------------------
  |  Branch (734:8): [True: 72.9k, False: 96.6k]
  ------------------
  735|  72.9k|    {
  736|  72.9k|        WORD32 active_refs = ps_slice_hdr->i1_num_ref_idx_l1_active;
  737|  72.9k|        WORD32 ref_idx = 0;
  738|  72.9k|        WORD32 ctxt_idx;
  739|       |
  740|  72.9k|        if(active_refs > 1)
  ------------------
  |  Branch (740:12): [True: 63.9k, False: 8.95k]
  ------------------
  741|  63.9k|        {
  742|       |
  743|  63.9k|            ctxt_idx = IHEVC_CAB_INTER_REF_IDX;
  744|  63.9k|            TRACE_CABAC_CTXT("ref_idx", ps_cabac->u4_range, ctxt_idx);
  745|       |            /* encode the context modelled first bin */
  746|  63.9k|            ref_idx = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  747|       |
  748|  63.9k|            if((active_refs > 2) && ref_idx)
  ------------------
  |  Branch (748:16): [True: 4.80k, False: 59.1k]
  |  Branch (748:37): [True: 2.78k, False: 2.02k]
  ------------------
  749|  2.78k|            {
  750|  2.78k|                WORD32 value;
  751|       |                /* encode the context modelled second bin */
  752|  2.78k|                ctxt_idx++;
  753|  2.78k|                value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  754|  2.78k|                ref_idx += value;
  755|  2.78k|                if((active_refs > 3) && value)
  ------------------
  |  Branch (755:20): [True: 2.48k, False: 309]
  |  Branch (755:41): [True: 1.71k, False: 761]
  ------------------
  756|  1.71k|                {
  757|       |                    /* encode remaining bypass bins */
  758|  1.71k|                    ref_idx = ihevcd_cabac_decode_bypass_bins_tunary(ps_cabac,
  759|  1.71k|                                                                     ps_bitstrm,
  760|  1.71k|                                                                     (active_refs - 3)
  761|  1.71k|                    );
  762|  1.71k|                    ref_idx += 2;
  763|  1.71k|                }
  764|  2.78k|            }
  765|       |
  766|  63.9k|            AEV_TRACE("ref_idx", ref_idx, ps_cabac->u4_range);
  767|  63.9k|        }
  768|       |
  769|  72.9k|        ref_idx = CLIP3(ref_idx, 0, MAX_DPB_SIZE - 1);
  ------------------
  |  |   40|  72.9k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 72.9k]
  |  |  |  Branch (40:53): [True: 0, False: 72.9k]
  |  |  ------------------
  ------------------
  770|  72.9k|        ps_pu->mv.i1_l1_ref_idx = ref_idx;
  771|       |
  772|  72.9k|        if(ps_slice_hdr->i1_mvd_l1_zero_flag && inter_pred_idc == PRED_BI)
  ------------------
  |  Branch (772:12): [True: 6.18k, False: 66.7k]
  |  Branch (772:49): [True: 1.73k, False: 4.44k]
  ------------------
  773|  1.73k|        {
  774|  1.73k|            ps_pu->mv.s_l1_mv.i2_mvx = 0;
  775|  1.73k|            ps_pu->mv.s_l1_mv.i2_mvy = 0;
  776|  1.73k|        }
  777|  71.2k|        else
  778|  71.2k|        {
  779|  71.2k|            ihevcd_parse_mvd(ps_codec, &ps_pu->mv.s_l1_mv);
  780|  71.2k|        }
  781|       |
  782|  72.9k|        ctxt_idx = IHEVC_CAB_MVP_L0L1;
  783|  72.9k|        value = ihevcd_cabac_decode_bin(ps_cabac,
  784|  72.9k|                                        ps_bitstrm,
  785|  72.9k|                                        ctxt_idx);
  786|       |
  787|  72.9k|        AEV_TRACE("mvp_l0/l1_flag", value, ps_cabac->u4_range);
  788|  72.9k|        ps_pu->b1_l1_mvp_idx = value;
  789|       |
  790|  72.9k|    }
  791|       |
  792|   169k|    ps_pu->b2_pred_mode = inter_pred_idc;
  793|   169k|    return ret;
  794|   169k|}
ihevcd_parse_prediction_unit:
  820|   772k|{
  821|   772k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  822|   772k|    slice_header_t *ps_slice_hdr;
  823|   772k|    sps_t *ps_sps;
  824|   772k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  825|   772k|    WORD32 ctb_x_base;
  826|   772k|    WORD32 ctb_y_base;
  827|       |
  828|   772k|    pu_t *ps_pu = ps_codec->s_parse.ps_pu;
  829|   772k|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  830|       |
  831|   772k|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
  832|       |
  833|       |    /* Set PU structure to default values */
  834|   772k|    memset(ps_pu, 0, sizeof(pu_t));
  835|       |
  836|   772k|    ps_sps = ps_codec->s_parse.ps_sps;
  837|   772k|    ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size;
  838|   772k|    ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size;
  839|       |
  840|   772k|    ps_pu->b4_pos_x = (x0 - ctb_x_base) >> 2;
  841|   772k|    ps_pu->b4_pos_y = (y0 - ctb_y_base) >> 2;
  842|   772k|    ps_pu->b4_wd = (wd >> 2) - 1;
  843|   772k|    ps_pu->b4_ht = (ht >> 2) - 1;
  844|       |
  845|   772k|    ps_pu->b1_intra_flag = 0;
  846|   772k|    ps_pu->b3_part_mode = ps_codec->s_parse.s_cu.i4_part_mode;
  847|       |
  848|   772k|    if(PRED_MODE_SKIP == ps_codec->s_parse.s_cu.i4_pred_mode)
  ------------------
  |  Branch (848:8): [True: 367k, False: 404k]
  ------------------
  849|   367k|    {
  850|   367k|        WORD32 merge_idx = 0;
  851|   367k|        if(ps_slice_hdr->i1_max_num_merge_cand > 1)
  ------------------
  |  Branch (851:12): [True: 367k, False: 367]
  ------------------
  852|   367k|        {
  853|   367k|            WORD32 ctxt_idx = IHEVC_CAB_MERGE_IDX_EXT;
  854|   367k|            WORD32 bin;
  855|       |
  856|   367k|            TRACE_CABAC_CTXT("merge_idx", ps_cabac->u4_range, ctxt_idx);
  857|   367k|            bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  858|   367k|            if(bin)
  ------------------
  |  Branch (858:16): [True: 136k, False: 231k]
  ------------------
  859|   136k|            {
  860|   136k|                if(ps_slice_hdr->i1_max_num_merge_cand > 2)
  ------------------
  |  Branch (860:20): [True: 135k, False: 155]
  ------------------
  861|   135k|                {
  862|   135k|                    merge_idx = ihevcd_cabac_decode_bypass_bins_tunary(
  863|   135k|                                    ps_cabac, ps_bitstrm,
  864|   135k|                                    (ps_slice_hdr->i1_max_num_merge_cand - 2));
  865|   135k|                }
  866|   136k|                merge_idx++;
  867|   136k|            }
  868|   367k|            AEV_TRACE("merge_idx", merge_idx, ps_cabac->u4_range);
  869|   367k|        }
  870|   367k|        ps_pu->b1_merge_flag = 1;
  871|   367k|        ps_pu->b3_merge_idx = merge_idx;
  872|       |
  873|   367k|    }
  874|   404k|    else
  875|   404k|    {
  876|       |        /* MODE_INTER */
  877|   404k|        WORD32 merge_flag;
  878|   404k|        WORD32 ctxt_idx = IHEVC_CAB_MERGE_FLAG_EXT;
  879|   404k|        TRACE_CABAC_CTXT("merge_flag", ps_cabac->u4_range, ctxt_idx);
  880|   404k|        merge_flag = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  881|   404k|        AEV_TRACE("merge_flag", merge_flag, ps_cabac->u4_range);
  882|       |
  883|   404k|        ps_pu->b1_merge_flag = merge_flag;
  884|       |
  885|   404k|        if(merge_flag)
  ------------------
  |  Branch (885:12): [True: 235k, False: 169k]
  ------------------
  886|   235k|        {
  887|   235k|            WORD32 merge_idx = 0;
  888|   235k|            if(ps_slice_hdr->i1_max_num_merge_cand > 1)
  ------------------
  |  Branch (888:16): [True: 234k, False: 205]
  ------------------
  889|   234k|            {
  890|   234k|                WORD32 ctxt_idx = IHEVC_CAB_MERGE_IDX_EXT;
  891|   234k|                WORD32 bin;
  892|   234k|                TRACE_CABAC_CTXT("merge_idx", ps_cabac->u4_range, ctxt_idx);
  893|   234k|                bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  894|   234k|                if(bin)
  ------------------
  |  Branch (894:20): [True: 68.8k, False: 166k]
  ------------------
  895|  68.8k|                {
  896|  68.8k|                    if(ps_slice_hdr->i1_max_num_merge_cand > 2)
  ------------------
  |  Branch (896:24): [True: 68.6k, False: 221]
  ------------------
  897|  68.6k|                    {
  898|  68.6k|                        merge_idx = ihevcd_cabac_decode_bypass_bins_tunary(
  899|  68.6k|                                        ps_cabac, ps_bitstrm,
  900|  68.6k|                                        (ps_slice_hdr->i1_max_num_merge_cand - 2));
  901|  68.6k|                    }
  902|  68.8k|                    merge_idx++;
  903|  68.8k|                }
  904|   234k|                AEV_TRACE("merge_idx", merge_idx, ps_cabac->u4_range);
  905|   234k|            }
  906|       |
  907|   235k|            ps_pu->b3_merge_idx = merge_idx;
  908|   235k|        }
  909|   169k|        else
  910|   169k|        {
  911|   169k|            ihevcd_parse_pu_mvp(ps_codec, ps_pu);
  912|   169k|        }
  913|       |
  914|   404k|    }
  915|   772k|    STATS_UPDATE_PU_SIZE(ps_pu);
  ------------------
  |  |  145|   772k|#define STATS_UPDATE_PU_SIZE(ps_pu) ;
  ------------------
  916|       |    /* Increment PU pointer */
  917|   772k|    ps_codec->s_parse.ps_pu++;
  918|   772k|    ps_codec->s_parse.i4_pic_pu_idx++;
  919|   772k|    return ret;
  920|   772k|}
ihevcd_parse_part_mode_amp:
  924|  52.7k|{
  925|  52.7k|    WORD32 ctxt_idx = IHEVC_CAB_PART_MODE;
  926|  52.7k|    WORD32 part_mode_idx;
  927|  52.7k|    WORD32 part_mode;
  928|  52.7k|    WORD32 bin;
  929|       |
  930|  52.7k|    part_mode = 0;
  931|  52.7k|    TRACE_CABAC_CTXT("part_mode", ps_cabac->u4_range, ctxt_idx);
  932|  52.7k|    bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx++);
  933|       |
  934|  52.7k|    if(!bin)
  ------------------
  |  Branch (934:8): [True: 39.8k, False: 12.9k]
  ------------------
  935|  39.8k|    {
  936|  39.8k|        bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx++);
  937|  39.8k|        part_mode_idx = bin;
  938|  39.8k|        part_mode_idx <<= 1;
  939|       |
  940|       |        /* Following takes of handling context increment for 3rd bin in part_mode */
  941|       |        /* When AMP is enabled and the current is not min CB */
  942|       |        /* Context for 3rd bin is 3 and not 2 */
  943|  39.8k|        ctxt_idx += 1;
  944|       |
  945|  39.8k|        bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
  946|  39.8k|        part_mode_idx |= bin;
  947|       |
  948|  39.8k|        part_mode_idx <<= 1;
  949|  39.8k|        if(!bin)
  ------------------
  |  Branch (949:12): [True: 28.5k, False: 11.2k]
  ------------------
  950|  28.5k|        {
  951|       |
  952|  28.5k|            bin = ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
  953|  28.5k|            part_mode_idx |= bin;
  954|  28.5k|        }
  955|  39.8k|        part_mode = gau1_part_mode_amp[part_mode_idx];
  956|  39.8k|    }
  957|  52.7k|    return part_mode;
  958|  52.7k|}
ihevcd_parse_coding_unit_intra:
  963|  4.99M|{
  964|  4.99M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  965|  4.99M|    sps_t *ps_sps;
  966|  4.99M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
  967|  4.99M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  968|  4.99M|    WORD32 pcm_flag;
  969|  4.99M|    WORD32 value;
  970|  4.99M|    WORD32 cb_size = 1 << log2_cb_size;
  971|  4.99M|    WORD32 part_mode =  ps_codec->s_parse.s_cu.i4_part_mode;
  972|  4.99M|    tu_t *ps_tu = ps_codec->s_parse.ps_tu;
  973|  4.99M|    pu_t *ps_pu = ps_codec->s_parse.ps_pu;
  974|  4.99M|    WORD32 ctb_x_base;
  975|  4.99M|    WORD32 ctb_y_base;
  976|  4.99M|    ps_sps = ps_codec->s_parse.ps_sps;
  977|  4.99M|    ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size;
  978|  4.99M|    ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size;
  979|       |
  980|  4.99M|    memset(ps_pu, 0, sizeof(pu_t));
  981|  4.99M|    ps_pu->b1_intra_flag = 1;
  982|  4.99M|    ps_pu->b4_wd = (cb_size >> 2) - 1;
  983|  4.99M|    ps_pu->b4_ht = (cb_size >> 2) - 1;
  984|  4.99M|    ps_pu->b4_pos_x = (x0 - ctb_x_base) >> 2;
  985|  4.99M|    ps_pu->b4_pos_y = (y0 - ctb_y_base) >> 2;
  986|       |
  987|  4.99M|    pcm_flag = 0;
  988|  4.99M|    if((PART_2Nx2N == part_mode) && (ps_sps->i1_pcm_enabled_flag)
  ------------------
  |  Branch (988:8): [True: 4.47M, False: 516k]
  |  Branch (988:37): [True: 6.43k, False: 4.47M]
  ------------------
  989|  4.99M|                    && (log2_cb_size
  ------------------
  |  Branch (989:24): [True: 6.15k, False: 279]
  ------------------
  990|  6.43k|                                    >= ps_sps->i1_log2_min_pcm_coding_block_size)
  991|  4.99M|                    && (log2_cb_size
  ------------------
  |  Branch (991:24): [True: 5.24k, False: 905]
  ------------------
  992|  6.15k|                                    <= (ps_sps->i1_log2_min_pcm_coding_block_size + ps_sps->i1_log2_diff_max_min_pcm_coding_block_size)))
  993|  5.24k|    {
  994|  5.24k|        TRACE_CABAC_CTXT("pcm_flag", ps_cabac->u4_range, 0);
  995|  5.24k|        pcm_flag = ihevcd_cabac_decode_terminate(ps_cabac, ps_bitstrm);
  996|  5.24k|        AEV_TRACE("pcm_flag", pcm_flag, ps_cabac->u4_range);
  997|  5.24k|    }
  998|       |
  999|  4.99M|    ps_codec->s_parse.i4_cu_pcm_flag = pcm_flag;
 1000|  4.99M|    if(pcm_flag)
  ------------------
  |  Branch (1000:8): [True: 7, False: 4.99M]
  ------------------
 1001|      7|    {
 1002|      7|        UWORD8 *pu1_luma_intra_pred_mode_top, *pu1_luma_intra_pred_mode_left;
 1003|      7|        WORD32 i,  num_pred_blocks;
 1004|       |
 1005|      7|        if(ps_codec->s_parse.s_bitstrm.u4_bit_ofst % 8)
  ------------------
  |  Branch (1005:12): [True: 6, False: 1]
  ------------------
 1006|      6|        {
 1007|      6|            TRACE_CABAC_CTXT("pcm_alignment_zero_bit", ps_cabac->u4_range, 0);
 1008|      6|            ihevcd_bits_flush_to_byte_boundary(&ps_codec->s_parse.s_bitstrm);
 1009|      6|            AEV_TRACE("pcm_alignment_zero_bit", 0, ps_cabac->u4_range);
 1010|      6|        }
 1011|       |
 1012|      7|        ihevcd_parse_pcm_sample(ps_codec, x0, y0, log2_cb_size);
 1013|       |
 1014|      7|        ihevcd_cabac_reset(&ps_codec->s_parse.s_cabac,
 1015|      7|                           &ps_codec->s_parse.s_bitstrm);
 1016|       |
 1017|      7|        ps_tu = ps_codec->s_parse.ps_tu;
 1018|      7|        ps_tu->b1_cb_cbf = 1;
 1019|      7|        ps_tu->b1_cr_cbf = 1;
 1020|      7|        ps_tu->b1_y_cbf = 1;
 1021|      7|        ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2);
 1022|      7|        ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2);
 1023|      7|        ps_tu->b1_transquant_bypass = 1;
 1024|      7|        ps_tu->b3_size = (log2_cb_size - 2);
 1025|      7|        ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
 1026|      7|        ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  518|      7|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
 1027|      7|        ps_tu->b6_luma_intra_mode   = INTRA_PRED_NONE;
  ------------------
  |  |  511|      7|#define INTRA_PRED_NONE  63
  ------------------
 1028|       |
 1029|       |        /* Set the first TU in CU flag */
 1030|      7|        {
 1031|      7|            if((ps_codec->s_parse.s_cu.i4_pos_x << 3) == (ps_tu->b4_pos_x << 2) &&
  ------------------
  |  Branch (1031:16): [True: 7, False: 0]
  ------------------
 1032|      7|                            (ps_codec->s_parse.s_cu.i4_pos_y << 3) == (ps_tu->b4_pos_y << 2))
  ------------------
  |  Branch (1032:29): [True: 7, False: 0]
  ------------------
 1033|      7|            {
 1034|      7|                ps_tu->b1_first_tu_in_cu = 1;
 1035|      7|            }
 1036|      0|            else
 1037|      0|            {
 1038|      0|                ps_tu->b1_first_tu_in_cu = 0;
 1039|      0|            }
 1040|      7|        }
 1041|       |
 1042|       |        /* Update the intra pred mode for PCM to INTRA_DC(default mode) */
 1043|      7|        pu1_luma_intra_pred_mode_top = ps_codec->s_parse.pu1_luma_intra_pred_mode_top
 1044|      7|                        + (ps_codec->s_parse.s_cu.i4_pos_x * 2);
 1045|       |
 1046|      7|        pu1_luma_intra_pred_mode_left = ps_codec->s_parse.pu1_luma_intra_pred_mode_left
 1047|      7|                        + (ps_codec->s_parse.s_cu.i4_pos_y * 2);
 1048|       |
 1049|      7|        num_pred_blocks = 1; /* Because PCM part mode will be 2Nx2N */
 1050|       |
 1051|      7|        ps_codec->s_func_selector.ihevc_memset_fptr(pu1_luma_intra_pred_mode_left, INTRA_DC, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  504|      7|#define INTRA_DC                 1
  ------------------
                      ps_codec->s_func_selector.ihevc_memset_fptr(pu1_luma_intra_pred_mode_left, INTRA_DC, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  357|      7|#define MIN_PU_SIZE         4
  ------------------
 1052|      7|        ps_codec->s_func_selector.ihevc_memset_fptr(pu1_luma_intra_pred_mode_top, INTRA_DC, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  504|      7|#define INTRA_DC                 1
  ------------------
                      ps_codec->s_func_selector.ihevc_memset_fptr(pu1_luma_intra_pred_mode_top, INTRA_DC, (cb_size / num_pred_blocks) / MIN_PU_SIZE);
  ------------------
  |  |  357|      7|#define MIN_PU_SIZE         4
  ------------------
 1053|       |
 1054|       |
 1055|       |        /* Set no_loop_filter appropriately */
 1056|      7|        if(1 == ps_sps->i1_pcm_loop_filter_disable_flag)
  ------------------
  |  Branch (1056:12): [True: 7, False: 0]
  ------------------
 1057|      7|        {
 1058|      7|            UWORD8 *pu1_pic_no_loop_filter_flag;
 1059|      7|            WORD32 numbytes_row;
 1060|      7|            UWORD32 u4_mask;
 1061|       |
 1062|      7|            pu1_pic_no_loop_filter_flag = ps_codec->s_parse.pu1_pic_no_loop_filter_flag;
 1063|      7|            numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
 1064|      7|            pu1_pic_no_loop_filter_flag += (y0 / 8) * numbytes_row;
 1065|      7|            pu1_pic_no_loop_filter_flag += (x0 / 64);
 1066|       |            /* Generate (cb_size / 8) number of 1s */
 1067|       |            /* i.e (log2_cb_size - 2) number of 1s */
 1068|      7|            u4_mask = LSB_ONES((cb_size >> 3));
  ------------------
  |  |   72|      7|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 1069|     14|            for(i = 0; i < (cb_size / 8); i++)
  ------------------
  |  Branch (1069:24): [True: 7, False: 7]
  ------------------
 1070|      7|            {
 1071|      7|                *pu1_pic_no_loop_filter_flag |= (u4_mask << (((x0) / 8) % 8));
 1072|      7|                pu1_pic_no_loop_filter_flag += numbytes_row;
 1073|      7|            }
 1074|      7|        }
 1075|       |        /* Increment ps_tu and tu_idx */
 1076|      7|        ps_codec->s_parse.ps_tu++;
 1077|      7|        ps_codec->s_parse.s_cu.i4_tu_cnt++;
 1078|      7|        ps_codec->s_parse.i4_pic_tu_idx++;
 1079|       |
 1080|      7|    }
 1081|  4.99M|    else
 1082|  4.99M|    {
 1083|  4.99M|        WORD32 cnt = 0;
 1084|  4.99M|        WORD32 i;
 1085|  4.99M|        WORD32 part_cnt;
 1086|       |
 1087|  4.99M|        part_cnt = (part_mode == PART_NxN) ? 4 : 1;
  ------------------
  |  Branch (1087:20): [True: 516k, False: 4.47M]
  ------------------
 1088|       |
 1089|  11.5M|        for(i = 0; i < part_cnt; i++)
  ------------------
  |  Branch (1089:20): [True: 6.54M, False: 4.99M]
  ------------------
 1090|  6.54M|        {
 1091|  6.54M|            TRACE_CABAC_CTXT("prev_intra_pred_luma_flag", ps_cabac->u4_range, IHEVC_CAB_INTRA_LUMA_PRED_FLAG);
 1092|  6.54M|            value = ihevcd_cabac_decode_bin(ps_cabac,
 1093|  6.54M|                                            ps_bitstrm,
 1094|  6.54M|                                            IHEVC_CAB_INTRA_LUMA_PRED_FLAG);
 1095|       |
 1096|  6.54M|            ps_codec->s_parse.s_cu.ai4_prev_intra_luma_pred_flag[i] =
 1097|  6.54M|                            value;
 1098|  6.54M|            AEV_TRACE("prev_intra_pred_luma_flag", value, ps_cabac->u4_range);
 1099|  6.54M|        }
 1100|       |
 1101|  11.5M|        for(i = 0; i < part_cnt; i++)
  ------------------
  |  Branch (1101:20): [True: 6.54M, False: 4.99M]
  ------------------
 1102|  6.54M|        {
 1103|  6.54M|            if(ps_codec->s_parse.s_cu.ai4_prev_intra_luma_pred_flag[cnt])
  ------------------
  |  Branch (1103:16): [True: 4.67M, False: 1.86M]
  ------------------
 1104|  4.67M|            {
 1105|  4.67M|                value = ihevcd_cabac_decode_bypass_bins_tunary(ps_cabac, ps_bitstrm, 2);
 1106|  4.67M|                AEV_TRACE("mpm_idx", value, ps_cabac->u4_range);
 1107|  4.67M|                ps_codec->s_parse.s_cu.ai4_mpm_idx[cnt] = value;
 1108|  4.67M|            }
 1109|  1.86M|            else
 1110|  1.86M|            {
 1111|  1.86M|                value = ihevcd_cabac_decode_bypass_bins(ps_cabac, ps_bitstrm, 5);
 1112|  1.86M|                AEV_TRACE("rem_intra_luma_pred_mode", value,
 1113|  1.86M|                          ps_cabac->u4_range);
 1114|  1.86M|                ps_codec->s_parse.s_cu.ai4_rem_intra_luma_pred_mode[cnt] =
 1115|  1.86M|                                value;
 1116|  1.86M|            }
 1117|  6.54M|            cnt++;
 1118|  6.54M|        }
 1119|  4.99M|        TRACE_CABAC_CTXT("intra_chroma_pred_mode", ps_cabac->u4_range, IHEVC_CAB_CHROMA_PRED_MODE);
 1120|  4.99M|        value = ihevcd_cabac_decode_bin(ps_cabac,
 1121|  4.99M|                                        ps_bitstrm,
 1122|  4.99M|                                        IHEVC_CAB_CHROMA_PRED_MODE);
 1123|  4.99M|        ps_codec->s_parse.s_cu.i4_intra_chroma_pred_mode_idx = 4;
 1124|  4.99M|        if(value)
  ------------------
  |  Branch (1124:12): [True: 562k, False: 4.43M]
  ------------------
 1125|   562k|        {
 1126|   562k|            ps_codec->s_parse.s_cu.i4_intra_chroma_pred_mode_idx =
 1127|   562k|                            ihevcd_cabac_decode_bypass_bins(ps_cabac,
 1128|   562k|                                                            ps_bitstrm, 2);
 1129|   562k|        }
 1130|  4.99M|        AEV_TRACE("intra_chroma_pred_mode",
 1131|  4.99M|                  ps_codec->s_parse.s_cu.i4_intra_chroma_pred_mode_idx,
 1132|  4.99M|                  ps_cabac->u4_range);
 1133|       |
 1134|       |
 1135|  4.99M|        ihevcd_intra_pred_mode_prediction(ps_codec, log2_cb_size, x0, y0);
 1136|  4.99M|    }
 1137|  4.99M|    STATS_UPDATE_PU_SIZE(ps_pu);
  ------------------
  |  |  145|  4.99M|#define STATS_UPDATE_PU_SIZE(ps_pu) ;
  ------------------
 1138|       |    /* Increment PU pointer */
 1139|  4.99M|    ps_codec->s_parse.ps_pu++;
 1140|  4.99M|    ps_codec->s_parse.i4_pic_pu_idx++;
 1141|       |
 1142|  4.99M|    return ret;
 1143|  4.99M|}
ihevcd_parse_coding_unit:
 1168|  5.59M|{
 1169|  5.59M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1170|  5.59M|    sps_t *ps_sps;
 1171|  5.59M|    pps_t *ps_pps;
 1172|  5.59M|    WORD32 cb_size;
 1173|  5.59M|    slice_header_t *ps_slice_hdr;
 1174|  5.59M|    WORD32 skip_flag;
 1175|  5.59M|    WORD32 pcm_flag;
 1176|  5.59M|    UWORD32 *pu4_skip_top = ps_codec->s_parse.pu4_skip_cu_top;
 1177|  5.59M|    UWORD32 u4_skip_left = ps_codec->s_parse.u4_skip_cu_left;
 1178|  5.59M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 1179|  5.59M|    tu_t *ps_tu = ps_codec->s_parse.ps_tu;
 1180|       |
 1181|  5.59M|    WORD32 cu_pos_x;
 1182|  5.59M|    WORD32 cu_pos_y;
 1183|  5.59M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
 1184|       |
 1185|  5.59M|    ASSERT(0 == (x0 % 8));
  ------------------
  |  |   55|  5.59M|#define ASSERT(x) assert((x))
  ------------------
 1186|  5.59M|    ASSERT(0 == (y0 % 8));
  ------------------
  |  |   55|  5.59M|#define ASSERT(x) assert((x))
  ------------------
 1187|       |
 1188|  5.59M|    ps_codec->s_parse.s_cu.i4_tu_cnt = 0;
 1189|  5.59M|    ps_sps = ps_codec->s_parse.ps_sps;
 1190|  5.59M|    ps_pps = ps_codec->s_parse.ps_pps;
 1191|       |
 1192|  5.59M|    cu_pos_x = ps_codec->s_parse.s_cu.i4_pos_x;
 1193|  5.59M|    cu_pos_y = ps_codec->s_parse.s_cu.i4_pos_y;
 1194|       |
 1195|       |
 1196|       |
 1197|  5.59M|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
 1198|       |
 1199|       |
 1200|  5.59M|    cb_size = 1 << log2_cb_size;
 1201|       |
 1202|  5.59M|    ps_codec->s_parse.s_cu.i4_cu_transquant_bypass = 0;
 1203|       |
 1204|  5.59M|    if(ps_pps->i1_transquant_bypass_enable_flag)
  ------------------
  |  Branch (1204:8): [True: 109k, False: 5.48M]
  ------------------
 1205|   109k|    {
 1206|   109k|        TRACE_CABAC_CTXT("cu_transquant_bypass_flag", ps_cabac->u4_range, IHEVC_CAB_CU_TQ_BYPASS_FLAG);
 1207|   109k|        ps_codec->s_parse.s_cu.i4_cu_transquant_bypass =
 1208|   109k|                        ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm,
 1209|   109k|                                                IHEVC_CAB_CU_TQ_BYPASS_FLAG);
 1210|       |        /* Update transquant_bypass in ps_tu */
 1211|       |
 1212|   109k|        AEV_TRACE("cu_transquant_bypass_flag", ps_codec->s_parse.s_cu.i4_cu_transquant_bypass,
 1213|   109k|                  ps_cabac->u4_range);
 1214|       |
 1215|   109k|        if(ps_codec->s_parse.s_cu.i4_cu_transquant_bypass)
  ------------------
  |  Branch (1215:12): [True: 33.2k, False: 76.1k]
  ------------------
 1216|  33.2k|        {
 1217|  33.2k|            UWORD8 *pu1_pic_no_loop_filter_flag = ps_codec->s_parse.pu1_pic_no_loop_filter_flag;
 1218|  33.2k|            UWORD32 u4_mask;
 1219|  33.2k|            WORD32 i;
 1220|  33.2k|            WORD32 numbytes_row;
 1221|  33.2k|            numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
 1222|  33.2k|            pu1_pic_no_loop_filter_flag += (y0 / 8) * numbytes_row;
 1223|  33.2k|            pu1_pic_no_loop_filter_flag += (x0 / 64);
 1224|       |
 1225|       |            /* Generate (cb_size / 8) number of 1s */
 1226|       |            /* i.e (log2_cb_size - 2) number of 1s */
 1227|  33.2k|            u4_mask = LSB_ONES((cb_size >> 3));
  ------------------
  |  |   72|  33.2k|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 1228|   153k|            for(i = 0; i < (cb_size / 8); i++)
  ------------------
  |  Branch (1228:24): [True: 120k, False: 33.2k]
  ------------------
 1229|   120k|            {
 1230|   120k|                *pu1_pic_no_loop_filter_flag |= (u4_mask << (((x0) / 8) % 8));
 1231|   120k|                pu1_pic_no_loop_filter_flag += numbytes_row;
 1232|   120k|            }
 1233|  33.2k|        }
 1234|   109k|    }
 1235|       |
 1236|  5.59M|    {
 1237|  5.59M|        UWORD32 u4_skip_top = 0;
 1238|  5.59M|        UWORD32 u4_mask;
 1239|  5.59M|        UWORD32 u4_top_mask, u4_left_mask;
 1240|  5.59M|        UWORD32 u4_min_cu_x = x0 / 8;
 1241|  5.59M|        UWORD32 u4_min_cu_y = y0 / 8;
 1242|       |
 1243|  5.59M|        pu4_skip_top += (u4_min_cu_x / 32);
 1244|       |
 1245|       |
 1246|  5.59M|        if(ps_slice_hdr->i1_slice_type != ISLICE)
  ------------------
  |  Branch (1246:12): [True: 644k, False: 4.94M]
  ------------------
 1247|   644k|        {
 1248|   644k|            WORD32 ctx_idx_inc;
 1249|   644k|            ctx_idx_inc = 0;
 1250|       |
 1251|   644k|            if((0 != cu_pos_y) ||
  ------------------
  |  Branch (1251:16): [True: 492k, False: 152k]
  ------------------
 1252|   644k|                            ((0 != ps_codec->s_parse.i4_ctb_slice_y) &&
  ------------------
  |  Branch (1252:30): [True: 132k, False: 19.7k]
  ------------------
 1253|   152k|                                            (0 != ps_codec->s_parse.i4_ctb_tile_y)))
  ------------------
  |  Branch (1253:45): [True: 129k, False: 3.31k]
  ------------------
 1254|   621k|            {
 1255|   621k|                u4_skip_top = *pu4_skip_top;
 1256|   621k|                u4_skip_top >>= (u4_min_cu_x % 32);
 1257|   621k|                if(u4_skip_top & 1)
  ------------------
  |  Branch (1257:20): [True: 358k, False: 262k]
  ------------------
 1258|   358k|                    ctx_idx_inc++;
 1259|   621k|            }
 1260|       |
 1261|       |            /*****************************************************************/
 1262|       |            /* If cu_pos_x is non-zero then left is available                */
 1263|       |            /* If cu_pos_x is zero then ensure both the following are true   */
 1264|       |            /*    Current CTB is not the first CTB in a tile row             */
 1265|       |            /*    Current CTB is not the first CTB in a slice                */
 1266|       |            /*****************************************************************/
 1267|   644k|            if((0 != cu_pos_x) ||
  ------------------
  |  Branch (1267:16): [True: 486k, False: 158k]
  ------------------
 1268|   644k|                            (((0 != ps_codec->s_parse.i4_ctb_slice_x) || (0 != ps_codec->s_parse.i4_ctb_slice_y)) &&
  ------------------
  |  Branch (1268:31): [True: 142k, False: 15.6k]
  |  Branch (1268:74): [True: 13.0k, False: 2.63k]
  ------------------
 1269|   158k|                                            (0 != ps_codec->s_parse.i4_ctb_tile_x)))
  ------------------
  |  Branch (1269:45): [True: 141k, False: 13.7k]
  ------------------
 1270|   628k|            {
 1271|   628k|                u4_skip_left >>= (u4_min_cu_y % 32);
 1272|   628k|                if(u4_skip_left & 1)
  ------------------
  |  Branch (1272:20): [True: 356k, False: 271k]
  ------------------
 1273|   356k|                    ctx_idx_inc++;
 1274|   628k|            }
 1275|   644k|            TRACE_CABAC_CTXT("cu_skip_flag", ps_cabac->u4_range, (IHEVC_CAB_SKIP_FLAG + ctx_idx_inc));
 1276|   644k|            skip_flag = ihevcd_cabac_decode_bin(ps_cabac,
 1277|   644k|                                                ps_bitstrm,
 1278|   644k|                                                (IHEVC_CAB_SKIP_FLAG + ctx_idx_inc));
 1279|       |
 1280|   644k|            AEV_TRACE("cu_skip_flag", skip_flag, ps_cabac->u4_range);
 1281|   644k|        }
 1282|  4.94M|        else
 1283|  4.94M|            skip_flag = 0;
 1284|       |
 1285|       |        /* Update top skip_flag */
 1286|  5.59M|        u4_skip_top = *pu4_skip_top;
 1287|       |        /* Since Max cb_size is 64, maximum of 8 bits will be set or reset */
 1288|       |        /* Also since Coding block will be within 64x64 grid, only 8bits within a WORD32
 1289|       |         * need to be updated. These 8 bits will not cross 8 bit boundaries
 1290|       |         */
 1291|  5.59M|        u4_mask = LSB_ONES(cb_size / 8);
  ------------------
  |  |   72|  5.59M|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 1292|  5.59M|        u4_top_mask = u4_mask << (u4_min_cu_x % 32);
 1293|       |
 1294|       |
 1295|  5.59M|        if(skip_flag)
  ------------------
  |  Branch (1295:12): [True: 367k, False: 5.22M]
  ------------------
 1296|   367k|        {
 1297|   367k|            u4_skip_top |= u4_top_mask;
 1298|   367k|        }
 1299|  5.22M|        else
 1300|  5.22M|        {
 1301|  5.22M|            u4_skip_top &= ~u4_top_mask;
 1302|  5.22M|        }
 1303|  5.59M|        *pu4_skip_top = u4_skip_top;
 1304|       |
 1305|       |        /* Update left skip_flag */
 1306|  5.59M|        u4_skip_left = ps_codec->s_parse.u4_skip_cu_left;
 1307|  5.59M|        u4_mask = LSB_ONES(cb_size / 8);
  ------------------
  |  |   72|  5.59M|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 1308|  5.59M|        u4_left_mask = u4_mask << (u4_min_cu_y % 32);
 1309|       |
 1310|  5.59M|        if(skip_flag)
  ------------------
  |  Branch (1310:12): [True: 367k, False: 5.22M]
  ------------------
 1311|   367k|        {
 1312|   367k|            u4_skip_left |= u4_left_mask;
 1313|   367k|        }
 1314|  5.22M|        else
 1315|  5.22M|        {
 1316|  5.22M|            u4_skip_left &= ~u4_left_mask;
 1317|  5.22M|        }
 1318|  5.59M|        ps_codec->s_parse.u4_skip_cu_left = u4_skip_left;
 1319|  5.59M|    }
 1320|  5.59M|    ps_codec->s_parse.i4_cu_pcm_flag = 0;
 1321|       |
 1322|  5.59M|    if(skip_flag)
  ------------------
  |  Branch (1322:8): [True: 367k, False: 5.22M]
  ------------------
 1323|   367k|    {
 1324|   367k|        WORD32 ctb_x_base;
 1325|   367k|        WORD32 ctb_y_base;
 1326|       |
 1327|   367k|        ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size;
 1328|   367k|        ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size;
 1329|       |
 1330|   367k|        ps_tu->b1_cb_cbf = 0;
 1331|   367k|        ps_tu->b1_cr_cbf = 0;
 1332|   367k|        ps_tu->b1_y_cbf = 0;
 1333|   367k|        ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2);
 1334|   367k|        ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2);
 1335|   367k|        ps_tu->b1_transquant_bypass = 0;
 1336|   367k|        ps_tu->b3_size = (log2_cb_size - 2);
 1337|   367k|        ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
 1338|   367k|        ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  518|   367k|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
 1339|   367k|        ps_tu->b6_luma_intra_mode   = INTRA_PRED_NONE;
  ------------------
  |  |  511|   367k|#define INTRA_PRED_NONE  63
  ------------------
 1340|       |
 1341|       |        /* Set the first TU in CU flag */
 1342|   367k|        {
 1343|   367k|            if((ps_codec->s_parse.s_cu.i4_pos_x << 3) == (ps_tu->b4_pos_x << 2) &&
  ------------------
  |  Branch (1343:16): [True: 367k, False: 0]
  ------------------
 1344|   367k|                            (ps_codec->s_parse.s_cu.i4_pos_y << 3) == (ps_tu->b4_pos_y << 2))
  ------------------
  |  Branch (1344:29): [True: 367k, False: 0]
  ------------------
 1345|   367k|            {
 1346|   367k|                ps_tu->b1_first_tu_in_cu = 1;
 1347|   367k|            }
 1348|      0|            else
 1349|      0|            {
 1350|      0|                ps_tu->b1_first_tu_in_cu = 0;
 1351|      0|            }
 1352|   367k|        }
 1353|       |
 1354|   367k|        ps_codec->s_parse.ps_tu++;
 1355|   367k|        ps_codec->s_parse.s_cu.i4_tu_cnt++;
 1356|   367k|        ps_codec->s_parse.i4_pic_tu_idx++;
 1357|       |
 1358|   367k|        ps_codec->s_parse.s_cu.i4_pred_mode = PRED_MODE_SKIP;
 1359|   367k|        ps_codec->s_parse.s_cu.i4_part_mode = PART_2Nx2N;
 1360|   367k|        {
 1361|   367k|            pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1362|   367k|            ps_pu->b2_part_idx = 0;
 1363|   367k|            ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size, cb_size);
 1364|   367k|            STATS_UPDATE_PU_SKIP_SIZE(ps_pu);
  ------------------
  |  |  146|   367k|#define STATS_UPDATE_PU_SKIP_SIZE(ps_pu) ;
  ------------------
 1365|   367k|        }
 1366|   367k|    }
 1367|  5.22M|    else
 1368|  5.22M|    {
 1369|  5.22M|        WORD32 pred_mode;
 1370|  5.22M|        WORD32 part_mode;
 1371|  5.22M|        WORD32 intra_split_flag;
 1372|  5.22M|        WORD32 is_mincb;
 1373|  5.22M|        cb_size = (1 << log2_cb_size);
 1374|  5.22M|        is_mincb = (cb_size == (1 << ps_sps->i1_log2_min_coding_block_size));
 1375|  5.22M|        pcm_flag = 0;
 1376|  5.22M|        if(ps_slice_hdr->i1_slice_type != ISLICE)
  ------------------
  |  Branch (1376:12): [True: 276k, False: 4.94M]
  ------------------
 1377|   276k|        {
 1378|   276k|            TRACE_CABAC_CTXT("pred_mode_flag", ps_cabac->u4_range, IHEVC_CAB_PRED_MODE);
 1379|   276k|            pred_mode = ihevcd_cabac_decode_bin(ps_cabac,
 1380|   276k|                                                ps_bitstrm,
 1381|   276k|                                                IHEVC_CAB_PRED_MODE);
 1382|       |
 1383|   276k|            AEV_TRACE("pred_mode_flag", pred_mode, ps_cabac->u4_range);
 1384|   276k|        }
 1385|  4.94M|        else
 1386|  4.94M|        {
 1387|  4.94M|            pred_mode = PRED_MODE_INTRA;
 1388|  4.94M|        }
 1389|       |
 1390|       |        /* If current CU is intra then set corresponging bit in picture level intra map */
 1391|  5.22M|        if(PRED_MODE_INTRA == pred_mode)
  ------------------
  |  Branch (1391:12): [True: 4.99M, False: 229k]
  ------------------
 1392|  4.99M|        {
 1393|  4.99M|            UWORD8 *pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag;
 1394|  4.99M|            UWORD32 u4_mask;
 1395|  4.99M|            WORD32 i;
 1396|  4.99M|            WORD32 numbytes_row;
 1397|  4.99M|            numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
 1398|  4.99M|            pu1_pic_intra_flag += (y0 / 8) * numbytes_row;
 1399|  4.99M|            pu1_pic_intra_flag += (x0 / 64);
 1400|       |
 1401|       |            /* Generate (cb_size / 8) number of 1s */
 1402|       |            /* i.e (log2_cb_size - 2) number of 1s */
 1403|  4.99M|            u4_mask = LSB_ONES((cb_size >> 3));
  ------------------
  |  |   72|  4.99M|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 1404|  18.9M|            for(i = 0; i < (cb_size / 8); i++)
  ------------------
  |  Branch (1404:24): [True: 13.9M, False: 4.99M]
  ------------------
 1405|  13.9M|            {
 1406|  13.9M|                *pu1_pic_intra_flag |= (u4_mask << (((x0) / 8) % 8));
 1407|  13.9M|                pu1_pic_intra_flag += numbytes_row;
 1408|  13.9M|            }
 1409|  4.99M|        }
 1410|       |
 1411|  5.22M|        ps_codec->s_parse.s_cu.i4_pred_mode = pred_mode;
 1412|  5.22M|        intra_split_flag = 0;
 1413|  5.22M|        if((PRED_MODE_INTRA != pred_mode) ||
  ------------------
  |  Branch (1413:12): [True: 229k, False: 4.99M]
  ------------------
 1414|  5.22M|                        is_mincb)
  ------------------
  |  Branch (1414:25): [True: 3.64M, False: 1.35M]
  ------------------
 1415|  3.87M|        {
 1416|  3.87M|            UWORD32 bin;
 1417|  3.87M|            if(PRED_MODE_INTRA == pred_mode)
  ------------------
  |  Branch (1417:16): [True: 3.64M, False: 229k]
  ------------------
 1418|  3.64M|            {
 1419|  3.64M|                TRACE_CABAC_CTXT("part_mode", ps_cabac->u4_range, IHEVC_CAB_PART_MODE);
 1420|  3.64M|                bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, IHEVC_CAB_PART_MODE);
 1421|  3.64M|                part_mode = (bin) ? PART_2Nx2N : PART_NxN;
  ------------------
  |  Branch (1421:29): [True: 3.12M, False: 516k]
  ------------------
 1422|  3.64M|            }
 1423|   229k|            else
 1424|   229k|            {
 1425|   229k|                WORD32 amp_enabled = ps_sps->i1_amp_enabled_flag;
 1426|       |
 1427|   229k|                UWORD32 u4_max_bin_cnt = 0;
 1428|       |
 1429|       |
 1430|       |
 1431|   229k|                if(amp_enabled && !is_mincb)
  ------------------
  |  Branch (1431:20): [True: 214k, False: 15.8k]
  |  Branch (1431:35): [True: 52.7k, False: 161k]
  ------------------
 1432|  52.7k|                {
 1433|  52.7k|                    part_mode = ihevcd_parse_part_mode_amp(ps_cabac, ps_bitstrm);
 1434|  52.7k|                }
 1435|   177k|                else
 1436|   177k|                {
 1437|   177k|                    WORD32 ctxt_inc = IHEVC_CAB_PART_MODE;
 1438|       |
 1439|   177k|                    u4_max_bin_cnt = 2;
 1440|   177k|                    if((is_mincb) && (cb_size > 8))
  ------------------
  |  Branch (1440:24): [True: 171k, False: 5.53k]
  |  Branch (1440:38): [True: 2.79k, False: 168k]
  ------------------
 1441|  2.79k|                    {
 1442|  2.79k|                        u4_max_bin_cnt++;
 1443|  2.79k|                    }
 1444|       |
 1445|   177k|                    part_mode = -1;
 1446|   177k|                    TRACE_CABAC_CTXT("part_mode", ps_cabac->u4_range, IHEVC_CAB_PART_MODE);
 1447|   177k|                    do
 1448|   311k|                    {
 1449|   311k|                        bin = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm,
 1450|   311k|                                                      ctxt_inc++);
 1451|   311k|                        part_mode++;
 1452|   311k|                    }while(--u4_max_bin_cnt && !bin);
  ------------------
  |  Branch (1452:28): [True: 179k, False: 131k]
  |  Branch (1452:48): [True: 133k, False: 45.2k]
  ------------------
 1453|       |
 1454|       |                    /* If the last bin was zero, then increment part mode by 1 */
 1455|   177k|                    if(!bin)
  ------------------
  |  Branch (1455:24): [True: 72.0k, False: 105k]
  ------------------
 1456|  72.0k|                        part_mode++;
 1457|   177k|                }
 1458|       |
 1459|       |
 1460|   229k|            }
 1461|       |
 1462|  3.87M|            AEV_TRACE("part_mode", part_mode, ps_cabac->u4_range);
 1463|       |
 1464|  3.87M|        }
 1465|  1.35M|        else
 1466|  1.35M|        {
 1467|  1.35M|            part_mode = 0;
 1468|  1.35M|            intra_split_flag = 0;
 1469|  1.35M|        }
 1470|  5.22M|        ps_codec->s_parse.s_cu.i4_part_mode = part_mode;
 1471|       |
 1472|  5.22M|        if((PRED_MODE_INTRA == ps_codec->s_parse.s_cu.i4_pred_mode) &&
  ------------------
  |  Branch (1472:12): [True: 4.99M, False: 229k]
  ------------------
 1473|  5.22M|                        (PART_NxN == ps_codec->s_parse.s_cu.i4_part_mode))
  ------------------
  |  Branch (1473:25): [True: 516k, False: 4.47M]
  ------------------
 1474|   516k|        {
 1475|   516k|            intra_split_flag = 1;
 1476|   516k|        }
 1477|  5.22M|        ps_codec->s_parse.s_cu.i4_part_mode = part_mode;
 1478|  5.22M|        ps_codec->s_parse.s_cu.i4_intra_split_flag = intra_split_flag;
 1479|  5.22M|        if(pred_mode == PRED_MODE_INTRA)
  ------------------
  |  Branch (1479:12): [True: 4.99M, False: 229k]
  ------------------
 1480|  4.99M|        {
 1481|  4.99M|            ps_codec->s_parse.i4_cu_pcm_flag = 0;
 1482|  4.99M|            ihevcd_parse_coding_unit_intra(ps_codec, x0, y0, log2_cb_size);
 1483|  4.99M|            pcm_flag = ps_codec->s_parse.i4_cu_pcm_flag;
 1484|       |
 1485|  4.99M|        }
 1486|   229k|        else
 1487|   229k|        {
 1488|   229k|            if(part_mode == PART_2Nx2N)
  ------------------
  |  Branch (1488:16): [True: 57.7k, False: 172k]
  ------------------
 1489|  57.7k|            {
 1490|  57.7k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1491|  57.7k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size, cb_size);
 1492|  57.7k|                ps_pu->b2_part_idx = 0;
 1493|  57.7k|            }
 1494|   172k|            else if(part_mode == PART_2NxN)
  ------------------
  |  Branch (1494:21): [True: 65.6k, False: 106k]
  ------------------
 1495|  65.6k|            {
 1496|  65.6k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1497|       |
 1498|  65.6k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size, cb_size / 2);
 1499|  65.6k|                ps_pu->b2_part_idx = 0;
 1500|       |
 1501|  65.6k|                ps_pu = ps_codec->s_parse.ps_pu;
 1502|  65.6k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0 + (cb_size / 2), cb_size, cb_size / 2);
 1503|       |
 1504|  65.6k|                ps_pu->b2_part_idx = 1;
 1505|  65.6k|            }
 1506|   106k|            else if(part_mode == PART_Nx2N)
  ------------------
  |  Branch (1506:21): [True: 76.5k, False: 29.8k]
  ------------------
 1507|  76.5k|            {
 1508|  76.5k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1509|  76.5k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size / 2, cb_size);
 1510|  76.5k|                ps_pu->b2_part_idx = 0;
 1511|  76.5k|                ps_pu = ps_codec->s_parse.ps_pu;
 1512|  76.5k|                ihevcd_parse_prediction_unit(ps_codec, x0 + (cb_size / 2), y0, cb_size / 2, cb_size);
 1513|       |
 1514|  76.5k|                ps_pu->b2_part_idx = 1;
 1515|  76.5k|            }
 1516|  29.8k|            else if(part_mode == PART_2NxnU)
  ------------------
  |  Branch (1516:21): [True: 4.35k, False: 25.5k]
  ------------------
 1517|  4.35k|            {
 1518|  4.35k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1519|  4.35k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size, cb_size / 4);
 1520|  4.35k|                ps_pu->b2_part_idx = 0;
 1521|  4.35k|                ps_pu = ps_codec->s_parse.ps_pu;
 1522|  4.35k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0 + (cb_size / 4), cb_size, cb_size * 3 / 4);
 1523|       |
 1524|  4.35k|                ps_pu->b2_part_idx = 1;
 1525|  4.35k|            }
 1526|  25.5k|            else if(part_mode == PART_2NxnD)
  ------------------
  |  Branch (1526:21): [True: 3.20k, False: 22.3k]
  ------------------
 1527|  3.20k|            {
 1528|  3.20k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1529|  3.20k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size, cb_size * 3 / 4);
 1530|  3.20k|                ps_pu->b2_part_idx = 0;
 1531|  3.20k|                ps_pu = ps_codec->s_parse.ps_pu;
 1532|  3.20k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0 + (cb_size * 3 / 4), cb_size, cb_size / 4);
 1533|       |
 1534|  3.20k|                ps_pu->b2_part_idx = 1;
 1535|  3.20k|            }
 1536|  22.3k|            else if(part_mode == PART_nLx2N)
  ------------------
  |  Branch (1536:21): [True: 16.7k, False: 5.56k]
  ------------------
 1537|  16.7k|            {
 1538|  16.7k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1539|  16.7k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size / 4, cb_size);
 1540|  16.7k|                ps_pu->b2_part_idx = 0;
 1541|  16.7k|                ps_pu = ps_codec->s_parse.ps_pu;
 1542|  16.7k|                ihevcd_parse_prediction_unit(ps_codec, x0 + (cb_size / 4), y0, cb_size * 3 / 4, cb_size);
 1543|       |
 1544|  16.7k|                ps_pu->b2_part_idx = 1;
 1545|  16.7k|            }
 1546|  5.56k|            else if(part_mode == PART_nRx2N)
  ------------------
  |  Branch (1546:21): [True: 4.22k, False: 1.34k]
  ------------------
 1547|  4.22k|            {
 1548|  4.22k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1549|  4.22k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size * 3 / 4, cb_size);
 1550|  4.22k|                ps_pu->b2_part_idx = 0;
 1551|  4.22k|                ps_pu = ps_codec->s_parse.ps_pu;
 1552|  4.22k|                ihevcd_parse_prediction_unit(ps_codec, x0 + (cb_size * 3 / 4), y0, cb_size / 4, cb_size);
 1553|  4.22k|                ps_pu->b2_part_idx = 1;
 1554|  4.22k|            }
 1555|  1.34k|            else
 1556|  1.34k|            { /* PART_NxN */
 1557|  1.34k|                pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 1558|       |
 1559|  1.34k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0, cb_size / 2, cb_size / 2);
 1560|  1.34k|                ps_pu->b2_part_idx = 0;
 1561|  1.34k|                ps_pu = ps_codec->s_parse.ps_pu;
 1562|  1.34k|                ihevcd_parse_prediction_unit(ps_codec, x0 + (cb_size / 2), y0, cb_size / 2, cb_size / 2);
 1563|       |
 1564|  1.34k|                ps_pu->b2_part_idx = 1;
 1565|  1.34k|                ps_pu = ps_codec->s_parse.ps_pu;
 1566|  1.34k|                ihevcd_parse_prediction_unit(ps_codec, x0, y0 + (cb_size / 2), cb_size / 2, cb_size / 2);
 1567|       |
 1568|  1.34k|                ps_pu->b2_part_idx = 2;
 1569|  1.34k|                ps_pu = ps_codec->s_parse.ps_pu;
 1570|  1.34k|                ihevcd_parse_prediction_unit(ps_codec, x0 + (cb_size / 2), y0 + (cb_size / 2), cb_size / 2, cb_size / 2);
 1571|       |
 1572|  1.34k|                ps_pu->b2_part_idx = 3;
 1573|  1.34k|            }
 1574|   229k|        }
 1575|       |
 1576|  5.22M|        if(!pcm_flag)
  ------------------
  |  Branch (1576:12): [True: 5.22M, False: 7]
  ------------------
 1577|  5.22M|        {
 1578|  5.22M|            WORD32 no_residual_syntax_flag = 0;
 1579|  5.22M|            pu_t *ps_pu;
 1580|       |            /* Since ps_pu is incremented for each PU parsed, decrement by 1 to
 1581|       |             *  access last decoded PU
 1582|       |             */
 1583|  5.22M|            ps_pu = ps_codec->s_parse.ps_pu - 1;
 1584|  5.22M|            if((PRED_MODE_INTRA != pred_mode) &&
  ------------------
  |  Branch (1584:16): [True: 229k, False: 4.99M]
  ------------------
 1585|  5.22M|                            (!((part_mode == PART_2Nx2N) && ps_pu->b1_merge_flag)))
  ------------------
  |  Branch (1585:32): [True: 57.7k, False: 172k]
  |  Branch (1585:61): [True: 20.2k, False: 37.5k]
  ------------------
 1586|   209k|            {
 1587|       |
 1588|   209k|                TRACE_CABAC_CTXT("rqt_root_cbf", ps_cabac->u4_range, IHEVC_CAB_NORES_IDX);
 1589|   209k|                no_residual_syntax_flag = ihevcd_cabac_decode_bin(ps_cabac,
 1590|   209k|                                                                  ps_bitstrm,
 1591|   209k|                                                                  IHEVC_CAB_NORES_IDX);
 1592|       |
 1593|   209k|                AEV_TRACE("rqt_root_cbf", no_residual_syntax_flag,
 1594|   209k|                          ps_cabac->u4_range);
 1595|       |                /* TODO: HACK FOR COMPLIANCE WITH HM REFERENCE DECODER */
 1596|       |                /*********************************************************/
 1597|       |                /* currently the HM decoder expects qtroot cbf instead of */
 1598|       |                /* no_residue_flag which has opposite meaning             */
 1599|       |                /* This will be fixed once the software / spec is fixed   */
 1600|       |                /*********************************************************/
 1601|   209k|                no_residual_syntax_flag = 1 - no_residual_syntax_flag;
 1602|   209k|            }
 1603|       |
 1604|  5.22M|            if(!no_residual_syntax_flag)
  ------------------
  |  Branch (1604:16): [True: 5.04M, False: 179k]
  ------------------
 1605|  5.04M|            {
 1606|       |
 1607|  5.04M|                ps_codec->s_parse.s_cu.i4_max_trafo_depth = (pred_mode == PRED_MODE_INTRA) ?
  ------------------
  |  Branch (1607:61): [True: 4.99M, False: 49.9k]
  ------------------
 1608|  4.99M|                                (ps_sps->i1_max_transform_hierarchy_depth_intra + intra_split_flag) :
 1609|  5.04M|                                (ps_sps->i1_max_transform_hierarchy_depth_inter);
 1610|  5.04M|                ret = ihevcd_parse_transform_tree(ps_codec, x0, y0, x0, y0,
 1611|  5.04M|                                                  log2_cb_size, 0, 0,
 1612|  5.04M|                                                  ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0]);
 1613|  5.04M|                RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  5.04M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 148, False: 5.04M]
  |  |  ------------------
  ------------------
 1614|  5.04M|            }
 1615|   179k|            else
 1616|   179k|            {
 1617|   179k|                WORD32 ctb_x_base;
 1618|   179k|                WORD32 ctb_y_base;
 1619|       |
 1620|   179k|                ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size;
 1621|   179k|                ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size;
 1622|       |
 1623|   179k|                ps_tu = ps_codec->s_parse.ps_tu;
 1624|   179k|                ps_tu->b1_cb_cbf = 0;
 1625|   179k|                ps_tu->b1_cr_cbf = 0;
 1626|   179k|                ps_tu->b1_y_cbf = 0;
 1627|   179k|                ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2);
 1628|   179k|                ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2);
 1629|   179k|                ps_tu->b1_transquant_bypass = 0;
 1630|   179k|                ps_tu->b3_size = (log2_cb_size - 2);
 1631|   179k|                ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
 1632|   179k|                ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  518|   179k|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
 1633|   179k|                ps_tu->b6_luma_intra_mode   = ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0];
 1634|       |
 1635|       |                /* Set the first TU in CU flag */
 1636|   179k|                {
 1637|   179k|                    if((ps_codec->s_parse.s_cu.i4_pos_x << 3) == (ps_tu->b4_pos_x << 2) &&
  ------------------
  |  Branch (1637:24): [True: 179k, False: 0]
  ------------------
 1638|   179k|                                    (ps_codec->s_parse.s_cu.i4_pos_y << 3) == (ps_tu->b4_pos_y << 2))
  ------------------
  |  Branch (1638:37): [True: 179k, False: 0]
  ------------------
 1639|   179k|                    {
 1640|   179k|                        ps_tu->b1_first_tu_in_cu = 1;
 1641|   179k|                    }
 1642|      0|                    else
 1643|      0|                    {
 1644|      0|                        ps_tu->b1_first_tu_in_cu = 0;
 1645|      0|                    }
 1646|   179k|                }
 1647|   179k|                ps_codec->s_parse.ps_tu++;
 1648|   179k|                ps_codec->s_parse.s_cu.i4_tu_cnt++;
 1649|   179k|                ps_codec->s_parse.i4_pic_tu_idx++;
 1650|       |
 1651|   179k|            }
 1652|  5.22M|        }
 1653|       |
 1654|  5.22M|    }
 1655|       |
 1656|       |
 1657|       |
 1658|       |
 1659|  5.59M|    return ret;
 1660|  5.59M|}
ihevcd_parse_coding_quadtree:
 1689|  7.19M|{
 1690|  7.19M|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 1691|  7.19M|    sps_t *ps_sps;
 1692|  7.19M|    pps_t *ps_pps;
 1693|  7.19M|    WORD32 split_cu_flag;
 1694|  7.19M|    WORD32 x1, y1;
 1695|  7.19M|    WORD32 cu_pos_x;
 1696|  7.19M|    WORD32 cu_pos_y;
 1697|  7.19M|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 1698|  7.19M|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
 1699|  7.19M|    WORD32 cb_size = 1 << log2_cb_size;
 1700|  7.19M|    ps_sps = ps_codec->s_parse.ps_sps;
 1701|  7.19M|    ps_pps = ps_codec->s_parse.ps_pps;
 1702|       |
 1703|       |    /* Compute CU position with respect to current CTB in (8x8) units */
 1704|  7.19M|    cu_pos_x = (x0 - (ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size)) >> 3;
 1705|  7.19M|    cu_pos_y = (y0 - (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size)) >> 3;
 1706|       |
 1707|  7.19M|    ps_codec->s_parse.s_cu.i4_pos_x = cu_pos_x;
 1708|  7.19M|    ps_codec->s_parse.s_cu.i4_pos_y = cu_pos_y;
 1709|       |
 1710|  7.19M|    ps_codec->s_parse.s_cu.i4_log2_cb_size = log2_cb_size;
 1711|       |
 1712|  7.19M|    ps_codec->s_parse.i4_ct_depth = ct_depth;
 1713|  7.19M|    {
 1714|  7.19M|        UWORD32 *pu4_ct_depth_top = ps_codec->s_parse.pu4_ct_depth_top;
 1715|  7.19M|        UWORD32 u4_ct_depth_left = ps_codec->s_parse.u4_ct_depth_left;
 1716|  7.19M|        UWORD32 u4_ct_depth_top = 0;
 1717|  7.19M|        UWORD32 u4_mask;
 1718|  7.19M|        UWORD32 u4_top_mask, u4_left_mask;
 1719|  7.19M|        WORD32  ctxt_idx;
 1720|  7.19M|        UWORD32 u4_min_cu_x = x0 / 8;
 1721|  7.19M|        UWORD32 u4_min_cu_y = y0 / 8;
 1722|       |
 1723|  7.19M|        pu4_ct_depth_top += (u4_min_cu_x / 16);
 1724|       |
 1725|       |
 1726|       |
 1727|       |
 1728|  7.19M|        if(((x0 + (1 << log2_cb_size)) <= ps_sps->i2_pic_width_in_luma_samples) &&
  ------------------
  |  Branch (1728:12): [True: 7.14M, False: 46.1k]
  ------------------
 1729|  7.19M|                        ((y0 + (1 << log2_cb_size)) <= ps_sps->i2_pic_height_in_luma_samples) &&
  ------------------
  |  Branch (1729:25): [True: 7.07M, False: 74.9k]
  ------------------
 1730|  7.19M|                        (log2_cb_size > ps_sps->i1_log2_min_coding_block_size))
  ------------------
  |  Branch (1730:25): [True: 2.98M, False: 4.09M]
  ------------------
 1731|  2.98M|        {
 1732|       |
 1733|  2.98M|            ctxt_idx = IHEVC_CAB_SPLIT_CU_FLAG;
 1734|       |            /* Split cu context increment is decided based on left and top Coding tree
 1735|       |             * depth which is stored at frame level
 1736|       |             */
 1737|       |            /* Check if the CTB is in first row in the current slice or tile */
 1738|  2.98M|            if((0 != cu_pos_y) ||
  ------------------
  |  Branch (1738:16): [True: 1.10M, False: 1.88M]
  ------------------
 1739|  2.98M|                            ((0 != ps_codec->s_parse.i4_ctb_slice_y) &&
  ------------------
  |  Branch (1739:30): [True: 1.53M, False: 345k]
  ------------------
 1740|  1.88M|                                            (0 != ps_codec->s_parse.i4_ctb_tile_y)))
  ------------------
  |  Branch (1740:45): [True: 1.53M, False: 3.95k]
  ------------------
 1741|  2.63M|            {
 1742|  2.63M|                u4_ct_depth_top = *pu4_ct_depth_top;
 1743|  2.63M|                u4_ct_depth_top >>= ((u4_min_cu_x % 16) * 2);
 1744|  2.63M|                u4_ct_depth_top &= 3;
 1745|       |
 1746|  2.63M|                if((WORD32)u4_ct_depth_top > ct_depth)
  ------------------
  |  Branch (1746:20): [True: 1.12M, False: 1.50M]
  ------------------
 1747|  1.12M|                    ctxt_idx++;
 1748|  2.63M|            }
 1749|       |
 1750|       |            /* Check if the CTB is in first column in the current slice or tile */
 1751|       |            /*****************************************************************/
 1752|       |            /* If cu_pos_x is non-zero then left is available                */
 1753|       |            /* If cu_pos_x is zero then ensure both the following are true   */
 1754|       |            /*    Current CTB is not the first CTB in a tile row             */
 1755|       |            /*    Current CTB is not the first CTB in a slice                */
 1756|       |            /*****************************************************************/
 1757|  2.98M|            if((0 != cu_pos_x) ||
  ------------------
  |  Branch (1757:16): [True: 1.14M, False: 1.84M]
  ------------------
 1758|  2.98M|                            (((0 != ps_codec->s_parse.i4_ctb_slice_x) || (0 != ps_codec->s_parse.i4_ctb_slice_y)) &&
  ------------------
  |  Branch (1758:31): [True: 1.78M, False: 59.3k]
  |  Branch (1758:74): [True: 44.6k, False: 14.6k]
  ------------------
 1759|  1.84M|                                            (0 != ps_codec->s_parse.i4_ctb_tile_x)))
  ------------------
  |  Branch (1759:45): [True: 1.78M, False: 47.0k]
  ------------------
 1760|  2.92M|            {
 1761|  2.92M|                u4_ct_depth_left >>= ((u4_min_cu_y % 16) * 2);
 1762|  2.92M|                u4_ct_depth_left &= 3;
 1763|  2.92M|                if((WORD32)u4_ct_depth_left > ct_depth)
  ------------------
  |  Branch (1763:20): [True: 1.36M, False: 1.55M]
  ------------------
 1764|  1.36M|                    ctxt_idx++;
 1765|  2.92M|            }
 1766|  2.98M|            TRACE_CABAC_CTXT("split_cu_flag", ps_cabac->u4_range, ctxt_idx);
 1767|  2.98M|            split_cu_flag = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 1768|  2.98M|            AEV_TRACE("split_cu_flag", split_cu_flag, ps_cabac->u4_range);
 1769|  2.98M|        }
 1770|  4.21M|        else
 1771|  4.21M|        {
 1772|  4.21M|            if(log2_cb_size > ps_sps->i1_log2_min_coding_block_size)
  ------------------
  |  Branch (1772:16): [True: 121k, False: 4.09M]
  ------------------
 1773|   121k|                split_cu_flag = 1;
 1774|  4.09M|            else
 1775|  4.09M|                split_cu_flag = 0;
 1776|  4.21M|        }
 1777|       |
 1778|  7.19M|        if(0 == split_cu_flag)
  ------------------
  |  Branch (1778:12): [True: 5.59M, False: 1.60M]
  ------------------
 1779|  5.59M|        {
 1780|       |            /* Update top ct_depth */
 1781|  5.59M|            u4_ct_depth_top = *pu4_ct_depth_top;
 1782|       |            /* Since Max cb_size is 64, maximum of 8 bits will be set or reset */
 1783|       |            /* Also since Coding block will be within 64x64 grid, only 8bits within a WORD32
 1784|       |             * need to be updated. These 8 bits will not cross 8 bit boundaries
 1785|       |             */
 1786|  5.59M|            u4_mask = DUP_LSB_11(cb_size / 8);
  ------------------
  |  |   81|  5.59M|#define DUP_LSB_11(x) ((UWORD32)0xFFFFFFFF >> (32 - ((x) * 2)))
  ------------------
 1787|       |
 1788|  5.59M|            u4_top_mask = u4_mask << ((u4_min_cu_x % 16) * 2);
 1789|  5.59M|            u4_ct_depth_top &= ~u4_top_mask;
 1790|       |
 1791|  5.59M|            if(ct_depth)
  ------------------
  |  Branch (1791:16): [True: 4.99M, False: 598k]
  ------------------
 1792|  4.99M|            {
 1793|  4.99M|                u4_top_mask = gau4_ct_depth_mask[ct_depth] & u4_mask;
 1794|       |
 1795|  4.99M|                u4_top_mask = u4_top_mask << ((u4_min_cu_x % 16) * 2);
 1796|  4.99M|                u4_ct_depth_top |= u4_top_mask;
 1797|  4.99M|            }
 1798|       |
 1799|  5.59M|            *pu4_ct_depth_top = u4_ct_depth_top;
 1800|       |
 1801|       |            /* Update left ct_depth */
 1802|  5.59M|            u4_ct_depth_left = ps_codec->s_parse.u4_ct_depth_left;
 1803|       |
 1804|  5.59M|            u4_left_mask = u4_mask << ((u4_min_cu_y % 16) * 2);
 1805|       |
 1806|  5.59M|            u4_ct_depth_left &= ~u4_left_mask;
 1807|  5.59M|            if(ct_depth)
  ------------------
  |  Branch (1807:16): [True: 4.99M, False: 598k]
  ------------------
 1808|  4.99M|            {
 1809|  4.99M|                u4_left_mask = gau4_ct_depth_mask[ct_depth] & u4_mask;
 1810|       |
 1811|  4.99M|                u4_left_mask = u4_left_mask << ((u4_min_cu_y % 16) * 2);
 1812|  4.99M|                u4_ct_depth_left |= u4_left_mask;
 1813|  4.99M|            }
 1814|       |
 1815|  5.59M|            ps_codec->s_parse.u4_ct_depth_left = u4_ct_depth_left;
 1816|  5.59M|        }
 1817|  7.19M|    }
 1818|  7.19M|    if((ps_pps->i1_cu_qp_delta_enabled_flag) &&
  ------------------
  |  Branch (1818:8): [True: 2.21M, False: 4.98M]
  ------------------
 1819|  7.19M|                    (log2_cb_size >= ps_pps->i1_log2_min_cu_qp_delta_size))
  ------------------
  |  Branch (1819:21): [True: 415k, False: 1.79M]
  ------------------
 1820|   415k|    {
 1821|   415k|        ps_codec->s_parse.i4_is_cu_qp_delta_coded = 0;
 1822|   415k|        ps_codec->s_parse.i4_cu_qp_delta = 0;
 1823|   415k|    }
 1824|  7.19M|    if(split_cu_flag)
  ------------------
  |  Branch (1824:8): [True: 1.60M, False: 5.59M]
  ------------------
 1825|  1.60M|    {
 1826|  1.60M|        x1 = x0 + ((1 << log2_cb_size) >> 1);
 1827|  1.60M|        y1 = y0 + ((1 << log2_cb_size) >> 1);
 1828|       |
 1829|  1.60M|        ret = ihevcd_parse_coding_quadtree(ps_codec, x0, y0, log2_cb_size - 1, ct_depth + 1);
 1830|  1.60M|        RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.60M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 20, False: 1.60M]
  |  |  ------------------
  ------------------
 1831|       |
 1832|       |        /* At frame boundaries coding quadtree nodes are sent only if they fall within the frame */
 1833|  1.60M|        if(x1 < ps_sps->i2_pic_width_in_luma_samples)
  ------------------
  |  Branch (1833:12): [True: 1.55M, False: 46.0k]
  ------------------
 1834|  1.55M|        {
 1835|  1.55M|            ret = ihevcd_parse_coding_quadtree(ps_codec, x1, y0, log2_cb_size - 1, ct_depth + 1);
 1836|  1.55M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.55M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 8, False: 1.55M]
  |  |  ------------------
  ------------------
 1837|  1.55M|        }
 1838|       |
 1839|  1.60M|        if(y1 < ps_sps->i2_pic_height_in_luma_samples)
  ------------------
  |  Branch (1839:12): [True: 1.53M, False: 70.1k]
  ------------------
 1840|  1.53M|        {
 1841|  1.53M|            ret = ihevcd_parse_coding_quadtree(ps_codec, x0, y1, log2_cb_size - 1, ct_depth + 1);
 1842|  1.53M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.53M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 2, False: 1.53M]
  |  |  ------------------
  ------------------
 1843|  1.53M|        }
 1844|       |
 1845|  1.60M|        if((x1 < ps_sps->i2_pic_width_in_luma_samples) &&
  ------------------
  |  Branch (1845:12): [True: 1.55M, False: 46.0k]
  ------------------
 1846|  1.60M|                        (y1 < ps_sps->i2_pic_height_in_luma_samples))
  ------------------
  |  Branch (1846:25): [True: 1.48M, False: 68.2k]
  ------------------
 1847|  1.48M|        {
 1848|  1.48M|            ret = ihevcd_parse_coding_quadtree(ps_codec, x1, y1, log2_cb_size - 1, ct_depth + 1);
 1849|  1.48M|            RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  1.48M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 375, False: 1.48M]
  |  |  ------------------
  ------------------
 1850|  1.48M|        }
 1851|  1.60M|    }
 1852|  5.59M|    else
 1853|  5.59M|    {
 1854|  5.59M|        WORD32 qp = ps_codec->s_parse.u4_qp;
 1855|       |        /* Set current group QP if current CU is aligned with the group */
 1856|  5.59M|        {
 1857|  5.59M|            WORD32 cu_pos_x = ps_codec->s_parse.s_cu.i4_pos_x << 3;
 1858|  5.59M|            WORD32 cu_pos_y = ps_codec->s_parse.s_cu.i4_pos_y << 3;
 1859|       |
 1860|  5.59M|            WORD32 qpg_x = (cu_pos_x - (cu_pos_x & ((1 << ps_pps->i1_log2_min_cu_qp_delta_size) - 1)));
 1861|  5.59M|            WORD32 qpg_y = (cu_pos_y - (cu_pos_y & ((1 << ps_pps->i1_log2_min_cu_qp_delta_size) - 1)));
 1862|       |
 1863|  5.59M|            if((cu_pos_x == qpg_x) &&
  ------------------
  |  Branch (1863:16): [True: 1.95M, False: 3.63M]
  ------------------
 1864|  5.59M|                            (cu_pos_y == qpg_y))
  ------------------
  |  Branch (1864:29): [True: 1.06M, False: 887k]
  ------------------
 1865|  1.06M|            {
 1866|  1.06M|                ps_codec->s_parse.u4_qpg = ps_codec->s_parse.u4_qp;
 1867|       |
 1868|  1.06M|                ps_codec->s_parse.s_cu.i4_cu_qp_delta = 0;
 1869|       |
 1870|  1.06M|            }
 1871|  5.59M|        }
 1872|       |
 1873|  5.59M|        ret = ihevcd_parse_coding_unit(ps_codec, x0, y0, log2_cb_size);
 1874|  5.59M|        RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret);
  ------------------
  |  |   37|  5.59M|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 148, False: 5.59M]
  |  |  ------------------
  ------------------
 1875|       |
 1876|  5.59M|        if(ps_pps->i1_cu_qp_delta_enabled_flag)
  ------------------
  |  Branch (1876:12): [True: 1.71M, False: 3.87M]
  ------------------
 1877|  1.71M|        {
 1878|  1.71M|            WORD32 qp_pred, qp_left, qp_top;
 1879|  1.71M|            WORD32 cu_pos_x;
 1880|  1.71M|            WORD32 cu_pos_y;
 1881|  1.71M|            WORD32 qpg_x;
 1882|  1.71M|            WORD32 qpg_y;
 1883|  1.71M|            WORD32 i, j;
 1884|  1.71M|            WORD32 cur_cu_offset;
 1885|  1.71M|            tu_t *ps_tu = ps_codec->s_parse.ps_tu;
 1886|  1.71M|            WORD32 cb_size = 1 << ps_codec->s_parse.s_cu.i4_log2_cb_size;
 1887|       |
 1888|  1.71M|            cu_pos_x = ps_codec->s_parse.s_cu.i4_pos_x << 3;
 1889|  1.71M|            cu_pos_y = ps_codec->s_parse.s_cu.i4_pos_y << 3;
 1890|       |
 1891|  1.71M|            qpg_x = (cu_pos_x - (cu_pos_x & ((1 << ps_pps->i1_log2_min_cu_qp_delta_size) - 1))) >> 3;
 1892|  1.71M|            qpg_y = (cu_pos_y - (cu_pos_y & ((1 << ps_pps->i1_log2_min_cu_qp_delta_size) - 1))) >> 3;
 1893|       |
 1894|       |            /*previous coded Qp*/
 1895|  1.71M|            qp_left = ps_codec->s_parse.u4_qpg;
 1896|  1.71M|            qp_top = ps_codec->s_parse.u4_qpg;
 1897|       |
 1898|  1.71M|            if(qpg_x > 0)
  ------------------
  |  Branch (1898:16): [True: 35.9k, False: 1.67M]
  ------------------
 1899|  35.9k|            {
 1900|  35.9k|                qp_left = ps_codec->s_parse.ai1_8x8_cu_qp[qpg_x - 1 + (qpg_y * 8)];
 1901|  35.9k|            }
 1902|  1.71M|            if(qpg_y > 0)
  ------------------
  |  Branch (1902:16): [True: 45.5k, False: 1.66M]
  ------------------
 1903|  45.5k|            {
 1904|  45.5k|                qp_top = ps_codec->s_parse.ai1_8x8_cu_qp[qpg_x + ((qpg_y - 1) * 8)];
 1905|  45.5k|            }
 1906|       |
 1907|  1.71M|            qp_pred = (qp_left + qp_top + 1) >> 1;
 1908|       |            /* Since qp_pred + ps_codec->s_parse.s_cu.i4_cu_qp_delta can be negative,
 1909|       |            52 is added before taking modulo 52 */
 1910|  1.71M|            qp = (qp_pred + ps_codec->s_parse.s_cu.i4_cu_qp_delta + 52) % 52;
 1911|       |
 1912|  1.71M|            cur_cu_offset = (cu_pos_x >> 3) + cu_pos_y;
 1913|  5.93M|            for(i = 0; i < (cb_size >> 3); i++)
  ------------------
  |  Branch (1913:24): [True: 4.22M, False: 1.71M]
  ------------------
 1914|  4.22M|            {
 1915|  24.2M|                for(j = 0; j < (cb_size >> 3); j++)
  ------------------
  |  Branch (1915:28): [True: 20.0M, False: 4.22M]
  ------------------
 1916|  20.0M|                {
 1917|  20.0M|                    ps_codec->s_parse.ai1_8x8_cu_qp[cur_cu_offset + (i * 8) + j] = qp;
 1918|  20.0M|                }
 1919|  4.22M|            }
 1920|       |
 1921|  1.71M|            ps_codec->s_parse.u4_qp = qp;
 1922|  1.71M|            ps_codec->s_parse.s_cu.i4_qp = qp;
 1923|       |
 1924|       |
 1925|       |            /* When change in QP is signaled, update the QP in TUs that are already parsed in the CU */
 1926|  1.71M|            {
 1927|  1.71M|                tu_t *ps_tu_tmp;
 1928|  1.71M|                ps_tu_tmp = ps_tu - ps_codec->s_parse.s_cu.i4_tu_cnt;
 1929|  1.71M|                ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
 1930|  5.68M|                while(ps_tu_tmp != ps_tu)
  ------------------
  |  Branch (1930:23): [True: 3.97M, False: 1.71M]
  ------------------
 1931|  3.97M|                {
 1932|  3.97M|                    ps_tu_tmp->b7_qp = ps_codec->s_parse.u4_qp;
 1933|       |
 1934|  3.97M|                    ps_tu_tmp++;
 1935|  3.97M|                }
 1936|  1.71M|            }
 1937|  1.71M|            if(ps_codec->s_parse.s_cu.i4_cu_qp_delta)
  ------------------
  |  Branch (1937:16): [True: 461k, False: 1.25M]
  ------------------
 1938|   461k|            {
 1939|   461k|                WORD32 ctb_indx;
 1940|   461k|                ctb_indx = ps_codec->s_parse.i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_codec->s_parse.i4_ctb_y;
 1941|   461k|                ps_codec->s_parse.s_bs_ctxt.pu1_pic_qp_const_in_ctb[ctb_indx >> 3] &= (~(1 << (ctb_indx & 7)));
 1942|   461k|            }
 1943|       |
 1944|  1.71M|        }
 1945|       |        /* Populate CU_info maps for current CU*/
 1946|  5.59M|        if(ps_codec->u1_enable_cu_info)
  ------------------
  |  Branch (1946:12): [True: 0, False: 5.59M]
  ------------------
 1947|      0|        {
 1948|      0|            WORD32 cu_info_map_stride = ALIGN64(ps_codec->i4_wd) >> 3;
  ------------------
  |  |   50|      0|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1949|      0|            UWORD8 num_8x8_blks = 1 << (log2_cb_size - 3);
 1950|      0|            WORD32 vert_8x8, horz_8x8;
 1951|      0|            UWORD8 *pu1_cur_cu_type_map =
 1952|      0|                ps_codec->as_buf_id_info_map[ps_codec->as_process[0].
 1953|      0|                    i4_cur_pic_buf_id].pu1_cu_type_map;
 1954|      0|            UWORD8 *pu1_cur_qp_map =
 1955|      0|                ps_codec->as_buf_id_info_map[ps_codec->as_process[0].i4_cur_pic_buf_id].pu1_qp_map;
 1956|      0|            UWORD8 *pu1_cur_type_cu = pu1_cur_cu_type_map + (x0 >> 3) +
 1957|      0|                (y0 >> 3) * cu_info_map_stride;
 1958|      0|            UWORD8 *pu1_cur_qp_cu = pu1_cur_qp_map + (x0 >> 3) +
 1959|      0|                (y0 >> 3) * cu_info_map_stride;
 1960|      0|            for(vert_8x8 = 0; vert_8x8 < num_8x8_blks; vert_8x8++)
  ------------------
  |  Branch (1960:31): [True: 0, False: 0]
  ------------------
 1961|      0|            {
 1962|      0|                for(horz_8x8 = 0; horz_8x8 < num_8x8_blks; horz_8x8++)
  ------------------
  |  Branch (1962:35): [True: 0, False: 0]
  ------------------
 1963|      0|                {
 1964|      0|                    pu1_cur_qp_cu[horz_8x8] = qp;
 1965|      0|                    pu1_cur_type_cu[horz_8x8] = ps_codec->s_parse.s_cu.i4_pred_mode;
 1966|      0|                }
 1967|      0|                pu1_cur_qp_cu += cu_info_map_stride;
 1968|      0|                pu1_cur_type_cu += cu_info_map_stride;
 1969|      0|            }
 1970|      0|        }
 1971|       |
 1972|  5.59M|    }
 1973|       |
 1974|       |
 1975|       |
 1976|       |
 1977|  7.19M|    return ret;
 1978|  7.19M|}
ihevcd_parse_sao:
 2001|   324k|{
 2002|   324k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2003|   324k|    sps_t *ps_sps;
 2004|   324k|    sao_t *ps_sao;
 2005|   324k|    WORD32 rx;
 2006|   324k|    WORD32 ry;
 2007|   324k|    WORD32 value;
 2008|   324k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
 2009|   324k|    WORD32 sao_merge_left_flag;
 2010|   324k|    WORD32 sao_merge_up_flag;
 2011|   324k|    slice_header_t *ps_slice_hdr;
 2012|   324k|    cab_ctxt_t *ps_cabac = &ps_codec->s_parse.s_cabac;
 2013|   324k|    WORD32 ctxt_idx;
 2014|       |
 2015|   324k|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr_base;
 2016|   324k|    ps_slice_hdr += (ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|   324k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|   324k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2017|       |
 2018|   324k|    ps_sps = (ps_codec->s_parse.ps_sps);
 2019|   324k|    rx = ps_codec->s_parse.i4_ctb_x;
 2020|   324k|    ry = ps_codec->s_parse.i4_ctb_y;
 2021|       |
 2022|   324k|    ps_sao = ps_codec->s_parse.ps_pic_sao + rx + ry * ps_sps->i2_pic_wd_in_ctb;
 2023|       |
 2024|       |    /* Default values */
 2025|   324k|    ps_sao->b3_y_type_idx = 0;
 2026|   324k|    ps_sao->b3_cb_type_idx = 0;
 2027|   324k|    ps_sao->b3_cr_type_idx = 0;
 2028|       |
 2029|   324k|    UNUSED(value);
  ------------------
  |  |   38|   324k|#define UNUSED(x) ((void)(x))
  ------------------
 2030|   324k|    ctxt_idx = IHEVC_CAB_SAO_MERGE;
 2031|   324k|    sao_merge_left_flag = 0;
 2032|   324k|    sao_merge_up_flag = 0;
 2033|   324k|    if(rx > 0)
  ------------------
  |  Branch (2033:8): [True: 304k, False: 20.6k]
  ------------------
 2034|   304k|    {
 2035|       |        /*TODO:Implemented only for slice. condition for tile is not tested*/
 2036|   304k|        if(((0 != ps_codec->s_parse.i4_ctb_slice_x) || (0 != ps_codec->s_parse.i4_ctb_slice_y)) &&
  ------------------
  |  Branch (2036:13): [True: 304k, False: 88]
  |  Branch (2036:56): [True: 0, False: 88]
  ------------------
 2037|   304k|                        (0 != ps_codec->s_parse.i4_ctb_tile_x))
  ------------------
  |  Branch (2037:25): [True: 302k, False: 1.24k]
  ------------------
 2038|   302k|        {
 2039|       |
 2040|   302k|            TRACE_CABAC_CTXT("sao_merge_flag", ps_cabac->u4_range, ctxt_idx);
 2041|   302k|            sao_merge_left_flag = ihevcd_cabac_decode_bin(ps_cabac,
 2042|   302k|                                                          ps_bitstrm,
 2043|   302k|                                                          ctxt_idx);
 2044|   302k|            AEV_TRACE("sao_merge_flag", sao_merge_left_flag, ps_cabac->u4_range);
 2045|   302k|        }
 2046|       |
 2047|   304k|    }
 2048|   324k|    if(ry > 0 && !sao_merge_left_flag)
  ------------------
  |  Branch (2048:8): [True: 277k, False: 47.4k]
  |  Branch (2048:18): [True: 233k, False: 44.3k]
  ------------------
 2049|   233k|    {
 2050|   233k|        if((ps_codec->s_parse.i4_ctb_slice_y > 0) && (ps_codec->s_parse.i4_ctb_tile_y > 0))
  ------------------
  |  Branch (2050:12): [True: 232k, False: 364]
  |  Branch (2050:54): [True: 231k, False: 1.56k]
  ------------------
 2051|   231k|        {
 2052|   231k|            TRACE_CABAC_CTXT("sao_merge_flag", ps_cabac->u4_range, ctxt_idx);
 2053|   231k|            sao_merge_up_flag = ihevcd_cabac_decode_bin(ps_cabac,
 2054|   231k|                                                        ps_bitstrm,
 2055|   231k|                                                        ctxt_idx);
 2056|   231k|            AEV_TRACE("sao_merge_flag", sao_merge_up_flag, ps_cabac->u4_range);
 2057|   231k|        }
 2058|   233k|    }
 2059|   324k|    ctxt_idx = IHEVC_CAB_SAO_TYPE;
 2060|       |
 2061|   324k|    if(sao_merge_left_flag)
  ------------------
  |  Branch (2061:8): [True: 52.2k, False: 272k]
  ------------------
 2062|  52.2k|    {
 2063|  52.2k|        *ps_sao = *(ps_sao - 1);
 2064|  52.2k|    }
 2065|   272k|    else if(sao_merge_up_flag)
  ------------------
  |  Branch (2065:13): [True: 34.4k, False: 238k]
  ------------------
 2066|  34.4k|    {
 2067|  34.4k|        *ps_sao = *(ps_sao - ps_sps->i2_pic_wd_in_ctb);
 2068|  34.4k|    }
 2069|   238k|    else // if(!sao_merge_up_flag && !sao_merge_left_flag)
 2070|   238k|    {
 2071|   238k|        WORD32 c_idx;
 2072|   238k|        WORD32 sao_type_idx = 0;
 2073|   953k|        for(c_idx = 0; c_idx < 3; c_idx++)
  ------------------
  |  Branch (2073:24): [True: 714k, False: 238k]
  ------------------
 2074|   714k|        {
 2075|   714k|            if((ps_slice_hdr->i1_slice_sao_luma_flag && c_idx == 0) || (ps_slice_hdr->i1_slice_sao_chroma_flag && c_idx > 0))
  ------------------
  |  Branch (2075:17): [True: 707k, False: 7.49k]
  |  Branch (2075:57): [True: 235k, False: 471k]
  |  Branch (2075:73): [True: 460k, False: 18.4k]
  |  Branch (2075:115): [True: 458k, False: 2.49k]
  ------------------
 2076|   693k|            {
 2077|       |
 2078|       |
 2079|       |                /* sao_type_idx will be same for c_idx == 1 and c_idx == 2 - hence not initialized to zero for c_idx == 2*/
 2080|       |
 2081|   693k|                if(c_idx == 0)
  ------------------
  |  Branch (2081:20): [True: 235k, False: 458k]
  ------------------
 2082|   235k|                {
 2083|   235k|                    sao_type_idx = 0;
 2084|   235k|                    TRACE_CABAC_CTXT("sao_type_idx", ps_cabac->u4_range, ctxt_idx);
 2085|   235k|                    sao_type_idx = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 2086|       |
 2087|   235k|                    if(sao_type_idx)
  ------------------
  |  Branch (2087:24): [True: 200k, False: 35.1k]
  ------------------
 2088|   200k|                    {
 2089|   200k|                        sao_type_idx += ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
 2090|   200k|                    }
 2091|   235k|                    AEV_TRACE("sao_type_idx", sao_type_idx,  ps_cabac->u4_range);
 2092|       |
 2093|   235k|                    ps_sao->b3_y_type_idx = sao_type_idx;
 2094|   235k|                }
 2095|   693k|                if(c_idx == 1)
  ------------------
  |  Branch (2095:20): [True: 229k, False: 464k]
  ------------------
 2096|   229k|                {
 2097|   229k|                    sao_type_idx = 0;
 2098|   229k|                    TRACE_CABAC_CTXT("sao_type_idx", ps_cabac->u4_range, ctxt_idx);
 2099|   229k|                    sao_type_idx = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx);
 2100|   229k|                    if(sao_type_idx)
  ------------------
  |  Branch (2100:24): [True: 196k, False: 32.0k]
  ------------------
 2101|   196k|                    {
 2102|   196k|                        sao_type_idx += ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
 2103|   196k|                    }
 2104|       |
 2105|   229k|                    AEV_TRACE("sao_type_idx", sao_type_idx,  ps_cabac->u4_range);
 2106|       |
 2107|   229k|                    ps_sao->b3_cb_type_idx = sao_type_idx;
 2108|   229k|                    ps_sao->b3_cr_type_idx = sao_type_idx;
 2109|   229k|                }
 2110|       |
 2111|   693k|                if(sao_type_idx != 0)
  ------------------
  |  Branch (2111:20): [True: 594k, False: 99.2k]
  ------------------
 2112|   594k|                {
 2113|   594k|                    WORD32 i;
 2114|   594k|                    WORD32 sao_offset[4];
 2115|   594k|                    WORD32 sao_band_position = 0;
 2116|   594k|                    WORD32 c_max =  (1 << (MIN(BIT_DEPTH, 10) - 5)) - 1;
  ------------------
  |  |   43|   594k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2117|  2.97M|                    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (2117:32): [True: 2.37M, False: 594k]
  ------------------
 2118|  2.37M|                    {
 2119|  2.37M|                        sao_offset[i] = ihevcd_cabac_decode_bypass_bins_tunary(ps_cabac, ps_bitstrm, c_max);
 2120|  2.37M|                        AEV_TRACE("sao_offset_abs", sao_offset[i], ps_cabac->u4_range);
 2121|       |
 2122|  2.37M|                        if((2 == sao_type_idx) && (i > 1))
  ------------------
  |  Branch (2122:28): [True: 1.12M, False: 1.24M]
  |  Branch (2122:51): [True: 564k, False: 564k]
  ------------------
 2123|   564k|                        {
 2124|   564k|                            sao_offset[i] = -sao_offset[i];
 2125|   564k|                        }
 2126|  2.37M|                    }
 2127|       |
 2128|   594k|                    if(sao_type_idx == 1)
  ------------------
  |  Branch (2128:24): [True: 312k, False: 282k]
  ------------------
 2129|   312k|                    {
 2130|  1.56M|                        for(i = 0; i < 4; i++)
  ------------------
  |  Branch (2130:36): [True: 1.24M, False: 312k]
  ------------------
 2131|  1.24M|                        {
 2132|  1.24M|                            if(sao_offset[i] != 0)
  ------------------
  |  Branch (2132:32): [True: 576k, False: 672k]
  ------------------
 2133|   576k|                            {
 2134|   576k|                                value = ihevcd_cabac_decode_bypass_bin(ps_cabac, ps_bitstrm);
 2135|   576k|                                AEV_TRACE("sao_offset_sign", value, ps_cabac->u4_range);
 2136|       |
 2137|   576k|                                if(value)
  ------------------
  |  Branch (2137:36): [True: 304k, False: 271k]
  ------------------
 2138|   304k|                                {
 2139|   304k|                                    sao_offset[i] = -sao_offset[i];
 2140|   304k|                                }
 2141|   576k|                            }
 2142|  1.24M|                        }
 2143|   312k|                        value = ihevcd_cabac_decode_bypass_bins(ps_cabac, ps_bitstrm, 5);
 2144|   312k|                        AEV_TRACE("sao_band_position", value, ps_cabac->u4_range);
 2145|       |
 2146|   312k|                        sao_band_position = value;
 2147|   312k|                    }
 2148|   282k|                    else
 2149|   282k|                    {
 2150|   282k|                        if(c_idx == 0)
  ------------------
  |  Branch (2150:28): [True: 98.0k, False: 184k]
  ------------------
 2151|  98.0k|                        {
 2152|  98.0k|                            value = ihevcd_cabac_decode_bypass_bins(ps_cabac, ps_bitstrm, 2);
 2153|  98.0k|                            AEV_TRACE("sao_eo_class", value, ps_cabac->u4_range);
 2154|       |
 2155|  98.0k|                            ps_sao->b3_y_type_idx += value;
 2156|  98.0k|                        }
 2157|       |
 2158|   282k|                        if(c_idx == 1)
  ------------------
  |  Branch (2158:28): [True: 92.2k, False: 190k]
  ------------------
 2159|  92.2k|                        {
 2160|  92.2k|                            value = ihevcd_cabac_decode_bypass_bins(ps_cabac, ps_bitstrm, 2);
 2161|  92.2k|                            AEV_TRACE("sao_eo_class", value, ps_cabac->u4_range);
 2162|       |
 2163|  92.2k|                            ps_sao->b3_cb_type_idx += value;
 2164|  92.2k|                            ps_sao->b3_cr_type_idx += value;
 2165|  92.2k|                        }
 2166|   282k|                    }
 2167|       |
 2168|   594k|                    if(0 == c_idx)
  ------------------
  |  Branch (2168:24): [True: 200k, False: 393k]
  ------------------
 2169|   200k|                    {
 2170|   200k|                        ps_sao->b4_y_offset_1 = sao_offset[0];
 2171|   200k|                        ps_sao->b4_y_offset_2 = sao_offset[1];
 2172|   200k|                        ps_sao->b4_y_offset_3 = sao_offset[2];
 2173|   200k|                        ps_sao->b4_y_offset_4 = sao_offset[3];
 2174|       |
 2175|   200k|                        ps_sao->b5_y_band_pos = sao_band_position;
 2176|   200k|                    }
 2177|   393k|                    else if(1 == c_idx)
  ------------------
  |  Branch (2177:29): [True: 196k, False: 196k]
  ------------------
 2178|   196k|                    {
 2179|   196k|                        ps_sao->b4_cb_offset_1 = sao_offset[0];
 2180|   196k|                        ps_sao->b4_cb_offset_2 = sao_offset[1];
 2181|   196k|                        ps_sao->b4_cb_offset_3 = sao_offset[2];
 2182|   196k|                        ps_sao->b4_cb_offset_4 = sao_offset[3];
 2183|       |
 2184|   196k|                        ps_sao->b5_cb_band_pos = sao_band_position;
 2185|   196k|                    }
 2186|   196k|                    else // 2 == c_idx
 2187|   196k|                    {
 2188|   196k|                        ps_sao->b4_cr_offset_1 = sao_offset[0];
 2189|   196k|                        ps_sao->b4_cr_offset_2 = sao_offset[1];
 2190|   196k|                        ps_sao->b4_cr_offset_3 = sao_offset[2];
 2191|   196k|                        ps_sao->b4_cr_offset_4 = sao_offset[3];
 2192|       |
 2193|   196k|                        ps_sao->b5_cr_band_pos = sao_band_position;
 2194|   196k|                    }
 2195|   594k|                }
 2196|   693k|            }
 2197|   714k|        }
 2198|   238k|    }
 2199|       |
 2200|   324k|    return ret;
 2201|   324k|}
ihevcd_set_ctb_skip:
 2222|  6.48M|{
 2223|  6.48M|    tu_t *ps_tu;
 2224|  6.48M|    pu_t *ps_pu;
 2225|  6.48M|    sps_t *ps_sps = ps_codec->s_parse.ps_sps;
 2226|  6.48M|    WORD32 ctb_size = 1 << ps_sps->i1_log2_ctb_size;
 2227|  6.48M|    WORD32 ctb_skip_wd, ctb_skip_ht;
 2228|  6.48M|    WORD32 rows_remaining, cols_remaining;
 2229|  6.48M|    WORD32 tu_abs_x, tu_abs_y;
 2230|  6.48M|    WORD32 numbytes_row =  (ps_sps->i2_pic_width_in_luma_samples + 63) / 64;
 2231|  6.48M|    UWORD8 *pu1_pic_intra_flag;
 2232|  6.48M|    UWORD32 u4_mask;
 2233|  6.48M|    WORD32 pu_x,pu_y;
 2234|       |
 2235|       |    /* Set pu wd and ht based on whether the ctb is complete or not */
 2236|  6.48M|    rows_remaining = ps_sps->i2_pic_height_in_luma_samples
 2237|  6.48M|                    - (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size);
 2238|  6.48M|    ctb_skip_ht = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  6.48M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 6.22M, False: 251k]
  |  |  ------------------
  ------------------
 2239|       |
 2240|  6.48M|    cols_remaining = ps_sps->i2_pic_width_in_luma_samples
 2241|  6.48M|                    - (ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size);
 2242|  6.48M|    ctb_skip_wd = MIN(ctb_size, cols_remaining);
  ------------------
  |  |   43|  6.48M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 6.04M, False: 440k]
  |  |  ------------------
  ------------------
 2243|       |
 2244|  6.48M|    ps_codec->s_parse.s_cu.i4_pred_mode = PRED_MODE_SKIP;
 2245|  6.48M|    ps_codec->s_parse.s_cu.i4_part_mode = PART_2Nx2N;
 2246|       |
 2247|  27.1M|    for (pu_y = 0; pu_y < ctb_skip_ht ; pu_y += MIN_CU_SIZE)
  ------------------
  |  |  363|  20.6M|#define MIN_CU_SIZE         8
  ------------------
  |  Branch (2247:20): [True: 20.6M, False: 6.48M]
  ------------------
 2248|  20.6M|    {
 2249|   119M|        for (pu_x = 0; pu_x < ctb_skip_wd ; pu_x += MIN_CU_SIZE)
  ------------------
  |  |  363|  98.8M|#define MIN_CU_SIZE         8
  ------------------
  |  Branch (2249:24): [True: 98.8M, False: 20.6M]
  ------------------
 2250|  98.8M|        {
 2251|  98.8M|            ps_tu = ps_codec->s_parse.ps_tu;
 2252|  98.8M|            ps_tu->b1_cb_cbf = 0;
 2253|  98.8M|            ps_tu->b1_cr_cbf = 0;
 2254|  98.8M|            ps_tu->b1_y_cbf = 0;
 2255|  98.8M|            ps_tu->b4_pos_x = pu_x >> 2;
 2256|  98.8M|            ps_tu->b4_pos_y = pu_y >> 2;
 2257|  98.8M|            ps_tu->b1_transquant_bypass = 0;
 2258|  98.8M|            ps_tu->b3_size = 1;
 2259|  98.8M|            ps_tu->b7_qp = ps_codec->s_parse.u4_qp;
 2260|  98.8M|            ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE;
  ------------------
  |  |  518|  98.8M|#define INTRA_PRED_CHROMA_IDX_NONE  7
  ------------------
 2261|  98.8M|            ps_tu->b6_luma_intra_mode   = INTRA_PRED_NONE;
  ------------------
  |  |  511|  98.8M|#define INTRA_PRED_NONE  63
  ------------------
 2262|  98.8M|            ps_tu->b1_first_tu_in_cu = 1;
 2263|       |
 2264|  98.8M|            ps_codec->s_parse.ps_tu++;
 2265|  98.8M|            ps_codec->s_parse.s_cu.i4_tu_cnt++;
 2266|  98.8M|            ps_codec->s_parse.i4_pic_tu_idx++;
 2267|       |
 2268|  98.8M|            tu_abs_x = (ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size) + pu_x;
 2269|  98.8M|            tu_abs_y = (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size) + pu_y;
 2270|  98.8M|            pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag;
 2271|  98.8M|            pu1_pic_intra_flag += (tu_abs_y >> 3) * numbytes_row;
 2272|  98.8M|            pu1_pic_intra_flag += (tu_abs_x >> 6);
 2273|  98.8M|            u4_mask = (LSB_ONES((MIN_CU_SIZE >> 3)) << (((tu_abs_x) / 8) % 8));
  ------------------
  |  |   72|  98.8M|#define LSB_ONES(x) ((UWORD32)0xFFFFFFFF >> (32 - (x)))
  ------------------
 2274|  98.8M|            u4_mask = ~u4_mask;
 2275|  98.8M|            *pu1_pic_intra_flag &= u4_mask;
 2276|       |
 2277|  98.8M|            ps_pu = ps_codec->s_parse.ps_pu;
 2278|  98.8M|            ps_pu->b2_part_idx = 0;
 2279|  98.8M|            ps_pu->b4_pos_x = pu_x >> 2;
 2280|  98.8M|            ps_pu->b4_pos_y = pu_y >> 2;
 2281|  98.8M|            ps_pu->b4_wd = 1;
 2282|  98.8M|            ps_pu->b4_ht = 1;
 2283|  98.8M|            ps_pu->b1_intra_flag = 0;
 2284|  98.8M|            ps_pu->b3_part_mode = ps_codec->s_parse.s_cu.i4_part_mode;
 2285|  98.8M|            ps_pu->b1_merge_flag = 1;
 2286|  98.8M|            ps_pu->b3_merge_idx = 0;
 2287|       |
 2288|  98.8M|            ps_codec->s_parse.ps_pu++;
 2289|  98.8M|            ps_codec->s_parse.i4_pic_pu_idx++;
 2290|  98.8M|        }
 2291|  20.6M|    }
 2292|  6.48M|}
ihevcd_parse_slice_data:
 2314|  18.2k|{
 2315|       |
 2316|  18.2k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2317|  18.2k|    WORD32 end_of_slice_flag = 0;
 2318|  18.2k|    sps_t *ps_sps;
 2319|  18.2k|    pps_t *ps_pps;
 2320|  18.2k|    slice_header_t *ps_slice_hdr;
 2321|  18.2k|    WORD32 end_of_pic;
 2322|  18.2k|    tile_t *ps_tile, *ps_tile_prev;
 2323|  18.2k|    WORD32 i;
 2324|  18.2k|    WORD32 ctb_addr;
 2325|  18.2k|    WORD32 tile_idx;
 2326|  18.2k|    WORD32 cabac_init_idc;
 2327|  18.2k|    WORD32 ctb_size;
 2328|  18.2k|    WORD32 num_ctb_in_row;
 2329|  18.2k|    WORD32 num_min4x4_in_ctb;
 2330|  18.2k|    WORD32 slice_qp;
 2331|  18.2k|    WORD32 slice_start_ctb_idx;
 2332|  18.2k|    WORD32 tile_start_ctb_idx;
 2333|       |
 2334|       |
 2335|  18.2k|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr_base;
 2336|  18.2k|    ps_pps = ps_codec->s_parse.ps_pps_base;
 2337|  18.2k|    ps_sps = ps_codec->s_parse.ps_sps_base;
 2338|       |
 2339|       |    /* Get current slice header, pps and sps */
 2340|  18.2k|    ps_slice_hdr += (ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  18.2k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  18.2k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2341|  18.2k|    ps_pps  += ps_slice_hdr->i1_pps_id;
 2342|  18.2k|    ps_sps  += ps_pps->i1_sps_id;
 2343|       |
 2344|  18.2k|    if(0 != ps_codec->s_parse.i4_cur_slice_idx)
  ------------------
  |  Branch (2344:8): [True: 1.12k, False: 17.1k]
  ------------------
 2345|  1.12k|    {
 2346|  1.12k|        if(!ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (2346:12): [True: 368, False: 761]
  ------------------
 2347|    368|        {
 2348|    368|            ps_codec->s_parse.i4_cur_independent_slice_idx =
 2349|    368|                    ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1);
  ------------------
  |  |  153|    368|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|    368|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2350|    368|        }
 2351|  1.12k|    }
 2352|       |
 2353|       |
 2354|  18.2k|    ctb_size = 1 << ps_sps->i1_log2_ctb_size;
 2355|  18.2k|    num_min4x4_in_ctb = (ctb_size / 4) * (ctb_size / 4);
 2356|  18.2k|    num_ctb_in_row = ps_sps->i2_pic_wd_in_ctb;
 2357|       |
 2358|       |    /* Update the parse context */
 2359|  18.2k|    if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2359:8): [True: 9.39k, False: 8.89k]
  ------------------
 2360|  9.39k|    {
 2361|  9.39k|        ps_codec->s_parse.i4_ctb_x = ps_slice_hdr->i2_ctb_x;
 2362|  9.39k|        ps_codec->s_parse.i4_ctb_y = ps_slice_hdr->i2_ctb_y;
 2363|  9.39k|    }
 2364|  18.2k|    ps_codec->s_parse.ps_pps = ps_pps;
 2365|  18.2k|    ps_codec->s_parse.ps_sps = ps_sps;
 2366|  18.2k|    ps_codec->s_parse.ps_slice_hdr = ps_slice_hdr;
 2367|       |
 2368|       |    /* Derive Tile positions for the current CTB */
 2369|       |    /* Change this to lookup if required */
 2370|  18.2k|    ihevcd_get_tile_pos(ps_pps, ps_sps, ps_codec->s_parse.i4_ctb_x,
 2371|  18.2k|                        ps_codec->s_parse.i4_ctb_y,
 2372|  18.2k|                        &ps_codec->s_parse.i4_ctb_tile_x,
 2373|  18.2k|                        &ps_codec->s_parse.i4_ctb_tile_y,
 2374|  18.2k|                        &tile_idx);
 2375|  18.2k|    ps_codec->s_parse.ps_tile = ps_pps->ps_tile + tile_idx;
 2376|  18.2k|    ps_codec->s_parse.i4_cur_tile_idx = tile_idx;
 2377|  18.2k|    ps_tile = ps_codec->s_parse.ps_tile;
 2378|  18.2k|    if(tile_idx)
  ------------------
  |  Branch (2378:8): [True: 236, False: 18.0k]
  ------------------
 2379|    236|        ps_tile_prev = ps_tile - 1;
 2380|  18.0k|    else
 2381|  18.0k|        ps_tile_prev = ps_tile;
 2382|       |
 2383|       |    /* If the present slice is dependent, then store the previous
 2384|       |     * independent slices' ctb x and y values for decoding process */
 2385|  18.2k|    if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2385:8): [True: 9.39k, False: 8.89k]
  ------------------
 2386|  9.39k|    {
 2387|  9.39k|        if(1 == ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (2387:12): [True: 426, False: 8.97k]
  ------------------
 2388|    426|        {
 2389|       |            /*If slice is present at the start of a new tile*/
 2390|    426|            if((0 == ps_codec->s_parse.i4_ctb_tile_x) && (0 == ps_codec->s_parse.i4_ctb_tile_y))
  ------------------
  |  Branch (2390:16): [True: 226, False: 200]
  |  Branch (2390:58): [True: 0, False: 226]
  ------------------
 2391|      0|            {
 2392|      0|                ps_codec->s_parse.i4_ctb_slice_x = 0;
 2393|      0|                ps_codec->s_parse.i4_ctb_slice_y = 0;
 2394|      0|            }
 2395|    426|        }
 2396|       |
 2397|  9.39k|        if(!ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (2397:12): [True: 8.97k, False: 426]
  ------------------
 2398|  8.97k|        {
 2399|  8.97k|            ps_codec->s_parse.i4_ctb_slice_x = 0;
 2400|  8.97k|            ps_codec->s_parse.i4_ctb_slice_y = 0;
 2401|  8.97k|        }
 2402|  9.39k|    }
 2403|       |
 2404|       |    /* Frame level initializations */
 2405|  18.2k|    if((0 == ps_codec->s_parse.i4_ctb_y) &&
  ------------------
  |  Branch (2405:8): [True: 11.5k, False: 6.74k]
  ------------------
 2406|  18.2k|                    (0 == ps_codec->s_parse.i4_ctb_x))
  ------------------
  |  Branch (2406:21): [True: 9.34k, False: 2.20k]
  ------------------
 2407|  9.34k|    {
 2408|  9.34k|        ret = ihevcd_parse_pic_init(ps_codec);
 2409|  9.34k|        RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  9.34k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 206, False: 9.14k]
  |  |  ------------------
  ------------------
 2410|       |
 2411|  9.14k|        ps_codec->s_parse.pu4_pic_tu_idx[0] = 0;
 2412|  9.14k|        ps_codec->s_parse.pu4_pic_pu_idx[0] = 0;
 2413|  9.14k|        ps_codec->s_parse.i4_cur_independent_slice_idx = 0;
 2414|  9.14k|        ps_codec->s_parse.i4_ctb_tile_x = 0;
 2415|  9.14k|        ps_codec->s_parse.i4_ctb_tile_y = 0;
 2416|  9.14k|    }
 2417|       |
 2418|  18.0k|    {
 2419|       |        /* Updating the poc list of current slice to ps_mv_buf */
 2420|  18.0k|        mv_buf_t *ps_mv_buf = ps_codec->s_parse.ps_cur_mv_buf;
 2421|       |
 2422|  18.0k|        if(ps_slice_hdr->i1_num_ref_idx_l1_active != 0)
  ------------------
  |  Branch (2422:12): [True: 2.83k, False: 15.2k]
  ------------------
 2423|  2.83k|        {
 2424|  9.84k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (2424:24): [True: 7.01k, False: 2.83k]
  ------------------
 2425|  7.01k|            {
 2426|  7.01k|                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|  7.01k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  7.01k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2427|  7.01k|                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|  7.01k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  7.01k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2428|  7.01k|            }
 2429|  2.83k|        }
 2430|       |
 2431|  18.0k|        if(ps_slice_hdr->i1_num_ref_idx_l0_active != 0)
  ------------------
  |  Branch (2431:12): [True: 3.27k, False: 14.8k]
  ------------------
 2432|  3.27k|        {
 2433|  12.0k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (2433:24): [True: 8.79k, False: 3.27k]
  ------------------
 2434|  8.79k|            {
 2435|  8.79k|                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|  8.79k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  8.79k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2436|  8.79k|                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|  8.79k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  8.79k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 2437|  8.79k|            }
 2438|  3.27k|        }
 2439|  18.0k|    }
 2440|       |
 2441|       |    /*Initialize the low delay flag at the beginning of every slice*/
 2442|  18.0k|    if((0 == ps_codec->s_parse.i4_ctb_slice_x) || (0 == ps_codec->s_parse.i4_ctb_slice_y))
  ------------------
  |  Branch (2442:8): [True: 10.3k, False: 7.68k]
  |  Branch (2442:51): [True: 2.64k, False: 5.04k]
  ------------------
 2443|  13.0k|    {
 2444|       |        /* Lowdelay flag */
 2445|  13.0k|        WORD32 cur_poc, ref_list_poc, flag = 1;
 2446|  13.0k|        cur_poc = ps_slice_hdr->i4_abs_pic_order_cnt;
 2447|  18.4k|        for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (2447:20): [True: 5.90k, False: 12.5k]
  ------------------
 2448|  5.90k|        {
 2449|  5.90k|            ref_list_poc = ((mv_buf_t *)ps_slice_hdr->as_ref_pic_list0[i].pv_mv_buf)->i4_abs_poc;
 2450|  5.90k|            if(ref_list_poc > cur_poc)
  ------------------
  |  Branch (2450:16): [True: 510, False: 5.39k]
  ------------------
 2451|    510|            {
 2452|    510|                flag = 0;
 2453|    510|                break;
 2454|    510|            }
 2455|  5.90k|        }
 2456|  13.0k|        if(flag && (ps_slice_hdr->i1_slice_type == BSLICE))
  ------------------
  |  Branch (2456:12): [True: 12.5k, False: 510]
  |  Branch (2456:20): [True: 1.81k, False: 10.7k]
  ------------------
 2457|  1.81k|        {
 2458|  5.64k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (2458:24): [True: 4.23k, False: 1.40k]
  ------------------
 2459|  4.23k|            {
 2460|  4.23k|                ref_list_poc = ((mv_buf_t *)ps_slice_hdr->as_ref_pic_list1[i].pv_mv_buf)->i4_abs_poc;
 2461|  4.23k|                if(ref_list_poc > cur_poc)
  ------------------
  |  Branch (2461:20): [True: 401, False: 3.83k]
  ------------------
 2462|    401|                {
 2463|    401|                    flag = 0;
 2464|    401|                    break;
 2465|    401|                }
 2466|  4.23k|            }
 2467|  1.81k|        }
 2468|  13.0k|        ps_slice_hdr->i1_low_delay_flag = flag;
 2469|  13.0k|    }
 2470|       |
 2471|       |    /* initialize the cabac init idc based on slice type */
 2472|  18.0k|    if(ps_slice_hdr->i1_slice_type == ISLICE)
  ------------------
  |  Branch (2472:8): [True: 14.8k, False: 3.27k]
  ------------------
 2473|  14.8k|    {
 2474|  14.8k|        cabac_init_idc = 0;
 2475|  14.8k|    }
 2476|  3.27k|    else if(ps_slice_hdr->i1_slice_type == PSLICE)
  ------------------
  |  Branch (2476:13): [True: 439, False: 2.83k]
  ------------------
 2477|    439|    {
 2478|    439|        cabac_init_idc = ps_slice_hdr->i1_cabac_init_flag ? 2 : 1;
  ------------------
  |  Branch (2478:26): [True: 358, False: 81]
  ------------------
 2479|    439|    }
 2480|  2.83k|    else
 2481|  2.83k|    {
 2482|  2.83k|        cabac_init_idc = ps_slice_hdr->i1_cabac_init_flag ? 1 : 2;
  ------------------
  |  Branch (2482:26): [True: 1.49k, False: 1.34k]
  ------------------
 2483|  2.83k|    }
 2484|       |
 2485|  18.0k|    slice_qp = ps_slice_hdr->i1_slice_qp_delta + ps_pps->i1_pic_init_qp;
 2486|  18.0k|    slice_qp = CLIP3(slice_qp, 0, 51);
  ------------------
  |  |   40|  18.0k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 18.0k]
  |  |  |  Branch (40:53): [True: 0, False: 18.0k]
  |  |  ------------------
  ------------------
 2487|       |
 2488|       |    /*Update QP value for every indepndent slice or for every dependent slice that begins at the start of a new tile*/
 2489|  18.0k|    if((0 == ps_slice_hdr->i1_dependent_slice_flag) ||
  ------------------
  |  Branch (2489:8): [True: 17.3k, False: 761]
  ------------------
 2490|  18.0k|                    ((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 (2490:22): [True: 761, False: 0]
  |  Branch (2490:71): [True: 498, False: 263]
  |  Branch (2490:113): [True: 0, False: 498]
  ------------------
 2491|  17.3k|    {
 2492|  17.3k|        ps_codec->s_parse.u4_qp = slice_qp;
 2493|  17.3k|    }
 2494|       |
 2495|       |    /*Cabac init at the beginning of a slice*/
 2496|       |    //If the slice is a dependent slice, not present at the start of a tile
 2497|  18.0k|    if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2497:8): [True: 9.38k, False: 8.70k]
  ------------------
 2498|  9.38k|    {
 2499|  9.38k|        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 (2499:12): [True: 426, False: 8.95k]
  |  Branch (2499:63): [True: 226, False: 200]
  |  Branch (2499:105): [True: 0, False: 226]
  ------------------
 2500|    426|        {
 2501|    426|            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 (2501:16): [True: 421, False: 5]
  |  Branch (2501:71): [True: 5, False: 0]
  |  Branch (2501:118): [True: 0, False: 5]
  ------------------
 2502|    421|            {
 2503|    421|                ihevcd_cabac_reset(&ps_codec->s_parse.s_cabac,
 2504|    421|                                   &ps_codec->s_parse.s_bitstrm);
 2505|    421|            }
 2506|    426|        }
 2507|  8.95k|        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 (2507:17): [True: 8.16k, False: 795]
  |  Branch (2507:72): [True: 795, False: 0]
  |  Branch (2507:119): [True: 2, False: 793]
  ------------------
 2508|  8.16k|        {
 2509|  8.16k|            ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac,
 2510|  8.16k|                                    &ps_codec->s_parse.s_bitstrm,
 2511|  8.16k|                                    slice_qp,
 2512|  8.16k|                                    cabac_init_idc,
 2513|  8.16k|                                    &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0]);
 2514|  8.16k|            if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (2514:16): [True: 69, False: 8.09k]
  ------------------
 2515|     69|            {
 2516|     69|                ps_codec->i4_slice_error = 1;
 2517|     69|                end_of_slice_flag = 1;
 2518|     69|                ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2519|     69|            }
 2520|  8.16k|        }
 2521|  9.38k|    }
 2522|       |
 2523|       |
 2524|  18.0k|    do
 2525|  7.49M|    {
 2526|       |
 2527|  7.49M|        {
 2528|  7.49M|            WORD32 cur_ctb_idx = ps_codec->s_parse.i4_ctb_x
 2529|  7.49M|                            + ps_codec->s_parse.i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 2530|  7.49M|            if(1 == ps_codec->i4_num_cores && 0 == cur_ctb_idx % RESET_TU_BUF_NCTB)
  ------------------
  |  |  179|  4.82M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  170|  4.82M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  4.82M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  4.82M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  4.82M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  4.82M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2530:16): [True: 4.82M, False: 2.67M]
  |  Branch (2530:47): [True: 2.19k, False: 4.81M]
  ------------------
 2531|  2.19k|            {
 2532|  2.19k|                ps_codec->s_parse.ps_tu = ps_codec->s_parse.ps_pic_tu;
 2533|  2.19k|                ps_codec->s_parse.i4_pic_tu_idx = 0;
 2534|  2.19k|            }
 2535|  7.49M|        }
 2536|       |
 2537|  7.49M|        end_of_pic = 0;
 2538|       |        /* Section:7.3.7 Coding tree unit syntax */
 2539|       |        /* coding_tree_unit() inlined here */
 2540|       |        /* If number of cores is greater than 1, then add job to the queue */
 2541|       |        //TODO: Dual core implementation might need a different algo for better load balancing
 2542|       |        /* At the start of ctb row parsing in a tile, queue a job for processing the current tile row */
 2543|  7.49M|        ps_codec->s_parse.i4_ctb_num_pcm_blks = 0;
 2544|       |
 2545|       |
 2546|       |        /*At the beginning of each tile-which is not the beginning of a slice, cabac context must be initialized.
 2547|       |         * Hence, check for the tile beginning here */
 2548|  7.49M|        if(((0 == ps_codec->s_parse.i4_ctb_tile_x) && (0 == ps_codec->s_parse.i4_ctb_tile_y))
  ------------------
  |  Branch (2548:13): [True: 484k, False: 7.00M]
  |  Branch (2548:55): [True: 13.9k, False: 470k]
  ------------------
 2549|  7.49M|                        && (!((ps_tile->u1_pos_x == 0) && (ps_tile->u1_pos_y == 0)))
  ------------------
  |  Branch (2549:31): [True: 9.42k, False: 4.47k]
  |  Branch (2549:59): [True: 9.14k, False: 284]
  ------------------
 2550|  7.49M|                        && (!((0 == ps_codec->s_parse.i4_ctb_slice_x) && (0 == ps_codec->s_parse.i4_ctb_slice_y))))
  ------------------
  |  Branch (2550:31): [True: 284, False: 4.47k]
  |  Branch (2550:74): [True: 0, False: 284]
  ------------------
 2551|  4.76k|        {
 2552|  4.76k|            slice_qp = ps_slice_hdr->i1_slice_qp_delta + ps_pps->i1_pic_init_qp;
 2553|  4.76k|            slice_qp = CLIP3(slice_qp, 0, 51);
  ------------------
  |  |   40|  4.76k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 0, False: 4.76k]
  |  |  |  Branch (40:53): [True: 0, False: 4.76k]
  |  |  ------------------
  ------------------
 2554|  4.76k|            ps_codec->s_parse.u4_qp = slice_qp;
 2555|       |
 2556|  4.76k|            ihevcd_get_tile_pos(ps_pps, ps_sps, ps_codec->s_parse.i4_ctb_x,
 2557|  4.76k|                                ps_codec->s_parse.i4_ctb_y,
 2558|  4.76k|                                &ps_codec->s_parse.i4_ctb_tile_x,
 2559|  4.76k|                                &ps_codec->s_parse.i4_ctb_tile_y,
 2560|  4.76k|                                &tile_idx);
 2561|       |
 2562|  4.76k|            ps_codec->s_parse.ps_tile = ps_pps->ps_tile + tile_idx;
 2563|  4.76k|            ps_codec->s_parse.i4_cur_tile_idx = tile_idx;
 2564|  4.76k|            ps_tile_prev = ps_tile - 1;
 2565|       |
 2566|  4.76k|            tile_start_ctb_idx = ps_tile->u1_pos_x
 2567|  4.76k|                            + ps_tile->u1_pos_y * (ps_sps->i2_pic_wd_in_ctb);
 2568|       |
 2569|  4.76k|            slice_start_ctb_idx =  ps_slice_hdr->i2_ctb_x
 2570|  4.76k|                            + ps_slice_hdr->i2_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 2571|       |
 2572|       |            /*For slices that span across multiple tiles*/
 2573|  4.76k|            if(slice_start_ctb_idx < tile_start_ctb_idx)
  ------------------
  |  Branch (2573:16): [True: 4.67k, False: 91]
  ------------------
 2574|  4.67k|            {       /* 2 Cases
 2575|       |             * 1 - slice spans across frame-width- but does not start from 1st column
 2576|       |             * 2 - Slice spans across multiple tiles anywhere is a frame
 2577|       |             */
 2578|  4.67k|                ps_codec->s_parse.i4_ctb_slice_y = ps_tile->u1_pos_y - ps_slice_hdr->i2_ctb_y;
 2579|  4.67k|                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 (2579:20): [True: 4.21k, False: 461]
  ------------------
 2580|  4.21k|                {
 2581|  4.21k|                    if(ps_slice_hdr->i2_ctb_y <= ps_tile->u1_pos_y)
  ------------------
  |  Branch (2581:24): [True: 4.21k, False: 0]
  ------------------
 2582|  4.21k|                    {
 2583|       |                        //Check if ctb x is before or after
 2584|  4.21k|                        if(ps_slice_hdr->i2_ctb_x > ps_tile->u1_pos_x)
  ------------------
  |  Branch (2584:28): [True: 0, False: 4.21k]
  ------------------
 2585|      0|                        {
 2586|      0|                            ps_codec->s_parse.i4_ctb_slice_y -= 1;
 2587|      0|                        }
 2588|  4.21k|                    }
 2589|  4.21k|                }
 2590|       |                /*ps_codec->s_parse.i4_ctb_slice_y = ps_tile->u1_pos_y - ps_slice_hdr->i2_ctb_y;
 2591|       |                if (ps_slice_hdr->i2_ctb_y <= ps_tile->u1_pos_y)
 2592|       |                {
 2593|       |                    //Check if ctb x is before or after
 2594|       |                    if (ps_slice_hdr->i2_ctb_x > ps_tile->u1_pos_x )
 2595|       |                    {
 2596|       |                        ps_codec->s_parse.i4_ctb_slice_y -= 1 ;
 2597|       |                    }
 2598|       |                }*/
 2599|  4.67k|            }
 2600|       |
 2601|       |            /* Cabac init is done unconditionally at the start of the tile irrespective
 2602|       |             * of whether it is a dependent or an independent slice */
 2603|  4.76k|            if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2603:16): [True: 787, False: 3.97k]
  ------------------
 2604|    787|            {
 2605|    787|                ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac,
 2606|    787|                                        &ps_codec->s_parse.s_bitstrm,
 2607|    787|                                        slice_qp,
 2608|    787|                                        cabac_init_idc,
 2609|    787|                                        &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0]);
 2610|    787|                if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (2610:20): [True: 0, False: 787]
  ------------------
 2611|      0|                {
 2612|      0|                    ps_codec->i4_slice_error = 1;
 2613|      0|                    end_of_slice_flag = 1;
 2614|      0|                    ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2615|      0|                }
 2616|       |
 2617|    787|            }
 2618|  4.76k|        }
 2619|       |        /* If number of cores is greater than 1, then add job to the queue */
 2620|       |        //TODO: Dual core implementation might need a different algo for better load balancing
 2621|       |        /* At the start of ctb row parsing in a tile, queue a job for processing the current tile row */
 2622|       |
 2623|  7.49M|        if(0 == ps_codec->s_parse.i4_ctb_tile_x)
  ------------------
  |  Branch (2623:12): [True: 484k, False: 7.00M]
  ------------------
 2624|   484k|        {
 2625|       |
 2626|   484k|            if(1 < ps_codec->i4_num_cores)
  ------------------
  |  Branch (2626:16): [True: 205k, False: 278k]
  ------------------
 2627|   205k|            {
 2628|   205k|                proc_job_t s_job;
 2629|   205k|                IHEVCD_ERROR_T ret;
 2630|   205k|                s_job.i4_cmd    = CMD_PROCESS;
 2631|   205k|                s_job.i2_ctb_cnt = (WORD16)ps_tile->u2_wd;
 2632|   205k|                s_job.i2_ctb_x = (WORD16)ps_codec->s_parse.i4_ctb_x;
 2633|   205k|                s_job.i2_ctb_y = (WORD16)ps_codec->s_parse.i4_ctb_y;
 2634|   205k|                s_job.i2_slice_idx = (WORD16)ps_codec->s_parse.i4_cur_slice_idx;
 2635|   205k|                s_job.i4_tu_coeff_data_ofst = (UWORD8 *)ps_codec->s_parse.pv_tu_coeff_data -
 2636|   205k|                                (UWORD8 *)ps_codec->s_parse.pv_pic_tu_coeff_data;
 2637|   205k|                ret = ihevcd_jobq_queue((jobq_t *)ps_codec->s_parse.pv_proc_jobq, &s_job, sizeof(proc_job_t), 1);
 2638|       |
 2639|   205k|                if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (2639:20): [True: 0, False: 205k]
  ------------------
 2640|      0|                    return ret;
 2641|   205k|            }
 2642|   278k|            else
 2643|   278k|            {
 2644|   278k|                process_ctxt_t *ps_proc = &ps_codec->as_process[0];
 2645|   278k|                WORD32 tu_coeff_data_ofst = (UWORD8 *)ps_codec->s_parse.pv_tu_coeff_data -
 2646|   278k|                                (UWORD8 *)ps_codec->s_parse.pv_pic_tu_coeff_data;
 2647|       |
 2648|       |                /* If the codec is running in single core mode,
 2649|       |                 * initialize zeroth process context
 2650|       |                 * TODO: Dual core mode might need a different implementation instead of jobq
 2651|       |                 */
 2652|       |
 2653|   278k|                ps_proc->i4_ctb_cnt = ps_tile->u2_wd;
 2654|   278k|                ps_proc->i4_ctb_x   = ps_codec->s_parse.i4_ctb_x;
 2655|   278k|                ps_proc->i4_ctb_y   = ps_codec->s_parse.i4_ctb_y;
 2656|   278k|                ps_proc->i4_cur_slice_idx = ps_codec->s_parse.i4_cur_slice_idx;
 2657|       |
 2658|   278k|                ihevcd_init_proc_ctxt(ps_proc, tu_coeff_data_ofst);
 2659|   278k|            }
 2660|   484k|        }
 2661|       |
 2662|       |
 2663|       |        /* Restore cabac context model from top right CTB if entropy sync is enabled */
 2664|  7.49M|        if(ps_pps->i1_entropy_coding_sync_enabled_flag)
  ------------------
  |  Branch (2664:12): [True: 47.3k, False: 7.44M]
  ------------------
 2665|  47.3k|        {
 2666|       |            /*TODO Handle single CTB and top-right belonging to a different slice */
 2667|  47.3k|            if(0 == ps_codec->s_parse.i4_ctb_x && 0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2667:16): [True: 1.73k, False: 45.5k]
  |  Branch (2667:51): [True: 876, False: 860]
  ------------------
 2668|    876|            {
 2669|       |                //WORD32 size = sizeof(ps_codec->s_parse.s_cabac.au1_ctxt_models);
 2670|    876|                WORD32 default_ctxt = 0;
 2671|       |
 2672|    876|                if((0 == ps_codec->s_parse.i4_ctb_slice_y) && (!ps_slice_hdr->i1_dependent_slice_flag))
  ------------------
  |  Branch (2672:20): [True: 793, False: 83]
  |  Branch (2672:63): [True: 793, False: 0]
  ------------------
 2673|    793|                    default_ctxt = 1;
 2674|    876|                if(1 == ps_sps->i2_pic_wd_in_ctb)
  ------------------
  |  Branch (2674:20): [True: 680, False: 196]
  ------------------
 2675|    680|                    default_ctxt = 1;
 2676|       |
 2677|    876|                ps_codec->s_parse.u4_qp = slice_qp;
 2678|    876|                if(default_ctxt)
  ------------------
  |  Branch (2678:20): [True: 793, False: 83]
  ------------------
 2679|    793|                {
 2680|       |                    //memcpy(&ps_codec->s_parse.s_cabac.au1_ctxt_models, &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0], size);
 2681|    793|                    ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac,
 2682|    793|                                            &ps_codec->s_parse.s_bitstrm,
 2683|    793|                                            slice_qp,
 2684|    793|                                            cabac_init_idc,
 2685|    793|                                            &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0]);
 2686|       |
 2687|    793|                    if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (2687:24): [True: 3, False: 790]
  ------------------
 2688|      3|                    {
 2689|      3|                        ps_codec->i4_slice_error = 1;
 2690|      3|                        end_of_slice_flag = 1;
 2691|      3|                        ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2692|      3|                    }
 2693|    793|                }
 2694|     83|                else
 2695|     83|                {
 2696|       |                    //memcpy(&ps_codec->s_parse.s_cabac.au1_ctxt_models, &ps_codec->s_parse.s_cabac.au1_ctxt_models_sync, size);
 2697|     83|                    ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac,
 2698|     83|                                            &ps_codec->s_parse.s_bitstrm,
 2699|     83|                                            slice_qp,
 2700|     83|                                            cabac_init_idc,
 2701|     83|                                            (const UWORD8 *)&ps_codec->s_parse.s_cabac.au1_ctxt_models_sync);
 2702|       |
 2703|     83|                    if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (2703:24): [True: 0, False: 83]
  ------------------
 2704|      0|                    {
 2705|      0|                        ps_codec->i4_slice_error = 1;
 2706|      0|                        end_of_slice_flag = 1;
 2707|      0|                        ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2708|      0|                    }
 2709|     83|                }
 2710|    876|            }
 2711|  47.3k|        }
 2712|       |
 2713|       |
 2714|       |
 2715|  7.49M|        if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2715:12): [True: 1.01M, False: 6.48M]
  ------------------
 2716|  1.01M|        {
 2717|  1.01M|            if(ps_slice_hdr->i1_slice_sao_luma_flag || ps_slice_hdr->i1_slice_sao_chroma_flag)
  ------------------
  |  Branch (2717:16): [True: 322k, False: 690k]
  |  Branch (2717:56): [True: 2.90k, False: 687k]
  ------------------
 2718|   324k|                ihevcd_parse_sao(ps_codec);
 2719|  1.01M|        }
 2720|  6.48M|        else
 2721|  6.48M|        {
 2722|  6.48M|            sao_t *ps_sao = ps_codec->s_parse.ps_pic_sao +
 2723|  6.48M|                            ps_codec->s_parse.i4_ctb_x +
 2724|  6.48M|                            ps_codec->s_parse.i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
 2725|       |
 2726|       |            /* Default values */
 2727|  6.48M|            ps_sao->b3_y_type_idx = 0;
 2728|  6.48M|            ps_sao->b3_cb_type_idx = 0;
 2729|  6.48M|            ps_sao->b3_cr_type_idx = 0;
 2730|  6.48M|        }
 2731|       |
 2732|       |        //AEV_TRACE("CTB x", ps_codec->s_parse.i4_ctb_x, 0);
 2733|       |        //AEV_TRACE("CTB y", ps_codec->s_parse.i4_ctb_y, 0);
 2734|       |
 2735|  7.49M|        {
 2736|  7.49M|            WORD32 ctb_indx;
 2737|  7.49M|            ctb_indx = ps_codec->s_parse.i4_ctb_x + ps_sps->i2_pic_wd_in_ctb * ps_codec->s_parse.i4_ctb_y;
 2738|  7.49M|            ps_codec->s_parse.s_bs_ctxt.pu1_pic_qp_const_in_ctb[ctb_indx >> 3] |= (1 << (ctb_indx & 7));
 2739|  7.49M|            {
 2740|  7.49M|                UWORD16 *pu1_slice_idx = ps_codec->s_parse.pu1_slice_idx;
 2741|  7.49M|                pu1_slice_idx[ctb_indx] = ps_codec->s_parse.i4_cur_independent_slice_idx;
 2742|  7.49M|            }
 2743|  7.49M|        }
 2744|       |
 2745|  7.49M|        if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2745:12): [True: 1.01M, False: 6.48M]
  ------------------
 2746|  1.01M|        {
 2747|  1.01M|            tu_t *ps_tu = ps_codec->s_parse.ps_tu;
 2748|  1.01M|            WORD32 i4_tu_cnt = ps_codec->s_parse.s_cu.i4_tu_cnt;
 2749|  1.01M|            WORD32 i4_pic_tu_idx = ps_codec->s_parse.i4_pic_tu_idx;
 2750|       |
 2751|  1.01M|            pu_t *ps_pu = ps_codec->s_parse.ps_pu;
 2752|  1.01M|            WORD32 i4_pic_pu_idx = ps_codec->s_parse.i4_pic_pu_idx;
 2753|       |
 2754|  1.01M|            UWORD8 *pu1_tu_coeff_data = (UWORD8 *)ps_codec->s_parse.pv_tu_coeff_data;
 2755|       |
 2756|  1.01M|            ret = ihevcd_parse_coding_quadtree(ps_codec,
 2757|  1.01M|                                               (ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size),
 2758|  1.01M|                                               (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size),
 2759|  1.01M|                                               ps_sps->i1_log2_ctb_size,
 2760|  1.01M|                                               0);
 2761|       |            /* Check for error */
 2762|  1.01M|            if (ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (2762:17): [True: 148, False: 1.01M]
  ------------------
 2763|    148|            {
 2764|       |                /* Reset tu and pu parameters, and signal current ctb as skip */
 2765|    148|                WORD32 tu_coeff_data_reset_size;
 2766|       |
 2767|    148|                ps_codec->s_parse.ps_tu = ps_tu;
 2768|    148|                ps_codec->s_parse.s_cu.i4_tu_cnt = i4_tu_cnt;
 2769|    148|                ps_codec->s_parse.i4_pic_tu_idx = i4_pic_tu_idx;
 2770|       |
 2771|    148|                ps_codec->s_parse.ps_pu = ps_pu;
 2772|    148|                ps_codec->s_parse.i4_pic_pu_idx = i4_pic_pu_idx;
 2773|       |
 2774|    148|                tu_coeff_data_reset_size = (UWORD8 *)ps_codec->s_parse.pv_tu_coeff_data - pu1_tu_coeff_data;
 2775|    148|                memset(pu1_tu_coeff_data, 0, tu_coeff_data_reset_size);
 2776|    148|                ps_codec->s_parse.pv_tu_coeff_data = (void *)pu1_tu_coeff_data;
 2777|       |
 2778|    148|                ihevcd_set_ctb_skip(ps_codec);
 2779|       |
 2780|       |                /* Set slice error to suppress further parsing and
 2781|       |                 * signal end of slice.
 2782|       |                 */
 2783|    148|                ps_codec->i4_slice_error = 1;
 2784|    148|                end_of_slice_flag = 1;
 2785|    148|                ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
 2786|    148|            }
 2787|  1.01M|        }
 2788|  6.48M|        else
 2789|  6.48M|        {
 2790|  6.48M|            ihevcd_set_ctb_skip(ps_codec);
 2791|  6.48M|        }
 2792|       |
 2793|  7.49M|        if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (2793:12): [True: 1.01M, False: 6.48M]
  ------------------
 2794|  1.01M|            end_of_slice_flag = ihevcd_cabac_decode_terminate(&ps_codec->s_parse.s_cabac, &ps_codec->s_parse.s_bitstrm);
 2795|       |
 2796|  7.49M|        AEV_TRACE("end_of_slice_flag", end_of_slice_flag, ps_codec->s_parse.s_cabac.u4_range);
 2797|       |
 2798|       |
 2799|       |        /* In case of tiles or entropy sync, terminate cabac and copy cabac context backed up at the end of top-right CTB */
 2800|  7.49M|        if(ps_pps->i1_tiles_enabled_flag || ps_pps->i1_entropy_coding_sync_enabled_flag)
  ------------------
  |  Branch (2800:12): [True: 58.1k, False: 7.43M]
  |  Branch (2800:45): [True: 16.7k, False: 7.41M]
  ------------------
 2801|  74.8k|        {
 2802|  74.8k|            WORD32 end_of_tile = 0;
 2803|  74.8k|            WORD32 end_of_tile_row = 0;
 2804|       |
 2805|       |            /* Take a back up of cabac context models if entropy sync is enabled */
 2806|  74.8k|            if(ps_pps->i1_entropy_coding_sync_enabled_flag || ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (2806:16): [True: 47.3k, False: 27.4k]
  |  Branch (2806:63): [True: 27.4k, False: 0]
  ------------------
 2807|  74.8k|            {
 2808|  74.8k|                if(1 == ps_codec->s_parse.i4_ctb_x)
  ------------------
  |  Branch (2808:20): [True: 3.96k, False: 70.8k]
  ------------------
 2809|  3.96k|                {
 2810|  3.96k|                    WORD32 size = sizeof(ps_codec->s_parse.s_cabac.au1_ctxt_models);
 2811|  3.96k|                    memcpy(&ps_codec->s_parse.s_cabac.au1_ctxt_models_sync, &ps_codec->s_parse.s_cabac.au1_ctxt_models, size);
 2812|  3.96k|                }
 2813|  74.8k|            }
 2814|       |
 2815|       |            /* Since tiles and entropy sync are not enabled simultaneously, the following will not result in any problems */
 2816|  74.8k|            if((ps_codec->s_parse.i4_ctb_tile_x + 1) == (ps_tile->u2_wd))
  ------------------
  |  Branch (2816:16): [True: 15.6k, False: 59.1k]
  ------------------
 2817|  15.6k|            {
 2818|  15.6k|                end_of_tile_row = 1;
 2819|  15.6k|                if((ps_codec->s_parse.i4_ctb_tile_y + 1) == ps_tile->u2_ht)
  ------------------
  |  Branch (2819:20): [True: 5.94k, False: 9.69k]
  ------------------
 2820|  5.94k|                    end_of_tile = 1;
 2821|  15.6k|            }
 2822|  74.8k|            if((0 == end_of_slice_flag) && (0 == ps_codec->i4_slice_error) &&
  ------------------
  |  Branch (2822:16): [True: 74.7k, False: 37]
  |  Branch (2822:44): [True: 11.4k, False: 63.3k]
  ------------------
 2823|  74.8k|                            ((ps_pps->i1_tiles_enabled_flag && end_of_tile) ||
  ------------------
  |  Branch (2823:31): [True: 9.17k, False: 2.29k]
  |  Branch (2823:64): [True: 1.06k, False: 8.11k]
  ------------------
 2824|  11.4k|                                            (ps_pps->i1_entropy_coding_sync_enabled_flag && end_of_tile_row)))
  ------------------
  |  Branch (2824:46): [True: 2.76k, False: 7.63k]
  |  Branch (2824:93): [True: 607, False: 2.15k]
  ------------------
 2825|  1.66k|            {
 2826|  1.66k|                WORD32 end_of_sub_stream_one_bit;
 2827|  1.66k|                end_of_sub_stream_one_bit = ihevcd_cabac_decode_terminate(&ps_codec->s_parse.s_cabac, &ps_codec->s_parse.s_bitstrm);
 2828|  1.66k|                AEV_TRACE("end_of_sub_stream_one_bit", end_of_sub_stream_one_bit, ps_codec->s_parse.s_cabac.u4_range);
 2829|       |
 2830|       |                /* TODO: Remove the check for offset when HM is updated to include a byte unconditionally even for aligned location */
 2831|       |                /* For Ittiam streams this check should not be there, for HM9.1 streams this should be there */
 2832|  1.66k|                if(ps_codec->s_parse.s_bitstrm.u4_bit_ofst % 8)
  ------------------
  |  Branch (2832:20): [True: 1.54k, False: 120]
  ------------------
 2833|  1.54k|                    ihevcd_bits_flush_to_byte_boundary(&ps_codec->s_parse.s_bitstrm);
 2834|       |
 2835|  1.66k|                UNUSED(end_of_sub_stream_one_bit);
  ------------------
  |  |   38|  1.66k|#define UNUSED(x) ((void)(x))
  ------------------
 2836|  1.66k|            }
 2837|  74.8k|        }
 2838|  7.49M|        {
 2839|  7.49M|            WORD32 ctb_indx;
 2840|       |
 2841|  7.49M|            ctb_addr = ps_codec->s_parse.i4_ctb_y * num_ctb_in_row + ps_codec->s_parse.i4_ctb_x;
 2842|       |
 2843|  7.49M|            ctb_indx = ++ctb_addr;
 2844|       |
 2845|       |            /* Store pu_idx for next CTB in frame level pu_idx array */
 2846|       |
 2847|       |            //In case of multiple tiles, if end-of-tile row is reached
 2848|  7.49M|            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 (2848:16): [True: 484k, False: 7.00M]
  |  Branch (2848:77): [True: 13.3k, False: 470k]
  ------------------
 2849|  13.3k|            {
 2850|  13.3k|                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.
 2851|  13.3k|                if(ps_tile->u2_ht == (ps_codec->s_parse.i4_ctb_tile_y + 1))
  ------------------
  |  Branch (2851:20): [True: 4.75k, False: 8.61k]
  ------------------
 2852|  4.75k|                {
 2853|       |                    //If the current ctb is the last tile's last ctb
 2854|  4.75k|                    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 (2854:24): [True: 272, False: 4.47k]
  |  Branch (2854:92): [True: 266, False: 6]
  ------------------
 2855|    266|                    {
 2856|    266|                        ctb_indx = ctb_addr; //Next continuous ctb address
 2857|    266|                    }
 2858|  4.48k|                    else //Not last tile's end , but a tile end
 2859|  4.48k|                    {
 2860|  4.48k|                        tile_t *ps_next_tile = ps_codec->s_parse.ps_tile + 1;
 2861|  4.48k|                        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.
 2862|  4.48k|                    }
 2863|  4.75k|                }
 2864|  13.3k|            }
 2865|       |
 2866|  7.49M|            ps_codec->s_parse.pu4_pic_pu_idx[ctb_indx] = ps_codec->s_parse.i4_pic_pu_idx;
 2867|  7.49M|            ps_codec->s_parse.i4_next_pu_ctb_cnt = ctb_indx;
 2868|       |
 2869|  7.49M|            ps_codec->s_parse.pu1_pu_map += num_min4x4_in_ctb;
 2870|       |
 2871|       |            /* Store tu_idx for next CTB in frame level tu_idx array */
 2872|  7.49M|            if(1 == ps_codec->i4_num_cores)
  ------------------
  |  Branch (2872:16): [True: 4.82M, False: 2.67M]
  ------------------
 2873|  4.82M|            {
 2874|  4.82M|                ctb_indx = (0 == ctb_addr % RESET_TU_BUF_NCTB) ?
  ------------------
  |  |  179|  4.82M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  170|  4.82M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  4.82M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  4.82M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  4.82M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  4.82M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2874:28): [True: 0, False: 4.82M]
  ------------------
 2875|  4.82M|                                RESET_TU_BUF_NCTB : ctb_addr % RESET_TU_BUF_NCTB;
  ------------------
  |  |  179|      0|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  170|      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)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                              RESET_TU_BUF_NCTB : ctb_addr % RESET_TU_BUF_NCTB;
  ------------------
  |  |  179|  4.82M|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  170|  9.64M|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  4.82M|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  4.82M|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  4.82M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  4.82M|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2876|       |
 2877|       |                //In case of multiple tiles, if end-of-tile row is reached
 2878|  4.82M|                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 (2878:20): [True: 278k, False: 4.54M]
  |  Branch (2878:81): [True: 3.94k, False: 275k]
  ------------------
 2879|  3.94k|                {
 2880|  3.94k|                    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.
 2881|  3.94k|                    if(ps_tile->u2_ht == (ps_codec->s_parse.i4_ctb_tile_y + 1))
  ------------------
  |  Branch (2881:24): [True: 295, False: 3.64k]
  ------------------
 2882|    295|                    {
 2883|       |                        //If the current ctb is the last tile's last ctb
 2884|    295|                        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 (2884:28): [True: 136, False: 159]
  |  Branch (2884:96): [True: 136, False: 0]
  ------------------
 2885|    136|                        {
 2886|    136|                            ctb_indx = (0 == ctb_addr % RESET_TU_BUF_NCTB) ?
  ------------------
  |  |  179|    136|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  170|    136|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|    136|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|    136|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|    136|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|    136|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2886:40): [True: 0, False: 136]
  ------------------
 2887|    136|                                            RESET_TU_BUF_NCTB : ctb_addr % RESET_TU_BUF_NCTB;
  ------------------
  |  |  179|      0|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  170|      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)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                                          RESET_TU_BUF_NCTB : ctb_addr % RESET_TU_BUF_NCTB;
  ------------------
  |  |  179|    136|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  170|    272|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|    136|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|    136|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|    136|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|    136|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2888|    136|                        }
 2889|    159|                        else  //Not last tile's end , but a tile end
 2890|    159|                        {
 2891|    159|                            tile_t *ps_next_tile = ps_codec->s_parse.ps_tile + 1;
 2892|    159|                            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.
 2893|    159|                        }
 2894|    295|                    }
 2895|  3.94k|                }
 2896|  4.82M|                ps_codec->s_parse.i4_next_tu_ctb_cnt = ctb_indx;
 2897|  4.82M|                ps_codec->s_parse.pu4_pic_tu_idx[ctb_indx] = ps_codec->s_parse.i4_pic_tu_idx;
 2898|  4.82M|            }
 2899|  2.67M|            else
 2900|  2.67M|            {
 2901|  2.67M|                ctb_indx = ctb_addr;
 2902|  2.67M|                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 (2902:20): [True: 205k, False: 2.46M]
  |  Branch (2902:81): [True: 9.42k, False: 195k]
  ------------------
 2903|  9.42k|                {
 2904|  9.42k|                    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.
 2905|  9.42k|                    if(ps_tile->u2_ht == (ps_codec->s_parse.i4_ctb_tile_y + 1))
  ------------------
  |  Branch (2905:24): [True: 4.45k, False: 4.96k]
  ------------------
 2906|  4.45k|                    {
 2907|       |                        //If the current ctb is the last tile's last ctb
 2908|  4.45k|                        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 (2908:28): [True: 136, False: 4.32k]
  |  Branch (2908:96): [True: 130, False: 6]
  ------------------
 2909|    130|                        {
 2910|    130|                            ctb_indx = ctb_addr;
 2911|    130|                        }
 2912|  4.32k|                        else  //Not last tile's end , but a tile end
 2913|  4.32k|                        {
 2914|  4.32k|                            tile_t *ps_next_tile = ps_codec->s_parse.ps_tile + 1;
 2915|  4.32k|                            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.
 2916|  4.32k|                        }
 2917|  4.45k|                    }
 2918|  9.42k|                }
 2919|  2.67M|                ps_codec->s_parse.i4_next_tu_ctb_cnt = ctb_indx;
 2920|  2.67M|                ps_codec->s_parse.pu4_pic_tu_idx[ctb_indx] = ps_codec->s_parse.i4_pic_tu_idx;
 2921|  2.67M|            }
 2922|  7.49M|            ps_codec->s_parse.pu1_tu_map += num_min4x4_in_ctb;
 2923|  7.49M|        }
 2924|       |
 2925|       |        /* QP array population has to be done if deblocking is enabled in the picture
 2926|       |         * but some of the slices in the pic have it disabled */
 2927|  7.49M|        if((0 != ps_codec->i4_disable_deblk_pic) &&
  ------------------
  |  Branch (2927:12): [True: 0, False: 7.49M]
  ------------------
 2928|  7.49M|                (1 == ps_slice_hdr->i1_slice_disable_deblocking_filter_flag))
  ------------------
  |  Branch (2928:17): [True: 0, False: 0]
  ------------------
 2929|      0|        {
 2930|      0|            bs_ctxt_t *ps_bs_ctxt = &ps_codec->s_parse.s_bs_ctxt;
 2931|      0|            WORD32 log2_ctb_size = ps_sps->i1_log2_ctb_size;
 2932|      0|            UWORD8 *pu1_qp;
 2933|      0|            WORD32 qp_strd;
 2934|      0|            WORD32 u4_qp_const_in_ctb;
 2935|      0|            WORD32 cur_ctb_idx;
 2936|      0|            WORD32 next_ctb_idx;
 2937|      0|            WORD32 cur_tu_idx;
 2938|      0|            WORD32 i4_ctb_tu_cnt;
 2939|      0|            tu_t *ps_tu;
 2940|       |
 2941|      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;
 2942|       |            /* ctb_size/8 elements per CTB */
 2943|      0|            qp_strd = ps_sps->i2_pic_wd_in_ctb << (log2_ctb_size - 3);
 2944|      0|            pu1_qp = ps_bs_ctxt->pu1_pic_qp + ((ps_codec->s_parse.i4_ctb_x + ps_codec->s_parse.i4_ctb_y * qp_strd) << (log2_ctb_size - 3));
 2945|       |
 2946|      0|            u4_qp_const_in_ctb = ps_bs_ctxt->pu1_pic_qp_const_in_ctb[cur_ctb_idx >> 3] & (1 << (cur_ctb_idx & 7));
 2947|       |
 2948|      0|            next_ctb_idx = ps_codec->s_parse.i4_next_tu_ctb_cnt;
 2949|      0|            if(1 == ps_codec->i4_num_cores)
  ------------------
  |  Branch (2949:16): [True: 0, False: 0]
  ------------------
 2950|      0|            {
 2951|      0|                i4_ctb_tu_cnt = ps_codec->s_parse.pu4_pic_tu_idx[next_ctb_idx] -
 2952|      0|                                ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx % RESET_TU_BUF_NCTB];
  ------------------
  |  |  179|      0|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  170|      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)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2953|       |
 2954|      0|                cur_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx % RESET_TU_BUF_NCTB];
  ------------------
  |  |  179|      0|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  170|      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)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2955|      0|            }
 2956|      0|            else
 2957|      0|            {
 2958|      0|                i4_ctb_tu_cnt = ps_codec->s_parse.pu4_pic_tu_idx[next_ctb_idx] -
 2959|      0|                                ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx];
 2960|       |
 2961|      0|                cur_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx];
 2962|      0|            }
 2963|       |
 2964|      0|            ps_tu = &ps_codec->s_parse.ps_pic_tu[cur_tu_idx];
 2965|       |
 2966|      0|            if(u4_qp_const_in_ctb)
  ------------------
  |  Branch (2966:16): [True: 0, False: 0]
  ------------------
 2967|      0|            {
 2968|      0|                pu1_qp[0] = ps_tu->b7_qp;
 2969|      0|            }
 2970|      0|            else
 2971|      0|            {
 2972|      0|                for(i = 0; i < i4_ctb_tu_cnt; i++, ps_tu++)
  ------------------
  |  Branch (2972:28): [True: 0, False: 0]
  ------------------
 2973|      0|                {
 2974|      0|                    WORD32 start_pos_x;
 2975|      0|                    WORD32 start_pos_y;
 2976|      0|                    WORD32 tu_size;
 2977|       |
 2978|       |                    /* start_pos_x and start_pos_y are in units of min TU size (4x4) */
 2979|      0|                    start_pos_x = ps_tu->b4_pos_x;
 2980|      0|                    start_pos_y = ps_tu->b4_pos_y;
 2981|       |
 2982|      0|                    tu_size = 1 << (ps_tu->b3_size + 2);
 2983|      0|                    tu_size >>= 2; /* TU size divided by 4 */
 2984|       |
 2985|      0|                    if(0 == (start_pos_x & 1) && 0 == (start_pos_y & 1))
  ------------------
  |  Branch (2985:24): [True: 0, False: 0]
  |  Branch (2985:50): [True: 0, False: 0]
  ------------------
 2986|      0|                    {
 2987|      0|                        WORD32 row, col;
 2988|      0|                        for(row = start_pos_y; row < start_pos_y + tu_size; row += 2)
  ------------------
  |  Branch (2988:48): [True: 0, False: 0]
  ------------------
 2989|      0|                        {
 2990|      0|                            for(col = start_pos_x; col < start_pos_x + tu_size; col += 2)
  ------------------
  |  Branch (2990:52): [True: 0, False: 0]
  ------------------
 2991|      0|                            {
 2992|      0|                                pu1_qp[(row >> 1) * qp_strd + (col >> 1)] = ps_tu->b7_qp;
 2993|      0|                            }
 2994|      0|                        }
 2995|      0|                    }
 2996|      0|                }
 2997|      0|            }
 2998|      0|        }
 2999|       |
 3000|  7.49M|        if(ps_codec->i4_num_cores <= MV_PRED_NUM_CORES_THRESHOLD)
  ------------------
  |  |  126|  7.49M|#define MV_PRED_NUM_CORES_THRESHOLD 2
  ------------------
  |  Branch (3000:12): [True: 6.69M, False: 797k]
  ------------------
 3001|  6.69M|        {
 3002|       |            /*************************************************/
 3003|       |            /****************   MV pred **********************/
 3004|       |            /*************************************************/
 3005|  6.69M|            WORD8 u1_top_ctb_avail = 1;
 3006|  6.69M|            WORD8 u1_left_ctb_avail = 1;
 3007|  6.69M|            WORD8 u1_top_lt_ctb_avail = 1;
 3008|  6.69M|            WORD8 u1_top_rt_ctb_avail = 1;
 3009|  6.69M|            WORD16 i2_wd_in_ctb;
 3010|       |
 3011|  6.69M|            tile_start_ctb_idx = ps_tile->u1_pos_x
 3012|  6.69M|                            + ps_tile->u1_pos_y * (ps_sps->i2_pic_wd_in_ctb);
 3013|       |
 3014|  6.69M|            slice_start_ctb_idx =  ps_slice_hdr->i2_ctb_x
 3015|  6.69M|                            + ps_slice_hdr->i2_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 3016|       |
 3017|  6.69M|            if((slice_start_ctb_idx < tile_start_ctb_idx))
  ------------------
  |  Branch (3017:16): [True: 8.49k, False: 6.68M]
  ------------------
 3018|  8.49k|            {
 3019|       |                //Slices span across multiple tiles.
 3020|  8.49k|                i2_wd_in_ctb = ps_sps->i2_pic_wd_in_ctb;
 3021|  8.49k|            }
 3022|  6.68M|            else
 3023|  6.68M|            {
 3024|  6.68M|                i2_wd_in_ctb = ps_tile->u2_wd;
 3025|  6.68M|            }
 3026|       |            /* slice and tile boundaries */
 3027|  6.69M|            if((0 == ps_codec->s_parse.i4_ctb_y) || (0 == ps_codec->s_parse.i4_ctb_tile_y))
  ------------------
  |  Branch (3027:16): [True: 229k, False: 6.46M]
  |  Branch (3027:53): [True: 390, False: 6.46M]
  ------------------
 3028|   229k|            {
 3029|   229k|                u1_top_ctb_avail = 0;
 3030|   229k|                u1_top_lt_ctb_avail = 0;
 3031|   229k|                u1_top_rt_ctb_avail = 0;
 3032|   229k|            }
 3033|       |
 3034|  6.69M|            if((0 == ps_codec->s_parse.i4_ctb_x) || (0 == ps_codec->s_parse.i4_ctb_tile_x))
  ------------------
  |  Branch (3034:16): [True: 398k, False: 6.29M]
  |  Branch (3034:53): [True: 2.20k, False: 6.29M]
  ------------------
 3035|   400k|            {
 3036|   400k|                u1_left_ctb_avail = 0;
 3037|   400k|                u1_top_lt_ctb_avail = 0;
 3038|   400k|                if((0 == ps_codec->s_parse.i4_ctb_slice_y) || (0 == ps_codec->s_parse.i4_ctb_tile_y))
  ------------------
  |  Branch (3038:20): [True: 33.5k, False: 367k]
  |  Branch (3038:63): [True: 157, False: 367k]
  ------------------
 3039|  33.7k|                {
 3040|  33.7k|                    u1_top_ctb_avail = 0;
 3041|  33.7k|                    if((i2_wd_in_ctb - 1) != ps_codec->s_parse.i4_ctb_slice_x) //TODO: For tile, not implemented
  ------------------
  |  Branch (3041:24): [True: 32.4k, False: 1.28k]
  ------------------
 3042|  32.4k|                    {
 3043|  32.4k|                        u1_top_rt_ctb_avail = 0;
 3044|  32.4k|                    }
 3045|  33.7k|                }
 3046|   400k|            }
 3047|       |            /*For slices not beginning at start of a ctb row*/
 3048|  6.29M|            else if(ps_codec->s_parse.i4_ctb_x > 0)
  ------------------
  |  Branch (3048:21): [True: 6.29M, False: 0]
  ------------------
 3049|  6.29M|            {
 3050|  6.29M|                if((0 == ps_codec->s_parse.i4_ctb_slice_y) || (0 == ps_codec->s_parse.i4_ctb_tile_y))
  ------------------
  |  Branch (3050:20): [True: 4.31M, False: 1.97M]
  |  Branch (3050:63): [True: 1.58k, False: 1.97M]
  ------------------
 3051|  4.31M|                {
 3052|  4.31M|                    u1_top_ctb_avail = 0;
 3053|  4.31M|                    u1_top_lt_ctb_avail = 0;
 3054|  4.31M|                    if(0 == ps_codec->s_parse.i4_ctb_slice_x)
  ------------------
  |  Branch (3054:24): [True: 45, False: 4.31M]
  ------------------
 3055|     45|                    {
 3056|     45|                        u1_left_ctb_avail = 0;
 3057|     45|                    }
 3058|  4.31M|                    if((i2_wd_in_ctb - 1) != ps_codec->s_parse.i4_ctb_slice_x)
  ------------------
  |  Branch (3058:24): [True: 4.31M, False: 5.76k]
  ------------------
 3059|  4.31M|                    {
 3060|  4.31M|                        u1_top_rt_ctb_avail = 0;
 3061|  4.31M|                    }
 3062|  4.31M|                }
 3063|  1.97M|                else if((1 == ps_codec->s_parse.i4_ctb_slice_y) && (0 == ps_codec->s_parse.i4_ctb_slice_x))
  ------------------
  |  Branch (3063:25): [True: 197k, False: 1.78M]
  |  Branch (3063:68): [True: 7, False: 197k]
  ------------------
 3064|      7|                {
 3065|      7|                    u1_top_lt_ctb_avail = 0;
 3066|      7|                }
 3067|  6.29M|            }
 3068|       |
 3069|  6.69M|            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 (3069:16): [True: 398k, False: 6.29M]
  |  Branch (3069:82): [True: 2.20k, False: 6.29M]
  ------------------
 3070|   400k|            {
 3071|   400k|                u1_top_rt_ctb_avail = 0;
 3072|   400k|            }
 3073|       |
 3074|  6.69M|            if(PSLICE == ps_slice_hdr->i1_slice_type
  ------------------
  |  Branch (3074:16): [True: 21.3k, False: 6.67M]
  ------------------
 3075|  6.69M|                            || BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (3075:32): [True: 97.7k, False: 6.57M]
  ------------------
 3076|   119k|            {
 3077|   119k|                mv_ctxt_t s_mv_ctxt;
 3078|   119k|                process_ctxt_t *ps_proc;
 3079|   119k|                UWORD32 *pu4_ctb_top_pu_idx;
 3080|   119k|                UWORD32 *pu4_ctb_left_pu_idx;
 3081|   119k|                UWORD32 *pu4_ctb_top_left_pu_idx;
 3082|   119k|                WORD32 i4_ctb_pu_cnt;
 3083|   119k|                WORD32 cur_ctb_idx;
 3084|   119k|                WORD32 next_ctb_idx;
 3085|   119k|                WORD32 cur_pu_idx;
 3086|   119k|                ps_proc = &ps_codec->as_process[(ps_codec->i4_num_cores == 1) ? 1 : (ps_codec->i4_num_cores - 1)];
  ------------------
  |  Branch (3086:49): [True: 86.4k, False: 32.6k]
  ------------------
 3087|   119k|                cur_ctb_idx = ps_codec->s_parse.i4_ctb_x
 3088|   119k|                                + ps_codec->s_parse.i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 3089|   119k|                next_ctb_idx = ps_codec->s_parse.i4_next_pu_ctb_cnt;
 3090|   119k|                i4_ctb_pu_cnt = ps_codec->s_parse.pu4_pic_pu_idx[next_ctb_idx]
 3091|   119k|                                - ps_codec->s_parse.pu4_pic_pu_idx[cur_ctb_idx];
 3092|       |
 3093|   119k|                cur_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx[cur_ctb_idx];
 3094|       |
 3095|   119k|                pu4_ctb_top_pu_idx = ps_proc->pu4_pic_pu_idx_top
 3096|   119k|                                + (ps_codec->s_parse.i4_ctb_x * ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  357|   119k|#define MIN_PU_SIZE         4
  ------------------
 3097|   119k|                pu4_ctb_left_pu_idx = ps_proc->pu4_pic_pu_idx_left;
 3098|   119k|                pu4_ctb_top_left_pu_idx = &ps_proc->u4_ctb_top_left_pu_idx;
 3099|       |
 3100|       |                /* Initializing s_mv_ctxt */
 3101|   119k|                {
 3102|   119k|                    s_mv_ctxt.ps_pps = ps_pps;
 3103|   119k|                    s_mv_ctxt.ps_sps = ps_sps;
 3104|   119k|                    s_mv_ctxt.ps_slice_hdr = ps_slice_hdr;
 3105|   119k|                    s_mv_ctxt.i4_ctb_x = ps_codec->s_parse.i4_ctb_x;
 3106|   119k|                    s_mv_ctxt.i4_ctb_y = ps_codec->s_parse.i4_ctb_y;
 3107|   119k|                    s_mv_ctxt.ps_pu = &ps_codec->s_parse.ps_pic_pu[cur_pu_idx];
 3108|   119k|                    s_mv_ctxt.ps_pic_pu = ps_codec->s_parse.ps_pic_pu;
 3109|   119k|                    s_mv_ctxt.ps_tile = ps_tile;
 3110|   119k|                    s_mv_ctxt.pu4_pic_pu_idx_map = ps_proc->pu4_pic_pu_idx_map;
 3111|   119k|                    s_mv_ctxt.pu4_pic_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx;
 3112|   119k|                    s_mv_ctxt.pu1_pic_pu_map = ps_codec->s_parse.pu1_pic_pu_map;
 3113|   119k|                    s_mv_ctxt.i4_ctb_pu_cnt = i4_ctb_pu_cnt;
 3114|   119k|                    s_mv_ctxt.i4_ctb_start_pu_idx = cur_pu_idx;
 3115|   119k|                    s_mv_ctxt.u1_top_ctb_avail = u1_top_ctb_avail;
 3116|   119k|                    s_mv_ctxt.u1_top_rt_ctb_avail = u1_top_rt_ctb_avail;
 3117|   119k|                    s_mv_ctxt.u1_top_lt_ctb_avail = u1_top_lt_ctb_avail;
 3118|   119k|                    s_mv_ctxt.u1_left_ctb_avail = u1_left_ctb_avail;
 3119|   119k|                }
 3120|       |
 3121|   119k|                ihevcd_get_mv_ctb(&s_mv_ctxt, pu4_ctb_top_pu_idx,
 3122|   119k|                                  pu4_ctb_left_pu_idx, pu4_ctb_top_left_pu_idx);
 3123|       |
 3124|   119k|            }
 3125|  6.57M|            else
 3126|  6.57M|            {
 3127|  6.57M|                WORD32 num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  357|  6.57M|#define MIN_PU_SIZE         4
  ------------------
                              WORD32 num_minpu_in_ctb = (ctb_size / MIN_PU_SIZE) * (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  357|  6.57M|#define MIN_PU_SIZE         4
  ------------------
 3128|  6.57M|                UWORD8 *pu1_pic_pu_map_ctb = ps_codec->s_parse.pu1_pic_pu_map +
 3129|  6.57M|                                (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;
 3130|  6.57M|                process_ctxt_t *ps_proc = &ps_codec->as_process[(ps_codec->i4_num_cores == 1) ? 1 : (ps_codec->i4_num_cores - 1)];
  ------------------
  |  Branch (3130:65): [True: 4.73M, False: 1.84M]
  ------------------
 3131|  6.57M|                WORD32 row, col;
 3132|  6.57M|                WORD32 pu_cnt;
 3133|  6.57M|                WORD32 num_pu_per_ctb;
 3134|  6.57M|                WORD32 cur_ctb_idx;
 3135|  6.57M|                WORD32 next_ctb_idx;
 3136|  6.57M|                WORD32 ctb_start_pu_idx;
 3137|  6.57M|                UWORD32 *pu4_nbr_pu_idx = ps_proc->pu4_pic_pu_idx_map;
 3138|  6.57M|                WORD32 nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  341|  6.57M|#define MAX_CTB_SIZE        64
  ------------------
                              WORD32 nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2;
  ------------------
  |  |  357|  6.57M|#define MIN_PU_SIZE         4
  ------------------
 3139|  6.57M|                pu_t *ps_pu;
 3140|  6.57M|                WORD32 ctb_size_in_min_pu = (ctb_size / MIN_PU_SIZE);
  ------------------
  |  |  357|  6.57M|#define MIN_PU_SIZE         4
  ------------------
 3141|       |
 3142|       |                /* Neighbor PU idx update inside CTB */
 3143|       |                /* 1byte per 4x4. Indicates the PU idx that 4x4 block belongs to */
 3144|       |
 3145|  6.57M|                cur_ctb_idx = ps_codec->s_parse.i4_ctb_x
 3146|  6.57M|                                + ps_codec->s_parse.i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 3147|  6.57M|                next_ctb_idx = ps_codec->s_parse.i4_next_pu_ctb_cnt;
 3148|  6.57M|                num_pu_per_ctb = ps_codec->s_parse.pu4_pic_pu_idx[next_ctb_idx]
 3149|  6.57M|                                - ps_codec->s_parse.pu4_pic_pu_idx[cur_ctb_idx];
 3150|  6.57M|                ctb_start_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx[cur_ctb_idx];
 3151|  6.57M|                ps_pu = &ps_codec->s_parse.ps_pic_pu[ctb_start_pu_idx];
 3152|       |
 3153|  91.7M|                for(pu_cnt = 0; pu_cnt < num_pu_per_ctb; pu_cnt++, ps_pu++)
  ------------------
  |  Branch (3153:33): [True: 85.1M, False: 6.57M]
  ------------------
 3154|  85.1M|                {
 3155|  85.1M|                    UWORD32 cur_pu_idx;
 3156|  85.1M|                    WORD32 pu_ht = (ps_pu->b4_ht + 1) << 2;
 3157|  85.1M|                    WORD32 pu_wd = (ps_pu->b4_wd + 1) << 2;
 3158|       |
 3159|  85.1M|                    cur_pu_idx = ctb_start_pu_idx + pu_cnt;
 3160|       |
 3161|   269M|                    for(row = 0; row < pu_ht / MIN_PU_SIZE; row++)
  ------------------
  |  |  357|   269M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (3161:34): [True: 184M, False: 85.1M]
  ------------------
 3162|   689M|                        for(col = 0; col < pu_wd / MIN_PU_SIZE; col++)
  ------------------
  |  |  357|   689M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (3162:38): [True: 505M, False: 184M]
  ------------------
 3163|   505M|                            pu4_nbr_pu_idx[(1 + ps_pu->b4_pos_x + col)
 3164|   505M|                                            + (1 + ps_pu->b4_pos_y + row)
 3165|   505M|                                            * nbr_pu_idx_strd] =
 3166|   505M|                                            cur_pu_idx;
 3167|  85.1M|                }
 3168|       |
 3169|       |                /* Updating Top and Left pointers */
 3170|  6.57M|                {
 3171|  6.57M|                    WORD32 rows_remaining = ps_sps->i2_pic_height_in_luma_samples
 3172|  6.57M|                                    - (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size);
 3173|  6.57M|                    WORD32 ctb_size_left = MIN(ctb_size, rows_remaining);
  ------------------
  |  |   43|  6.57M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 6.35M, False: 220k]
  |  |  ------------------
  ------------------
 3174|       |
 3175|       |                    /* Top Left */
 3176|       |                    /* saving top left before updating top ptr, as updating top ptr will overwrite the top left for the next ctb */
 3177|  6.57M|                    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];
  ------------------
  |  |  357|  6.57M|#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];
  ------------------
  |  |  357|  6.57M|#define MIN_PU_SIZE         4
  ------------------
 3178|  54.6M|                    for(i = 0; i < ctb_size / MIN_PU_SIZE; i++)
  ------------------
  |  |  357|  54.6M|#define MIN_PU_SIZE         4
  ------------------
  |  Branch (3178:32): [True: 48.0M, False: 6.57M]
  ------------------
 3179|  48.0M|                    {
 3180|       |                        /* Left */
 3181|       |                        /* Last column of au4_nbr_pu_idx */
 3182|  48.0M|                        ps_proc->pu4_pic_pu_idx_left[i] = pu4_nbr_pu_idx[(ctb_size / MIN_PU_SIZE)
  ------------------
  |  |  357|  48.0M|#define MIN_PU_SIZE         4
  ------------------
 3183|  48.0M|                                        + (i + 1) * nbr_pu_idx_strd];
 3184|       |                        /* Top */
 3185|       |                        /* Last row of au4_nbr_pu_idx */
 3186|  48.0M|                        ps_proc->pu4_pic_pu_idx_top[(ps_codec->s_parse.i4_ctb_x * ctb_size / MIN_PU_SIZE) + i] =
  ------------------
  |  |  357|  48.0M|#define MIN_PU_SIZE         4
  ------------------
 3187|  48.0M|                                        pu4_nbr_pu_idx[(ctb_size_left / MIN_PU_SIZE) * nbr_pu_idx_strd + i + 1];
  ------------------
  |  |  357|  48.0M|#define MIN_PU_SIZE         4
  ------------------
 3188|       |
 3189|  48.0M|                    }
 3190|  6.57M|                }
 3191|       |
 3192|       |                /* Updating the CTB level PU idx (Used for collocated MV pred)*/
 3193|  6.57M|                {
 3194|  6.57M|                    WORD32 ctb_row, ctb_col, index_pic_map, index_nbr_map;
 3195|  6.57M|                    WORD32 first_pu_of_ctb;
 3196|  6.57M|                    first_pu_of_ctb = pu4_nbr_pu_idx[1 + nbr_pu_idx_strd];
 3197|  6.57M|                    UWORD32 cur_ctb_ht_in_min_pu = MIN(((ps_sps->i2_pic_height_in_luma_samples
  ------------------
  |  |   43|  6.57M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 217k, False: 6.35M]
  |  |  ------------------
  ------------------
 3198|  6.57M|                            - (ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size)) / MIN_PU_SIZE), ctb_size_in_min_pu);
 3199|  6.57M|                    UWORD32 cur_ctb_wd_in_min_pu = MIN(((ps_sps->i2_pic_width_in_luma_samples
  ------------------
  |  |   43|  6.57M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 365k, False: 6.21M]
  |  |  ------------------
  ------------------
 3200|  6.57M|                                - (ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size)) / MIN_PU_SIZE), ctb_size_in_min_pu);
 3201|       |
 3202|  6.57M|                    index_pic_map = 0 * ctb_size_in_min_pu + 0;
 3203|  6.57M|                    index_nbr_map = (0 + 1) * nbr_pu_idx_strd + (0 + 1);
 3204|       |
 3205|  52.9M|                    for(ctb_row = 0; ctb_row < cur_ctb_ht_in_min_pu; ctb_row++)
  ------------------
  |  Branch (3205:38): [True: 46.3M, False: 6.57M]
  ------------------
 3206|  46.3M|                    {
 3207|   551M|                        for(ctb_col = 0; ctb_col < cur_ctb_wd_in_min_pu; ctb_col++)
  ------------------
  |  Branch (3207:42): [True: 505M, False: 46.3M]
  ------------------
 3208|   505M|                        {
 3209|   505M|                            pu1_pic_pu_map_ctb[index_pic_map + ctb_col] = pu4_nbr_pu_idx[index_nbr_map + ctb_col]
 3210|   505M|                                            - first_pu_of_ctb;
 3211|   505M|                        }
 3212|  46.3M|                        index_pic_map += ctb_size_in_min_pu;
 3213|  46.3M|                        index_nbr_map += nbr_pu_idx_strd;
 3214|  46.3M|                    }
 3215|  6.57M|                }
 3216|  6.57M|            }
 3217|       |
 3218|       |            /*************************************************/
 3219|       |            /******************  BS, QP  *********************/
 3220|       |            /*************************************************/
 3221|       |            /* Check if deblock is disabled for the current slice or if it is disabled for the current picture
 3222|       |             * because of disable deblock api
 3223|       |             */
 3224|  6.69M|            if(0 == ps_codec->i4_disable_deblk_pic)
  ------------------
  |  Branch (3224:16): [True: 6.69M, False: 0]
  ------------------
 3225|  6.69M|            {
 3226|       |                /* Boundary strength calculation is done irrespective of whether deblocking is disabled
 3227|       |                 * in the slice or not, to handle deblocking slice boundaries */
 3228|  6.69M|                if((0 == ps_codec->i4_slice_error))
  ------------------
  |  Branch (3228:20): [True: 752k, False: 5.94M]
  ------------------
 3229|   752k|                {
 3230|   752k|                    WORD32 i4_ctb_tu_cnt;
 3231|   752k|                    WORD32 cur_ctb_idx, next_ctb_idx;
 3232|   752k|                    WORD32 cur_pu_idx;
 3233|   752k|                    WORD32 cur_tu_idx;
 3234|   752k|                    process_ctxt_t *ps_proc;
 3235|       |
 3236|   752k|                    ps_proc = &ps_codec->as_process[(ps_codec->i4_num_cores == 1) ? 1 : (ps_codec->i4_num_cores - 1)];
  ------------------
  |  Branch (3236:53): [True: 28.6k, False: 724k]
  ------------------
 3237|   752k|                    cur_ctb_idx = ps_codec->s_parse.i4_ctb_x
 3238|   752k|                                    + ps_codec->s_parse.i4_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 3239|       |
 3240|   752k|                    cur_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx[cur_ctb_idx];
 3241|   752k|                    next_ctb_idx = ps_codec->s_parse.i4_next_tu_ctb_cnt;
 3242|   752k|                    if(1 == ps_codec->i4_num_cores)
  ------------------
  |  Branch (3242:24): [True: 28.6k, False: 724k]
  ------------------
 3243|  28.6k|                    {
 3244|  28.6k|                        i4_ctb_tu_cnt = ps_codec->s_parse.pu4_pic_tu_idx[next_ctb_idx] -
 3245|  28.6k|                                        ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx % RESET_TU_BUF_NCTB];
  ------------------
  |  |  179|  28.6k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  170|  28.6k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  28.6k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  28.6k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  28.6k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  28.6k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3246|       |
 3247|  28.6k|                        cur_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx % RESET_TU_BUF_NCTB];
  ------------------
  |  |  179|  28.6k|#define RESET_TU_BUF_NCTB MAX_NUM_CTBS_IN_FRAME
  |  |  ------------------
  |  |  |  |  170|  28.6k|#define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   53|  28.6k|#define MAX_WD   8448
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   64|  28.6k|#define MAX_HT   4320
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  28.6k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  |  |               #define MAX_NUM_CTBS_IN_FRAME (MAX_WD * MAX_HT / MIN_CTB_SIZE / MIN_CTB_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  28.6k|#define MIN_CTB_SIZE        16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3248|  28.6k|                    }
 3249|   724k|                    else
 3250|   724k|                    {
 3251|   724k|                        i4_ctb_tu_cnt = ps_codec->s_parse.pu4_pic_tu_idx[next_ctb_idx] -
 3252|   724k|                                        ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx];
 3253|       |
 3254|   724k|                        cur_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx[cur_ctb_idx];
 3255|   724k|                    }
 3256|       |
 3257|   752k|                    ps_codec->s_parse.s_bs_ctxt.ps_pps = ps_codec->s_parse.ps_pps;
 3258|   752k|                    ps_codec->s_parse.s_bs_ctxt.ps_sps = ps_codec->s_parse.ps_sps;
 3259|   752k|                    ps_codec->s_parse.s_bs_ctxt.ps_codec = ps_codec;
 3260|   752k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_tu_cnt = i4_ctb_tu_cnt;
 3261|   752k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_x = ps_codec->s_parse.i4_ctb_x;
 3262|   752k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_y = ps_codec->s_parse.i4_ctb_y;
 3263|   752k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_tile_x = ps_codec->s_parse.i4_ctb_tile_x;
 3264|   752k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_tile_y = ps_codec->s_parse.i4_ctb_tile_y;
 3265|   752k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_slice_x = ps_codec->s_parse.i4_ctb_slice_x;
 3266|   752k|                    ps_codec->s_parse.s_bs_ctxt.i4_ctb_slice_y = ps_codec->s_parse.i4_ctb_slice_y;
 3267|   752k|                    ps_codec->s_parse.s_bs_ctxt.ps_tu = &ps_codec->s_parse.ps_pic_tu[cur_tu_idx];
 3268|   752k|                    ps_codec->s_parse.s_bs_ctxt.ps_pu = &ps_codec->s_parse.ps_pic_pu[cur_pu_idx];
 3269|   752k|                    ps_codec->s_parse.s_bs_ctxt.pu4_pic_pu_idx_map = ps_proc->pu4_pic_pu_idx_map;
 3270|   752k|                    ps_codec->s_parse.s_bs_ctxt.i4_next_pu_ctb_cnt = ps_codec->s_parse.i4_next_pu_ctb_cnt;
 3271|   752k|                    ps_codec->s_parse.s_bs_ctxt.i4_next_tu_ctb_cnt = ps_codec->s_parse.i4_next_tu_ctb_cnt;
 3272|   752k|                    ps_codec->s_parse.s_bs_ctxt.pu1_slice_idx = ps_codec->s_parse.pu1_slice_idx;
 3273|   752k|                    ps_codec->s_parse.s_bs_ctxt.ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
 3274|   752k|                    ps_codec->s_parse.s_bs_ctxt.ps_tile = ps_codec->s_parse.ps_tile;
 3275|       |
 3276|   752k|                    if(ISLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (3276:24): [True: 720k, False: 32.0k]
  ------------------
 3277|   720k|                    {
 3278|   720k|                        ihevcd_ctb_boundary_strength_islice(&ps_codec->s_parse.s_bs_ctxt);
 3279|   720k|                    }
 3280|  32.0k|                    else
 3281|  32.0k|                    {
 3282|  32.0k|                        ihevcd_ctb_boundary_strength_pbslice(&ps_codec->s_parse.s_bs_ctxt);
 3283|  32.0k|                    }
 3284|   752k|                }
 3285|       |
 3286|       |                /* Boundary strength is set to zero if deblocking is disabled for the current slice */
 3287|  6.69M|                if(0 != ps_slice_hdr->i1_slice_disable_deblocking_filter_flag)
  ------------------
  |  Branch (3287:20): [True: 4.26k, False: 6.69M]
  ------------------
 3288|  4.26k|                {
 3289|  4.26k|                    WORD32 bs_strd = (ps_sps->i2_pic_wd_in_ctb + 1) * (ctb_size * ctb_size / 8 / 16);
 3290|       |
 3291|  4.26k|                    UWORD32 *pu4_vert_bs = (UWORD32 *)((UWORD8 *)ps_codec->s_parse.s_bs_ctxt.pu4_pic_vert_bs +
 3292|  4.26k|                                    ps_codec->s_parse.i4_ctb_x * (ctb_size * ctb_size / 8 / 16) +
 3293|  4.26k|                                    ps_codec->s_parse.i4_ctb_y * bs_strd);
 3294|  4.26k|                    UWORD32 *pu4_horz_bs = (UWORD32 *)((UWORD8 *)ps_codec->s_parse.s_bs_ctxt.pu4_pic_horz_bs +
 3295|  4.26k|                                    ps_codec->s_parse.i4_ctb_x * (ctb_size * ctb_size / 8 / 16) +
 3296|  4.26k|                                    ps_codec->s_parse.i4_ctb_y * bs_strd);
 3297|       |
 3298|  4.26k|                    memset(pu4_vert_bs, 0, (ctb_size / 8) * (ctb_size / 4) / 8 * 2);
 3299|  4.26k|                    memset(pu4_horz_bs, 0, (ctb_size / 8) * (ctb_size / 4) / 8 * 2);
 3300|  4.26k|                }
 3301|  6.69M|            }
 3302|       |
 3303|  6.69M|        }
 3304|       |
 3305|  7.49M|        DATA_SYNC();
  ------------------
  |  |  100|  7.49M|#define DATA_SYNC()  __sync_synchronize()
  ------------------
 3306|       |
 3307|       |        /* Update the parse status map */
 3308|  7.49M|        {
 3309|  7.49M|            sps_t *ps_sps = ps_codec->s_parse.ps_sps;
 3310|  7.49M|            UWORD8 *pu1_buf;
 3311|  7.49M|            WORD32 idx;
 3312|  7.49M|            idx = (ps_codec->s_parse.i4_ctb_x);
 3313|  7.49M|            idx += ((ps_codec->s_parse.i4_ctb_y) * ps_sps->i2_pic_wd_in_ctb);
 3314|  7.49M|            pu1_buf = (ps_codec->pu1_parse_map + idx);
 3315|  7.49M|            *pu1_buf = 1;
 3316|  7.49M|        }
 3317|       |
 3318|       |        /* Increment CTB x and y positions */
 3319|  7.49M|        ps_codec->s_parse.i4_ctb_tile_x++;
 3320|  7.49M|        ps_codec->s_parse.i4_ctb_x++;
 3321|  7.49M|        ps_codec->s_parse.i4_ctb_slice_x++;
 3322|       |
 3323|       |        /*If tiles are enabled, handle the slice counters differently*/
 3324|  7.49M|        if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (3324:12): [True: 58.1k, False: 7.43M]
  ------------------
 3325|  58.1k|        {
 3326|       |            //Indicates multiple tiles in a slice case
 3327|  58.1k|            tile_start_ctb_idx = ps_tile->u1_pos_x
 3328|  58.1k|                            + ps_tile->u1_pos_y * (ps_sps->i2_pic_wd_in_ctb);
 3329|       |
 3330|  58.1k|            slice_start_ctb_idx =  ps_slice_hdr->i2_ctb_x
 3331|  58.1k|                            + ps_slice_hdr->i2_ctb_y * (ps_sps->i2_pic_wd_in_ctb);
 3332|       |
 3333|  58.1k|            if((slice_start_ctb_idx < tile_start_ctb_idx))
  ------------------
  |  Branch (3333:16): [True: 25.7k, False: 32.3k]
  ------------------
 3334|  25.7k|            {
 3335|  25.7k|                if(ps_codec->s_parse.i4_ctb_slice_x == (ps_tile->u1_pos_x + ps_tile->u2_wd))
  ------------------
  |  Branch (3335:20): [True: 10.9k, False: 14.7k]
  ------------------
 3336|  10.9k|                {
 3337|       |                    /* Reached end of slice row within a tile /frame */
 3338|  10.9k|                    ps_codec->s_parse.i4_ctb_slice_y++;
 3339|  10.9k|                    ps_codec->s_parse.i4_ctb_slice_x = ps_tile->u1_pos_x; //todo:Check
 3340|  10.9k|                }
 3341|  25.7k|            }
 3342|       |            //Indicates multiple slices in a tile case - hence, reset slice_x
 3343|  32.3k|            else if(ps_codec->s_parse.i4_ctb_slice_x == (ps_tile->u2_wd))
  ------------------
  |  Branch (3343:21): [True: 3.00k, False: 29.3k]
  ------------------
 3344|  3.00k|            {
 3345|  3.00k|                ps_codec->s_parse.i4_ctb_slice_y++;
 3346|  3.00k|                ps_codec->s_parse.i4_ctb_slice_x = 0;
 3347|  3.00k|            }
 3348|  58.1k|        }
 3349|  7.43M|        else
 3350|  7.43M|        {
 3351|  7.43M|            if(ps_codec->s_parse.i4_ctb_slice_x == ps_tile->u2_wd)
  ------------------
  |  Branch (3351:16): [True: 443k, False: 6.99M]
  ------------------
 3352|   443k|            {
 3353|       |                /* Reached end of slice row within a tile /frame */
 3354|   443k|                ps_codec->s_parse.i4_ctb_slice_y++;
 3355|   443k|                ps_codec->s_parse.i4_ctb_slice_x = 0;
 3356|   443k|            }
 3357|  7.43M|        }
 3358|       |
 3359|       |
 3360|  7.49M|        if(ps_codec->s_parse.i4_ctb_tile_x == (ps_tile->u2_wd))
  ------------------
  |  Branch (3360:12): [True: 484k, False: 7.00M]
  ------------------
 3361|   484k|        {
 3362|       |            /* Reached end of tile row */
 3363|   484k|            ps_codec->s_parse.i4_ctb_tile_x = 0;
 3364|   484k|            ps_codec->s_parse.i4_ctb_x = ps_tile->u1_pos_x;
 3365|       |
 3366|   484k|            ps_codec->s_parse.i4_ctb_tile_y++;
 3367|   484k|            ps_codec->s_parse.i4_ctb_y++;
 3368|       |
 3369|   484k|            if(ps_codec->s_parse.i4_ctb_tile_y == (ps_tile->u2_ht))
  ------------------
  |  Branch (3369:16): [True: 13.9k, False: 470k]
  ------------------
 3370|  13.9k|            {
 3371|       |                /* Reached End of Tile */
 3372|  13.9k|                ps_codec->s_parse.i4_ctb_tile_y = 0;
 3373|  13.9k|                ps_codec->s_parse.i4_ctb_tile_x = 0;
 3374|  13.9k|                ps_codec->s_parse.ps_tile++;
 3375|       |
 3376|  13.9k|                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 (3376:20): [True: 13.6k, False: 290]
  |  Branch (3376:90): [True: 9.14k, False: 4.47k]
  ------------------
 3377|  9.14k|                {
 3378|       |                    /* Reached end of frame */
 3379|  9.14k|                    end_of_pic = 1;
 3380|  9.14k|                    ps_codec->s_parse.i4_ctb_x = 0;
 3381|  9.14k|                    ps_codec->s_parse.i4_ctb_y = ps_sps->i2_pic_ht_in_ctb;
 3382|  9.14k|                }
 3383|  4.76k|                else
 3384|  4.76k|                {
 3385|       |                    /* Initialize ctb_x and ctb_y to start of next tile */
 3386|  4.76k|                    ps_tile = ps_codec->s_parse.ps_tile;
 3387|  4.76k|                    ps_codec->s_parse.i4_ctb_x = ps_tile->u1_pos_x;
 3388|  4.76k|                    ps_codec->s_parse.i4_ctb_y = ps_tile->u1_pos_y;
 3389|  4.76k|                    ps_codec->s_parse.i4_ctb_tile_y = 0;
 3390|  4.76k|                    ps_codec->s_parse.i4_ctb_tile_x = 0;
 3391|  4.76k|                    ps_codec->s_parse.i4_ctb_slice_x = ps_tile->u1_pos_x;
 3392|  4.76k|                    ps_codec->s_parse.i4_ctb_slice_y = ps_tile->u1_pos_y;
 3393|       |
 3394|  4.76k|                }
 3395|  13.9k|            }
 3396|       |
 3397|   484k|        }
 3398|       |
 3399|  7.49M|        ps_codec->s_parse.i4_next_ctb_indx = ps_codec->s_parse.i4_ctb_x +
 3400|  7.49M|                        ps_codec->s_parse.i4_ctb_y * ps_sps->i2_pic_wd_in_ctb;
 3401|       |
 3402|       |        /* If the current slice is in error, check if the next slice's address
 3403|       |         * is reached and mark the end_of_slice flag */
 3404|  7.49M|        if(ps_codec->i4_slice_error)
  ------------------
  |  Branch (3404:12): [True: 6.48M, False: 1.01M]
  ------------------
 3405|  6.48M|        {
 3406|  6.48M|            slice_header_t *ps_slice_hdr_next = ps_slice_hdr + 1;
 3407|  6.48M|            WORD32 next_slice_addr = ps_slice_hdr_next->i2_ctb_x +
 3408|  6.48M|                            ps_slice_hdr_next->i2_ctb_y * ps_sps->i2_pic_wd_in_ctb;
 3409|       |
 3410|  6.48M|            if(ps_codec->s_parse.i4_next_ctb_indx == next_slice_addr)
  ------------------
  |  Branch (3410:16): [True: 7.46k, False: 6.47M]
  ------------------
 3411|  7.46k|                end_of_slice_flag = 1;
 3412|  6.48M|        }
 3413|       |
 3414|       |        /* If the codec is running in single core mode
 3415|       |         * then call process function for current CTB
 3416|       |         */
 3417|  7.49M|        if((1 == ps_codec->i4_num_cores) && (ps_codec->s_parse.i4_ctb_tile_x == 0))
  ------------------
  |  Branch (3417:12): [True: 4.82M, False: 2.67M]
  |  Branch (3417:45): [True: 278k, False: 4.54M]
  ------------------
 3418|   278k|        {
 3419|   278k|            process_ctxt_t *ps_proc = &ps_codec->as_process[0];
 3420|       |//          ps_proc->i4_ctb_cnt = ihevcd_nctb_cnt(ps_codec, ps_sps);
 3421|   278k|            ps_proc->i4_ctb_cnt = ps_proc->ps_tile->u2_wd;
 3422|   278k|            ihevcd_process(ps_proc);
 3423|   278k|        }
 3424|       |
 3425|       |        /* If the bytes for the current slice are exhausted
 3426|       |         * set end_of_slice flag to 1
 3427|       |         * This slice will be treated as incomplete */
 3428|  7.49M|        if((UWORD8 *)ps_codec->s_parse.s_bitstrm.pu1_buf_max + BITSTRM_OFF_THRS <
  ------------------
  |  |   83|  7.49M|#define BITSTRM_OFF_THRS 8
  ------------------
  |  Branch (3428:12): [True: 553k, False: 6.94M]
  ------------------
 3429|  7.49M|                                        ((UWORD8 *)ps_codec->s_parse.s_bitstrm.pu4_buf + (ps_codec->s_parse.s_bitstrm.u4_bit_ofst / 8)))
 3430|   553k|        {
 3431|       |            // end_of_slice_flag = ps_codec->i4_slice_error ? 0 : 1;
 3432|       |
 3433|   553k|            if(0 == ps_codec->i4_slice_error)
  ------------------
  |  Branch (3433:16): [True: 6.71k, False: 547k]
  ------------------
 3434|  6.71k|                end_of_slice_flag = 1;
 3435|   553k|        }
 3436|       |
 3437|       |
 3438|  7.49M|        if(end_of_pic)
  ------------------
  |  Branch (3438:12): [True: 9.14k, False: 7.48M]
  ------------------
 3439|  9.14k|            break;
 3440|  7.49M|    } while(!end_of_slice_flag);
  ------------------
  |  Branch (3440:13): [True: 7.47M, False: 8.94k]
  ------------------
 3441|       |
 3442|       |    /* Reset slice error */
 3443|  18.0k|    ps_codec->i4_slice_error = 0;
 3444|       |
 3445|       |    /* Increment the slice index for parsing next slice */
 3446|  18.0k|    if(0 == end_of_pic)
  ------------------
  |  Branch (3446:8): [True: 8.94k, False: 9.14k]
  ------------------
 3447|  8.94k|    {
 3448|  8.94k|        while(1)
  ------------------
  |  Branch (3448:15): [Folded - Ignored]
  ------------------
 3449|  8.94k|        {
 3450|       |
 3451|  8.94k|            WORD32 parse_slice_idx;
 3452|  8.94k|            parse_slice_idx = ps_codec->s_parse.i4_cur_slice_idx;
 3453|  8.94k|            parse_slice_idx++;
 3454|       |
 3455|  8.94k|            {
 3456|       |                /* If the next slice header is not initialized, update cur_slice_idx and break */
 3457|  8.94k|                if((1 == ps_codec->i4_num_cores) || (0 != (parse_slice_idx & (MAX_SLICE_HDR_CNT - 1))))
  ------------------
  |  |  153|  6.60k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  6.60k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  |  Branch (3457:20): [True: 2.33k, False: 6.60k]
  |  Branch (3457:53): [True: 6.60k, False: 0]
  ------------------
 3458|  8.94k|                {
 3459|  8.94k|                    ps_codec->s_parse.i4_cur_slice_idx = parse_slice_idx;
 3460|  8.94k|                    break;
 3461|  8.94k|                }
 3462|       |
 3463|       |                /* If the next slice header is initialised, wait for the parsed slices to be processed */
 3464|      0|                else
 3465|      0|                {
 3466|      0|                    WORD32 ctb_indx = 0;
 3467|       |
 3468|      0|                    while(ctb_indx != ps_sps->i4_pic_size_in_ctb)
  ------------------
  |  Branch (3468:27): [True: 0, False: 0]
  ------------------
 3469|      0|                    {
 3470|      0|                        WORD32 parse_status = *(ps_codec->pu1_parse_map + ctb_indx);
 3471|      0|                        volatile WORD32 proc_status = *(ps_codec->pu1_proc_map + ctb_indx) & 1;
 3472|       |
 3473|      0|                        if(parse_status == proc_status)
  ------------------
  |  Branch (3473:28): [True: 0, False: 0]
  ------------------
 3474|      0|                            ctb_indx++;
 3475|      0|                    }
 3476|      0|                    ps_codec->s_parse.i4_cur_slice_idx = parse_slice_idx;
 3477|      0|                    break;
 3478|      0|                }
 3479|       |
 3480|  8.94k|            }
 3481|  8.94k|        }
 3482|       |
 3483|  8.94k|    }
 3484|  9.14k|    else
 3485|  9.14k|    {
 3486|       |#if FRAME_ILF_PAD
 3487|       |        if(FRAME_ILF_PAD && 1 == ps_codec->i4_num_cores)
 3488|       |        {
 3489|       |            if(ps_slice_hdr->i4_abs_pic_order_cnt == 0)
 3490|       |            {
 3491|       |                DUMP_PRE_ILF(ps_codec->as_process[0].pu1_cur_pic_luma,
 3492|       |                             ps_codec->as_process[0].pu1_cur_pic_chroma,
 3493|       |                             ps_sps->i2_pic_width_in_luma_samples,
 3494|       |                             ps_sps->i2_pic_height_in_luma_samples,
 3495|       |                             ps_codec->i4_strd);
 3496|       |
 3497|       |                DUMP_BS(ps_codec->as_process[0].s_bs_ctxt.pu4_pic_vert_bs,
 3498|       |                        ps_codec->as_process[0].s_bs_ctxt.pu4_pic_horz_bs,
 3499|       |                        ps_sps->i2_pic_wd_in_ctb * (ctb_size * ctb_size / 8 / 16) * ps_sps->i2_pic_ht_in_ctb,
 3500|       |                        (ps_sps->i2_pic_wd_in_ctb + 1) * (ctb_size * ctb_size / 8 / 16) * ps_sps->i2_pic_ht_in_ctb);
 3501|       |
 3502|       |                DUMP_QP(ps_codec->as_process[0].s_bs_ctxt.pu1_pic_qp,
 3503|       |                        (ps_sps->i2_pic_height_in_luma_samples * ps_sps->i2_pic_width_in_luma_samples) / (MIN_CU_SIZE * MIN_CU_SIZE));
 3504|       |
 3505|       |                DUMP_QP_CONST_IN_CTB(ps_codec->as_process[0].s_bs_ctxt.pu1_pic_qp_const_in_ctb,
 3506|       |                                     (ps_sps->i2_pic_height_in_luma_samples * ps_sps->i2_pic_width_in_luma_samples) / (MIN_CTB_SIZE * MIN_CTB_SIZE) / 8);
 3507|       |
 3508|       |                DUMP_NO_LOOP_FILTER(ps_codec->as_process[0].pu1_pic_no_loop_filter_flag,
 3509|       |                                    (ps_sps->i2_pic_width_in_luma_samples / MIN_CU_SIZE) * (ps_sps->i2_pic_height_in_luma_samples / MIN_CU_SIZE) / 8);
 3510|       |
 3511|       |                DUMP_OFFSETS(ps_slice_hdr->i1_beta_offset_div2,
 3512|       |                             ps_slice_hdr->i1_tc_offset_div2,
 3513|       |                             ps_pps->i1_pic_cb_qp_offset,
 3514|       |                             ps_pps->i1_pic_cr_qp_offset);
 3515|       |            }
 3516|       |            ps_codec->s_parse.s_deblk_ctxt.ps_pps = ps_codec->s_parse.ps_pps;
 3517|       |            ps_codec->s_parse.s_deblk_ctxt.ps_sps = ps_codec->s_parse.ps_sps;
 3518|       |            ps_codec->s_parse.s_deblk_ctxt.ps_codec = ps_codec;
 3519|       |            ps_codec->s_parse.s_deblk_ctxt.ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
 3520|       |            ps_codec->s_parse.s_deblk_ctxt.is_chroma_yuv420sp_vu = (ps_codec->e_ref_chroma_fmt == IV_YUV_420SP_VU);
 3521|       |
 3522|       |            ps_codec->s_parse.s_sao_ctxt.ps_pps = ps_codec->s_parse.ps_pps;
 3523|       |            ps_codec->s_parse.s_sao_ctxt.ps_sps = ps_codec->s_parse.ps_sps;
 3524|       |            ps_codec->s_parse.s_sao_ctxt.ps_codec = ps_codec;
 3525|       |            ps_codec->s_parse.s_sao_ctxt.ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
 3526|       |
 3527|       |            ihevcd_ilf_pad_frame(&ps_codec->s_parse.s_deblk_ctxt, &ps_codec->s_parse.s_sao_ctxt);
 3528|       |
 3529|       |        }
 3530|       |#endif
 3531|  9.14k|        ps_codec->s_parse.i4_end_of_frame = 1;
 3532|  9.14k|    }
 3533|  18.0k|    return ret;
 3534|  18.0k|}

ihevcd_ref_pic_list_modification:
  143|  1.66k|{
  144|  1.66k|    WORD32 ret = IHEVCD_SUCCESS;
  145|  1.66k|    WORD32 value;
  146|  1.66k|    WORD32 i;
  147|  1.66k|    rplm_t *ps_rplm;
  148|  1.66k|    WORD32 num_bits_list_entry;
  149|       |
  150|  1.66k|    ps_rplm = &(ps_slice_hdr->s_rplm);
  151|       |
  152|       |    /* Calculate Ceil(Log2(num_poc_total_curr)) */
  153|  1.66k|    {
  154|  1.66k|        num_bits_list_entry = 32 - CLZ(num_poc_total_curr);
  155|       |        /* Check if num_poc_total_curr is power of 2 */
  156|  1.66k|        if(0 == (num_poc_total_curr & (num_poc_total_curr - 1)))
  ------------------
  |  Branch (156:12): [True: 851, False: 809]
  ------------------
  157|    851|        {
  158|    851|            num_bits_list_entry--;
  159|    851|        }
  160|  1.66k|    }
  161|       |
  162|  1.66k|    if(ps_slice_hdr->i1_slice_type  == PSLICE || ps_slice_hdr->i1_slice_type  == BSLICE)
  ------------------
  |  Branch (162:8): [True: 63, False: 1.59k]
  |  Branch (162:50): [True: 1.59k, False: 0]
  ------------------
  163|  1.66k|    {
  164|  1.66k|        BITS_PARSE("ref_pic_list_modification_flag_l0", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  1.66k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  165|  1.66k|        ps_rplm->i1_ref_pic_list_modification_flag_l0 = value;
  166|       |
  167|  1.66k|        if(ps_rplm->i1_ref_pic_list_modification_flag_l0)
  ------------------
  |  Branch (167:12): [True: 618, False: 1.04k]
  ------------------
  168|  3.25k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (168:24): [True: 2.63k, False: 618]
  ------------------
  169|  2.63k|            {
  170|  2.63k|                BITS_PARSE("list_entry_l0", value, ps_bitstrm, num_bits_list_entry);
  ------------------
  |  |  148|  2.63k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  171|  2.63k|                ps_rplm->i1_list_entry_l0[i] = value;
  172|       |
  173|  2.63k|                ps_rplm->i1_list_entry_l0[i] = CLIP3(ps_rplm->i1_list_entry_l0[i], 0, num_poc_total_curr - 1);
  ------------------
  |  |   40|  2.63k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 1.35k, False: 1.28k]
  |  |  |  Branch (40:53): [True: 0, False: 1.28k]
  |  |  ------------------
  ------------------
  174|  2.63k|            }
  175|  1.66k|    }
  176|       |
  177|  1.66k|    if(ps_slice_hdr->i1_slice_type  == BSLICE)
  ------------------
  |  Branch (177:8): [True: 1.59k, False: 63]
  ------------------
  178|  1.59k|    {
  179|  1.59k|        BITS_PARSE("ref_pic_list_modification_flag_l1", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  1.59k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  180|  1.59k|        ps_rplm->i1_ref_pic_list_modification_flag_l1 = value;
  181|       |
  182|  1.59k|        if(ps_rplm->i1_ref_pic_list_modification_flag_l1)
  ------------------
  |  Branch (182:12): [True: 482, False: 1.11k]
  ------------------
  183|  1.72k|            for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++)
  ------------------
  |  Branch (183:24): [True: 1.24k, False: 482]
  ------------------
  184|  1.24k|            {
  185|  1.24k|                BITS_PARSE("list_entry_l1", value, ps_bitstrm, num_bits_list_entry);
  ------------------
  |  |  148|  1.24k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  186|  1.24k|                ps_rplm->i1_list_entry_l1[i] = value;
  187|       |
  188|  1.24k|                ps_rplm->i1_list_entry_l1[i] = CLIP3(ps_rplm->i1_list_entry_l1[i], 0, num_poc_total_curr - 1);
  ------------------
  |  |   40|  1.24k|#define CLIP3(x, min, max) (((x) > (max)) ? (max) :(((x) < (min))? (min):(x)))
  |  |  ------------------
  |  |  |  Branch (40:29): [True: 694, False: 549]
  |  |  |  Branch (40:53): [True: 0, False: 549]
  |  |  ------------------
  ------------------
  189|  1.24k|            }
  190|       |
  191|  1.59k|    }
  192|       |
  193|  1.66k|    return ret;
  194|  1.66k|}
ihevcd_parse_slice_header:
  219|  42.3k|{
  220|  42.3k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  221|  42.3k|    UWORD32 value;
  222|  42.3k|    WORD32 i4_value;
  223|  42.3k|    WORD32 i, j;
  224|  42.3k|    WORD32 sps_id;
  225|       |
  226|  42.3k|    pps_t *ps_pps;
  227|  42.3k|    sps_t *ps_sps;
  228|  42.3k|    slice_header_t *ps_slice_hdr;
  229|  42.3k|    WORD32 disable_deblocking_filter_flag;
  230|  42.3k|    bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm;
  231|  42.3k|    WORD32 idr_pic_flag;
  232|  42.3k|    WORD32 pps_id;
  233|  42.3k|    WORD32 first_slice_in_pic_flag;
  234|  42.3k|    WORD32 no_output_of_prior_pics_flag = 0;
  235|  42.3k|    WORD8 i1_nal_unit_type = ps_nal->i1_nal_unit_type;
  236|  42.3k|    WORD32 num_poc_total_curr = 0;
  237|  42.3k|    UWORD32 slice_address;
  238|  42.3k|    WORD32 prev_slice_incomplete_flag = 0;
  239|       |
  240|  42.3k|    if(ps_codec->i4_slice_error == 1)
  ------------------
  |  Branch (240:8): [True: 4.87k, False: 37.5k]
  ------------------
  241|  4.87k|        return ret;
  242|       |
  243|  37.5k|    idr_pic_flag = (NAL_IDR_W_LP == i1_nal_unit_type) ||
  ------------------
  |  Branch (243:20): [True: 5.05k, False: 32.4k]
  ------------------
  244|  37.5k|                    (NAL_IDR_N_LP == i1_nal_unit_type);
  ------------------
  |  Branch (244:21): [True: 5.97k, False: 26.4k]
  ------------------
  245|       |
  246|       |
  247|  37.5k|    BITS_PARSE("first_slice_in_pic_flag", first_slice_in_pic_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  37.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  248|  37.5k|    if((NAL_BLA_W_LP <= i1_nal_unit_type) &&
  ------------------
  |  Branch (248:8): [True: 14.5k, False: 22.9k]
  ------------------
  249|  37.5k|       (NAL_RSV_RAP_VCL23          >= i1_nal_unit_type))
  ------------------
  |  Branch (249:8): [True: 14.5k, False: 0]
  ------------------
  250|  14.5k|    {
  251|  14.5k|        BITS_PARSE("no_output_of_prior_pics_flag", no_output_of_prior_pics_flag, ps_bitstrm, 1);
  ------------------
  |  |  148|  14.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  252|  14.5k|    }
  253|  37.5k|    UEV_PARSE("pic_parameter_set_id", pps_id, ps_bitstrm);
  ------------------
  |  |  155|  37.5k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  254|  37.5k|    if(pps_id < 0 || pps_id > MAX_PPS_CNT - 2)
  ------------------
  |  |  334|  36.5k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (254:8): [True: 935, False: 36.5k]
  |  Branch (254:22): [True: 3.90k, False: 32.6k]
  ------------------
  255|  4.83k|    {
  256|  4.83k|        return IHEVCD_INVALID_PARAMETER;
  257|  4.83k|    }
  258|       |
  259|       |    /* Get the current PPS structure */
  260|  32.6k|    ps_pps = ps_codec->s_parse.ps_pps_base + pps_id;
  261|  32.6k|    if(0 == ps_pps->i1_pps_valid)
  ------------------
  |  Branch (261:8): [True: 1.90k, False: 30.7k]
  ------------------
  262|  1.90k|    {
  263|  1.90k|        pps_t *ps_pps_ref = ps_codec->ps_pps_base;
  264|  2.95k|        while(0 == ps_pps_ref->i1_pps_valid)
  ------------------
  |  Branch (264:15): [True: 1.05k, False: 1.90k]
  ------------------
  265|  1.05k|        {
  266|  1.05k|            ps_pps_ref++;
  267|  1.05k|            if((ps_pps_ref - ps_codec->ps_pps_base >= MAX_PPS_CNT - 1))
  ------------------
  |  |  334|  1.05k|#define MAX_PPS_CNT         (64 + 1)
  ------------------
  |  Branch (267:16): [True: 0, False: 1.05k]
  ------------------
  268|      0|                return IHEVCD_INVALID_HEADER;
  269|  1.05k|        }
  270|       |
  271|  1.90k|        ihevcd_copy_pps(ps_codec, pps_id, ps_pps_ref->i1_pps_id);
  272|  1.90k|    }
  273|       |
  274|       |    /* Get SPS id for the current PPS */
  275|  32.6k|    sps_id = ps_pps->i1_sps_id;
  276|       |
  277|       |    /* Get the current SPS structure */
  278|  32.6k|    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|  32.6k|    if((0 != ps_codec->u4_pic_cnt || ps_codec->i4_pic_present) &&
  ------------------
  |  Branch (284:9): [True: 28.8k, False: 3.88k]
  |  Branch (284:38): [True: 409, False: 3.47k]
  ------------------
  285|  32.6k|                    first_slice_in_pic_flag)
  ------------------
  |  Branch (285:21): [True: 20.4k, False: 8.75k]
  ------------------
  286|  20.4k|    {
  287|  20.4k|        if(ps_codec->i4_pic_present)
  ------------------
  |  Branch (287:12): [True: 1.17k, False: 19.2k]
  ------------------
  288|  1.17k|        {
  289|  1.17k|            slice_header_t *ps_slice_hdr_next;
  290|  1.17k|            ps_codec->i4_slice_error = 1;
  291|  1.17k|            ps_codec->s_parse.i4_cur_slice_idx--;
  292|  1.17k|            if(ps_codec->s_parse.i4_cur_slice_idx < 0)
  ------------------
  |  Branch (292:16): [True: 0, False: 1.17k]
  ------------------
  293|      0|                ps_codec->s_parse.i4_cur_slice_idx = 0;
  294|       |
  295|  1.17k|            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|  1.17k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  1.17k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  296|  1.17k|            ps_slice_hdr_next->i2_ctb_x = 0;
  297|  1.17k|            ps_slice_hdr_next->i2_ctb_y = ps_codec->s_parse.ps_sps->i2_pic_ht_in_ctb;
  298|  1.17k|            return ret;
  299|  1.17k|        }
  300|  19.2k|        else
  301|  19.2k|        {
  302|  19.2k|            ps_codec->i4_slice_error = 0;
  303|  19.2k|        }
  304|  20.4k|    }
  305|       |
  306|  31.5k|    if(first_slice_in_pic_flag)
  ------------------
  |  Branch (306:8): [True: 22.0k, False: 9.48k]
  ------------------
  307|  22.0k|    {
  308|  22.0k|        ps_codec->s_parse.i4_cur_slice_idx = 0;
  309|  22.0k|    }
  310|  9.48k|    else
  311|  9.48k|    {
  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|  9.48k|        if(0 == ps_codec->i4_pic_present)
  ------------------
  |  Branch (316:12): [True: 6.08k, False: 3.39k]
  ------------------
  317|  6.08k|            ps_codec->s_parse.i4_cur_slice_idx = 1;
  318|  9.48k|    }
  319|       |
  320|  31.5k|    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|  31.5k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  31.5k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  321|  31.5k|    memset(ps_slice_hdr, 0, sizeof(*ps_slice_hdr));
  322|       |
  323|  31.5k|    if((ps_pps->i1_dependent_slice_enabled_flag) &&
  ------------------
  |  Branch (323:8): [True: 22.1k, False: 9.32k]
  ------------------
  324|  31.5k|       (!first_slice_in_pic_flag))
  ------------------
  |  Branch (324:8): [True: 7.16k, False: 15.0k]
  ------------------
  325|  7.16k|    {
  326|  7.16k|        BITS_PARSE("dependent_slice_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  7.16k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  327|       |
  328|       |        /* First slice to be decoded in the current picture can't be dependent slice */
  329|  7.16k|        if (value && 0 == ps_codec->i4_pic_present)
  ------------------
  |  Branch (329:13): [True: 6.40k, False: 759]
  |  Branch (329:22): [True: 4.28k, False: 2.12k]
  ------------------
  330|  4.28k|        {
  331|  4.28k|             return IHEVCD_IGNORE_SLICE;
  332|  4.28k|        }
  333|       |
  334|       |        /* If dependendent slice, copy slice header from previous slice */
  335|  2.88k|        if(value && (ps_codec->s_parse.i4_cur_slice_idx > 0))
  ------------------
  |  Branch (335:12): [True: 2.12k, False: 759]
  |  Branch (335:21): [True: 2.12k, False: 0]
  ------------------
  336|  2.12k|        {
  337|  2.12k|            ihevcd_copy_slice_hdr(ps_codec,
  338|  2.12k|                                  (ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1)),
  ------------------
  |  |  153|  2.12k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  2.12k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  339|  2.12k|                                  ((ps_codec->s_parse.i4_cur_slice_idx - 1) & (MAX_SLICE_HDR_CNT - 1)));
  ------------------
  |  |  153|  2.12k|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  2.12k|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  340|  2.12k|        }
  341|  2.88k|        ps_slice_hdr->i1_dependent_slice_flag = value;
  342|  2.88k|    }
  343|  24.3k|    else
  344|  24.3k|    {
  345|  24.3k|        ps_slice_hdr->i1_dependent_slice_flag = 0;
  346|  24.3k|    }
  347|  27.2k|    ps_slice_hdr->i1_nal_unit_type = i1_nal_unit_type;
  348|  27.2k|    ps_slice_hdr->i1_pps_id = pps_id;
  349|  27.2k|    ps_slice_hdr->i1_first_slice_in_pic_flag = first_slice_in_pic_flag;
  350|       |
  351|  27.2k|    ps_slice_hdr->i1_no_output_of_prior_pics_flag = 1;
  352|  27.2k|    if((NAL_BLA_W_LP <= i1_nal_unit_type) &&
  ------------------
  |  Branch (352:8): [True: 13.7k, False: 13.5k]
  ------------------
  353|  27.2k|                    (NAL_RSV_RAP_VCL23          >= i1_nal_unit_type))
  ------------------
  |  Branch (353:21): [True: 13.7k, False: 0]
  ------------------
  354|  13.7k|    {
  355|  13.7k|        ps_slice_hdr->i1_no_output_of_prior_pics_flag = no_output_of_prior_pics_flag;
  356|  13.7k|    }
  357|  27.2k|    ps_slice_hdr->i1_pps_id = pps_id;
  358|       |
  359|  27.2k|    if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (359:8): [True: 5.19k, False: 22.0k]
  ------------------
  360|  5.19k|    {
  361|  5.19k|        WORD32 num_bits;
  362|       |
  363|       |        /* Use CLZ to compute Ceil( Log2( PicSizeInCtbsY ) ) */
  364|  5.19k|        num_bits = 32 - CLZ(ps_sps->i4_pic_size_in_ctb - 1);
  365|  5.19k|        BITS_PARSE("slice_address", value, ps_bitstrm, num_bits);
  ------------------
  |  |  148|  5.19k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  366|       |
  367|  5.19k|        slice_address = value;
  368|       |        /* If slice address is greater than the number of CTBs in a picture,
  369|       |         * ignore the slice */
  370|  5.19k|        if(value >= ps_sps->i4_pic_size_in_ctb || value == 0)
  ------------------
  |  Branch (370:12): [True: 50, False: 5.14k]
  |  Branch (370:51): [True: 242, False: 4.90k]
  ------------------
  371|    292|            return IHEVCD_IGNORE_SLICE;
  372|  5.19k|    }
  373|  22.0k|    else
  374|  22.0k|    {
  375|  22.0k|        slice_address = 0;
  376|  22.0k|    }
  377|       |
  378|  26.9k|    if(!ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (378:8): [True: 24.9k, False: 2.01k]
  ------------------
  379|  24.9k|    {
  380|  24.9k|        ps_slice_hdr->i1_pic_output_flag = 1;
  381|  24.9k|        ps_slice_hdr->i4_pic_order_cnt_lsb = 0;
  382|  24.9k|        ps_slice_hdr->i1_num_long_term_sps = 0;
  383|  24.9k|        ps_slice_hdr->i1_num_long_term_pics = 0;
  384|       |
  385|  83.9k|        for(i = 0; i < ps_pps->i1_num_extra_slice_header_bits; i++)
  ------------------
  |  Branch (385:20): [True: 59.0k, False: 24.9k]
  ------------------
  386|  59.0k|        {
  387|  59.0k|            BITS_PARSE("slice_reserved_undetermined_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  59.0k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  388|       |            //slice_reserved_undetermined_flag[ i ]
  389|  59.0k|        }
  390|  24.9k|        UEV_PARSE("slice_type", value, ps_bitstrm);
  ------------------
  |  |  155|  24.9k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  391|  24.9k|        if(value > 2)
  ------------------
  |  Branch (391:12): [True: 722, False: 24.1k]
  ------------------
  392|    722|        {
  393|    722|            return IHEVCD_INVALID_PARAMETER;
  394|    722|        }
  395|  24.1k|        ps_slice_hdr->i1_slice_type = value;
  396|       |
  397|       |        /* If the picture is IRAP, slice type must be equal to ISLICE */
  398|  24.1k|        if((ps_slice_hdr->i1_nal_unit_type >= NAL_BLA_W_LP) &&
  ------------------
  |  Branch (398:12): [True: 11.9k, False: 12.2k]
  ------------------
  399|  24.1k|                        (ps_slice_hdr->i1_nal_unit_type <= NAL_RSV_RAP_VCL23))
  ------------------
  |  Branch (399:25): [True: 11.9k, False: 0]
  ------------------
  400|  11.9k|            ps_slice_hdr->i1_slice_type = ISLICE;
  401|       |
  402|  24.1k|        if((ps_slice_hdr->i1_slice_type < 0) ||
  ------------------
  |  Branch (402:12): [True: 0, False: 24.1k]
  ------------------
  403|  24.1k|                        (ps_slice_hdr->i1_slice_type > 2))
  ------------------
  |  Branch (403:25): [True: 0, False: 24.1k]
  ------------------
  404|      0|            return IHEVCD_IGNORE_SLICE;
  405|       |
  406|  24.1k|        if(ps_pps->i1_output_flag_present_flag)
  ------------------
  |  Branch (406:12): [True: 7.98k, False: 16.2k]
  ------------------
  407|  7.98k|        {
  408|  7.98k|            BITS_PARSE("pic_output_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  7.98k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  409|  7.98k|            ps_slice_hdr->i1_pic_output_flag = value;
  410|  7.98k|        }
  411|  24.1k|        ps_slice_hdr->i1_colour_plane_id = 0;
  412|  24.1k|        if(1 == ps_sps->i1_separate_colour_plane_flag)
  ------------------
  |  Branch (412:12): [True: 0, False: 24.1k]
  ------------------
  413|      0|        {
  414|      0|            BITS_PARSE("colour_plane_id", value, ps_bitstrm, 2);
  ------------------
  |  |  148|      0|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  415|      0|            ps_slice_hdr->i1_colour_plane_id = value;
  416|      0|        }
  417|  24.1k|        ps_slice_hdr->i1_slice_temporal_mvp_enable_flag = 0;
  418|       |
  419|  24.1k|        if(!idr_pic_flag)
  ------------------
  |  Branch (419:12): [True: 13.8k, False: 10.3k]
  ------------------
  420|  13.8k|        {
  421|       |
  422|  13.8k|            WORD32 st_rps_idx;
  423|  13.8k|            WORD32 num_neg_pics;
  424|  13.8k|            WORD32 num_pos_pics;
  425|  13.8k|            WORD8 *pi1_used;
  426|       |
  427|  13.8k|            BITS_PARSE("pic_order_cnt_lsb", value, ps_bitstrm, ps_sps->i1_log2_max_pic_order_cnt_lsb);
  ------------------
  |  |  148|  13.8k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  428|       |            //value = ihevcd_extend_sign_bit(value, ps_sps->i1_log2_max_pic_order_cnt_lsb);
  429|  13.8k|            ps_slice_hdr->i4_pic_order_cnt_lsb = value;
  430|       |
  431|  13.8k|            BITS_PARSE("short_term_ref_pic_set_sps_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  13.8k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  432|  13.8k|            ps_slice_hdr->i1_short_term_ref_pic_set_sps_flag = value;
  433|       |
  434|  13.8k|            if(1 == ps_slice_hdr->i1_short_term_ref_pic_set_sps_flag)
  ------------------
  |  Branch (434:16): [True: 7.71k, False: 6.11k]
  ------------------
  435|  7.71k|            {
  436|  7.71k|                WORD32 numbits;
  437|       |
  438|  7.71k|                ps_slice_hdr->i1_short_term_ref_pic_set_idx = 0;
  439|  7.71k|                if(ps_sps->i1_num_short_term_ref_pic_sets > 1)
  ------------------
  |  Branch (439:20): [True: 2.85k, False: 4.85k]
  ------------------
  440|  2.85k|                {
  441|  2.85k|                    numbits = 32 - CLZ(ps_sps->i1_num_short_term_ref_pic_sets - 1);
  442|  2.85k|                    BITS_PARSE("short_term_ref_pic_set_idx", value, ps_bitstrm, numbits);
  ------------------
  |  |  148|  2.85k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  443|  2.85k|                    if (value >= ps_sps->i1_num_short_term_ref_pic_sets) {
  ------------------
  |  Branch (443:25): [True: 138, False: 2.71k]
  ------------------
  444|    138|                        return IHEVCD_INVALID_PARAMETER;
  445|    138|                    }
  446|  2.71k|                    ps_slice_hdr->i1_short_term_ref_pic_set_idx = value;
  447|  2.71k|                }
  448|       |
  449|  7.57k|                st_rps_idx = ps_slice_hdr->i1_short_term_ref_pic_set_idx;
  450|  7.57k|                num_neg_pics = ps_sps->as_stref_picset[st_rps_idx].i1_num_neg_pics;
  451|  7.57k|                num_pos_pics = ps_sps->as_stref_picset[st_rps_idx].i1_num_pos_pics;
  452|  7.57k|                pi1_used = ps_sps->as_stref_picset[st_rps_idx].ai1_used;
  453|  7.57k|            }
  454|  6.11k|            else
  455|  6.11k|            {
  456|  6.11k|                ret = ihevcd_short_term_ref_pic_set(ps_bitstrm,
  457|  6.11k|                                                    &ps_sps->as_stref_picset[0],
  458|  6.11k|                                                    ps_sps->i1_num_short_term_ref_pic_sets,
  459|  6.11k|                                                    ps_sps->i1_num_short_term_ref_pic_sets,
  460|  6.11k|                                                    &ps_slice_hdr->s_stref_picset);
  461|  6.11k|                if (ret != IHEVCD_SUCCESS)
  ------------------
  |  Branch (461:21): [True: 264, False: 5.84k]
  ------------------
  462|    264|                {
  463|    264|                    return ret;
  464|    264|                }
  465|  5.84k|                st_rps_idx = ps_sps->i1_num_short_term_ref_pic_sets;
  466|  5.84k|                num_neg_pics = ps_slice_hdr->s_stref_picset.i1_num_neg_pics;
  467|  5.84k|                num_pos_pics = ps_slice_hdr->s_stref_picset.i1_num_pos_pics;
  468|  5.84k|                pi1_used = ps_slice_hdr->s_stref_picset.ai1_used;
  469|  5.84k|            }
  470|       |
  471|  13.4k|            if(ps_sps->i1_long_term_ref_pics_present_flag)
  ------------------
  |  Branch (471:16): [True: 5.05k, False: 8.36k]
  ------------------
  472|  5.05k|            {
  473|  5.05k|                if(ps_sps->i1_num_long_term_ref_pics_sps > 0)
  ------------------
  |  Branch (473:20): [True: 183, False: 4.87k]
  ------------------
  474|    183|                {
  475|    183|                    UEV_PARSE("num_long_term_sps", value, ps_bitstrm);
  ------------------
  |  |  155|    183|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  476|    183|                    if(value > ps_sps->i1_num_long_term_ref_pics_sps)
  ------------------
  |  Branch (476:24): [True: 4, False: 179]
  ------------------
  477|      4|                    {
  478|      4|                        return IHEVCD_INVALID_PARAMETER;
  479|      4|                    }
  480|    179|                    ps_slice_hdr->i1_num_long_term_sps = value;
  481|    179|                }
  482|  5.05k|                UEV_PARSE("num_long_term_pics", value, ps_bitstrm);
  ------------------
  |  |  155|  5.05k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  483|  5.05k|                if(((ULWORD64)value + ps_slice_hdr->i1_num_long_term_sps + num_neg_pics +
  ------------------
  |  Branch (483:20): [True: 188, False: 4.86k]
  ------------------
  484|  5.05k|                    num_pos_pics) > (MAX_DPB_SIZE - 1))
  ------------------
  |  |  281|  5.05k|#define MAX_DPB_SIZE 16
  ------------------
  485|    188|                {
  486|    188|                    return IHEVCD_INVALID_PARAMETER;
  487|    188|                }
  488|  4.86k|                ps_slice_hdr->i1_num_long_term_pics = value;
  489|       |
  490|  23.7k|                for(i = 0; i < (ps_slice_hdr->i1_num_long_term_sps +
  ------------------
  |  Branch (490:28): [True: 18.8k, False: 4.86k]
  ------------------
  491|  23.7k|                                ps_slice_hdr->i1_num_long_term_pics); i++)
  492|  18.8k|                {
  493|  18.8k|                    if(i < ps_slice_hdr->i1_num_long_term_sps)
  ------------------
  |  Branch (493:24): [True: 135, False: 18.7k]
  ------------------
  494|    135|                    {
  495|       |                        /* Use CLZ to compute Ceil( Log2( num_long_term_ref_pics_sps ) ) */
  496|    135|                        if (ps_sps->i1_num_long_term_ref_pics_sps > 1)
  ------------------
  |  Branch (496:29): [True: 0, False: 135]
  ------------------
  497|      0|                        {
  498|      0|                            WORD32 num_bits = 32 - CLZ(ps_sps->i1_num_long_term_ref_pics_sps - 1);
  499|      0|                            BITS_PARSE("lt_idx_sps[ i ]", value, ps_bitstrm, num_bits);
  ------------------
  |  |  148|      0|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  500|      0|                            if(value >= ps_sps->i1_num_long_term_ref_pics_sps)
  ------------------
  |  Branch (500:32): [True: 0, False: 0]
  ------------------
  501|      0|                            {
  502|      0|                                return IHEVCD_INVALID_PARAMETER;
  503|      0|                            }
  504|      0|                        }
  505|    135|                        else
  506|    135|                        {
  507|    135|                            value = 0;
  508|    135|                        }
  509|    135|                        ps_slice_hdr->ai4_poc_lsb_lt[i] = ps_sps->au2_lt_ref_pic_poc_lsb_sps[value];
  510|    135|                        ps_slice_hdr->ai1_used_by_curr_pic_lt_flag[i] = ps_sps->ai1_used_by_curr_pic_lt_sps_flag[value];
  511|       |
  512|    135|                    }
  513|  18.7k|                    else
  514|  18.7k|                    {
  515|  18.7k|                        BITS_PARSE("poc_lsb_lt[ i ]", value, ps_bitstrm, ps_sps->i1_log2_max_pic_order_cnt_lsb);
  ------------------
  |  |  148|  18.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  516|  18.7k|                        ps_slice_hdr->ai4_poc_lsb_lt[i] = value;
  517|       |
  518|  18.7k|                        BITS_PARSE("used_by_curr_pic_lt_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  18.7k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  519|  18.7k|                        ps_slice_hdr->ai1_used_by_curr_pic_lt_flag[i] = value;
  520|       |
  521|  18.7k|                    }
  522|  18.8k|                    BITS_PARSE("delta_poc_msb_present_flag[ i ]", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  18.8k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  523|  18.8k|                    ps_slice_hdr->ai1_delta_poc_msb_present_flag[i] = value;
  524|       |
  525|       |
  526|  18.8k|                    ps_slice_hdr->ai1_delta_poc_msb_cycle_lt[i] = 0;
  527|  18.8k|                    if(ps_slice_hdr->ai1_delta_poc_msb_present_flag[i])
  ------------------
  |  Branch (527:24): [True: 3.89k, False: 14.9k]
  ------------------
  528|  3.89k|                    {
  529|       |
  530|  3.89k|                        UEV_PARSE("delata_poc_msb_cycle_lt[ i ]", value, ps_bitstrm);
  ------------------
  |  |  155|  3.89k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  531|  3.89k|                        ps_slice_hdr->ai1_delta_poc_msb_cycle_lt[i] = value;
  532|  3.89k|                    }
  533|       |
  534|  18.8k|                    if((i != 0) && (i != ps_slice_hdr->i1_num_long_term_sps))
  ------------------
  |  Branch (534:24): [True: 16.7k, False: 2.12k]
  |  Branch (534:36): [True: 16.7k, False: 1]
  ------------------
  535|  16.7k|                    {
  536|  16.7k|                        ps_slice_hdr->ai1_delta_poc_msb_cycle_lt[i] += ps_slice_hdr->ai1_delta_poc_msb_cycle_lt[i - 1];
  537|  16.7k|                    }
  538|       |
  539|  18.8k|                }
  540|  4.86k|            }
  541|       |
  542|  33.4k|            for(i = 0; i < num_neg_pics + num_pos_pics; i++)
  ------------------
  |  Branch (542:24): [True: 20.2k, False: 13.2k]
  ------------------
  543|  20.2k|            {
  544|  20.2k|                if(pi1_used[i])
  ------------------
  |  Branch (544:20): [True: 18.3k, False: 1.83k]
  ------------------
  545|  18.3k|                {
  546|  18.3k|                    num_poc_total_curr++;
  547|  18.3k|                }
  548|  20.2k|            }
  549|  32.1k|            for(i = 0; i < ps_slice_hdr->i1_num_long_term_sps + ps_slice_hdr->i1_num_long_term_pics; i++)
  ------------------
  |  Branch (549:24): [True: 18.8k, False: 13.2k]
  ------------------
  550|  18.8k|            {
  551|  18.8k|                if(ps_slice_hdr->ai1_used_by_curr_pic_lt_flag[i])
  ------------------
  |  Branch (551:20): [True: 4.98k, False: 13.8k]
  ------------------
  552|  4.98k|                {
  553|  4.98k|                    num_poc_total_curr++;
  554|  4.98k|                }
  555|  18.8k|            }
  556|       |
  557|       |
  558|  13.2k|            if(ps_sps->i1_sps_temporal_mvp_enable_flag)
  ------------------
  |  Branch (558:16): [True: 6.71k, False: 6.51k]
  ------------------
  559|  6.71k|            {
  560|  6.71k|                BITS_PARSE("enable_temporal_mvp_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  6.71k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  561|  6.71k|                ps_slice_hdr->i1_slice_temporal_mvp_enable_flag = value;
  562|  6.71k|            }
  563|       |
  564|  13.2k|        }
  565|  23.6k|        ps_slice_hdr->i1_slice_sao_luma_flag = 0;
  566|  23.6k|        ps_slice_hdr->i1_slice_sao_chroma_flag = 0;
  567|  23.6k|        if(ps_sps->i1_sample_adaptive_offset_enabled_flag)
  ------------------
  |  Branch (567:12): [True: 12.8k, False: 10.7k]
  ------------------
  568|  12.8k|        {
  569|  12.8k|            BITS_PARSE("slice_sao_luma_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  12.8k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  570|  12.8k|            ps_slice_hdr->i1_slice_sao_luma_flag = value;
  571|       |
  572|  12.8k|            BITS_PARSE("slice_sao_chroma_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  12.8k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  573|  12.8k|            ps_slice_hdr->i1_slice_sao_chroma_flag = value;
  574|       |
  575|  12.8k|        }
  576|       |
  577|  23.6k|        ps_slice_hdr->i1_max_num_merge_cand = 1;
  578|  23.6k|        ps_slice_hdr->i1_cabac_init_flag = 0;
  579|       |
  580|  23.6k|        ps_slice_hdr->i1_num_ref_idx_l0_active = 0;
  581|  23.6k|        ps_slice_hdr->i1_num_ref_idx_l1_active = 0;
  582|  23.6k|        ps_slice_hdr->i1_slice_cb_qp_offset = 0;
  583|  23.6k|        ps_slice_hdr->i1_slice_cr_qp_offset = 0;
  584|  23.6k|        if((PSLICE == ps_slice_hdr->i1_slice_type) ||
  ------------------
  |  Branch (584:12): [True: 520, False: 23.0k]
  ------------------
  585|  23.6k|           (BSLICE == ps_slice_hdr->i1_slice_type))
  ------------------
  |  Branch (585:12): [True: 10.9k, False: 12.0k]
  ------------------
  586|  11.5k|        {
  587|  11.5k|            BITS_PARSE("num_ref_idx_active_override_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  11.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  588|  11.5k|            ps_slice_hdr->i1_num_ref_idx_active_override_flag = value;
  589|       |
  590|  11.5k|            if(ps_slice_hdr->i1_num_ref_idx_active_override_flag)
  ------------------
  |  Branch (590:16): [True: 3.88k, False: 7.62k]
  ------------------
  591|  3.88k|            {
  592|  3.88k|                UEV_PARSE("num_ref_idx_l0_active_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  3.88k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  593|  3.88k|                if(value > MAX_DPB_SIZE - 2)
  ------------------
  |  |  281|  3.88k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (593:20): [True: 8, False: 3.87k]
  ------------------
  594|      8|                {
  595|      8|                    return IHEVCD_INVALID_PARAMETER;
  596|      8|                }
  597|  3.87k|                ps_slice_hdr->i1_num_ref_idx_l0_active = value + 1;
  598|       |
  599|  3.87k|                if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (599:20): [True: 3.61k, False: 261]
  ------------------
  600|  3.61k|                {
  601|  3.61k|                    UEV_PARSE("num_ref_idx_l1_active_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|  3.61k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  602|  3.61k|                    if(value > MAX_DPB_SIZE - 2)
  ------------------
  |  |  281|  3.61k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (602:24): [True: 24, False: 3.58k]
  ------------------
  603|     24|                    {
  604|     24|                        return IHEVCD_INVALID_PARAMETER;
  605|     24|                    }
  606|  3.58k|                    ps_slice_hdr->i1_num_ref_idx_l1_active = value + 1;
  607|  3.58k|                }
  608|       |
  609|  3.87k|            }
  610|  7.62k|            else
  611|  7.62k|            {
  612|  7.62k|                ps_slice_hdr->i1_num_ref_idx_l0_active = ps_pps->i1_num_ref_idx_l0_default_active;
  613|  7.62k|                if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (613:20): [True: 7.36k, False: 258]
  ------------------
  614|  7.36k|                {
  615|  7.36k|                    ps_slice_hdr->i1_num_ref_idx_l1_active = ps_pps->i1_num_ref_idx_l1_default_active;
  616|  7.36k|                }
  617|  7.62k|            }
  618|       |
  619|  11.4k|            if(0 == num_poc_total_curr)
  ------------------
  |  Branch (619:16): [True: 2.24k, False: 9.22k]
  ------------------
  620|  2.24k|                return IHEVCD_IGNORE_SLICE;
  621|  9.22k|            if((ps_pps->i1_lists_modification_present_flag) && (num_poc_total_curr > 1))
  ------------------
  |  Branch (621:16): [True: 6.06k, False: 3.15k]
  |  Branch (621:64): [True: 1.66k, False: 4.40k]
  ------------------
  622|  1.66k|            {
  623|  1.66k|                ihevcd_ref_pic_list_modification(ps_bitstrm,
  624|  1.66k|                                                 ps_slice_hdr, num_poc_total_curr);
  625|  1.66k|            }
  626|  7.56k|            else
  627|  7.56k|            {
  628|  7.56k|                ps_slice_hdr->s_rplm.i1_ref_pic_list_modification_flag_l0 = 0;
  629|  7.56k|                ps_slice_hdr->s_rplm.i1_ref_pic_list_modification_flag_l1 = 0;
  630|  7.56k|            }
  631|       |
  632|  9.22k|            if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (632:16): [True: 8.73k, False: 495]
  ------------------
  633|  8.73k|            {
  634|  8.73k|                BITS_PARSE("mvd_l1_zero_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  8.73k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  635|  8.73k|                ps_slice_hdr->i1_mvd_l1_zero_flag = value;
  636|  8.73k|            }
  637|       |
  638|  9.22k|            ps_slice_hdr->i1_cabac_init_flag = 0;
  639|  9.22k|            if(ps_pps->i1_cabac_init_present_flag)
  ------------------
  |  Branch (639:16): [True: 4.09k, False: 5.13k]
  ------------------
  640|  4.09k|            {
  641|  4.09k|                BITS_PARSE("cabac_init_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  4.09k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  642|  4.09k|                ps_slice_hdr->i1_cabac_init_flag = value;
  643|       |
  644|  4.09k|            }
  645|  9.22k|            ps_slice_hdr->i1_collocated_from_l0_flag = 1;
  646|  9.22k|            ps_slice_hdr->i1_collocated_ref_idx = 0;
  647|  9.22k|            if(ps_slice_hdr->i1_slice_temporal_mvp_enable_flag)
  ------------------
  |  Branch (647:16): [True: 2.81k, False: 6.41k]
  ------------------
  648|  2.81k|            {
  649|  2.81k|                if(BSLICE == ps_slice_hdr->i1_slice_type)
  ------------------
  |  Branch (649:20): [True: 2.62k, False: 188]
  ------------------
  650|  2.62k|                {
  651|  2.62k|                    BITS_PARSE("collocated_from_l0_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  2.62k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  652|  2.62k|                    ps_slice_hdr->i1_collocated_from_l0_flag = value;
  653|  2.62k|                }
  654|       |
  655|  2.81k|                if((ps_slice_hdr->i1_collocated_from_l0_flag  &&  (ps_slice_hdr->i1_num_ref_idx_l0_active > 1)) ||
  ------------------
  |  Branch (655:21): [True: 1.43k, False: 1.38k]
  |  Branch (655:67): [True: 358, False: 1.07k]
  ------------------
  656|  2.81k|                   (!ps_slice_hdr->i1_collocated_from_l0_flag  && (ps_slice_hdr->i1_num_ref_idx_l1_active > 1)))
  ------------------
  |  Branch (656:21): [True: 1.38k, False: 1.07k]
  |  Branch (656:67): [True: 1.05k, False: 329]
  ------------------
  657|  1.40k|                {
  658|  1.40k|                    UEV_PARSE("collocated_ref_idx", value, ps_bitstrm);
  ------------------
  |  |  155|  1.40k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  659|  1.40k|                    if((PSLICE == ps_slice_hdr->i1_slice_type || BSLICE == ps_slice_hdr->i1_slice_type) &&
  ------------------
  |  Branch (659:25): [True: 20, False: 1.38k]
  |  Branch (659:66): [True: 1.38k, False: 0]
  ------------------
  660|  1.40k|                                    ps_slice_hdr->i1_collocated_from_l0_flag)
  ------------------
  |  Branch (660:37): [True: 358, False: 1.05k]
  ------------------
  661|    358|                    {
  662|    358|                        if(value >= ps_slice_hdr->i1_num_ref_idx_l0_active)
  ------------------
  |  Branch (662:28): [True: 56, False: 302]
  ------------------
  663|     56|                        {
  664|     56|                            return IHEVCD_INVALID_PARAMETER;
  665|     56|                        }
  666|    358|                    }
  667|  1.35k|                    if(BSLICE == ps_slice_hdr->i1_slice_type && !ps_slice_hdr->i1_collocated_from_l0_flag)
  ------------------
  |  Branch (667:24): [True: 1.33k, False: 16]
  |  Branch (667:65): [True: 1.05k, False: 286]
  ------------------
  668|  1.05k|                    {
  669|  1.05k|                        if(value >= ps_slice_hdr->i1_num_ref_idx_l1_active)
  ------------------
  |  Branch (669:28): [True: 21, False: 1.03k]
  ------------------
  670|     21|                        {
  671|     21|                            return IHEVCD_INVALID_PARAMETER;
  672|     21|                        }
  673|  1.05k|                    }
  674|  1.33k|                    ps_slice_hdr->i1_collocated_ref_idx = value;
  675|  1.33k|                }
  676|       |
  677|  2.81k|            }
  678|       |
  679|  9.15k|            if((ps_pps->i1_weighted_pred_flag  &&   (PSLICE == ps_slice_hdr->i1_slice_type)) ||
  ------------------
  |  Branch (679:17): [True: 7.24k, False: 1.90k]
  |  Branch (679:53): [True: 406, False: 6.83k]
  ------------------
  680|  9.15k|               (ps_pps->i1_weighted_bipred_flag  &&  (BSLICE == ps_slice_hdr->i1_slice_type)))
  ------------------
  |  Branch (680:17): [True: 5.99k, False: 2.74k]
  |  Branch (680:54): [True: 5.98k, False: 15]
  ------------------
  681|  6.38k|            {
  682|  6.38k|                ihevcd_parse_pred_wt_ofst(ps_bitstrm, ps_sps, ps_pps, ps_slice_hdr);
  683|  6.38k|            }
  684|  9.15k|            UEV_PARSE("five_minus_max_num_merge_cand", value, ps_bitstrm);
  ------------------
  |  |  155|  9.15k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  685|  9.15k|            if(value > 4)
  ------------------
  |  Branch (685:16): [True: 290, False: 8.86k]
  ------------------
  686|    290|            {
  687|    290|                return IHEVCD_INVALID_PARAMETER;
  688|    290|            }
  689|  8.86k|            ps_slice_hdr->i1_max_num_merge_cand = 5 - value;
  690|       |
  691|  8.86k|        }
  692|  20.9k|        SEV_PARSE("slice_qp_delta", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  20.9k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  693|  20.9k|        if((i4_value < (MIN_HEVC_QP - ps_pps->i1_pic_init_qp)) ||
  ------------------
  |  |  461|  20.9k|#define MIN_HEVC_QP 0
  ------------------
  |  Branch (693:12): [True: 10, False: 20.9k]
  ------------------
  694|  20.9k|           (i4_value > (MAX_HEVC_QP - ps_pps->i1_pic_init_qp)))
  ------------------
  |  |  466|  20.9k|#define MAX_HEVC_QP 51  //FOR MAIN Branch Encoder
  ------------------
  |  Branch (694:12): [True: 591, False: 20.3k]
  ------------------
  695|    601|        {
  696|    601|            return IHEVCD_INVALID_PARAMETER;
  697|    601|        }
  698|  20.3k|        ps_slice_hdr->i1_slice_qp_delta = i4_value;
  699|       |
  700|  20.3k|        if(ps_pps->i1_pic_slice_level_chroma_qp_offsets_present_flag)
  ------------------
  |  Branch (700:12): [True: 11.9k, False: 8.37k]
  ------------------
  701|  11.9k|        {
  702|  11.9k|            SEV_PARSE("slice_cb_qp_offset", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  11.9k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  703|  11.9k|            if(i4_value < -12 || i4_value > 12)
  ------------------
  |  Branch (703:16): [True: 0, False: 11.9k]
  |  Branch (703:34): [True: 26, False: 11.9k]
  ------------------
  704|     26|            {
  705|     26|                return IHEVCD_INVALID_PARAMETER;
  706|     26|            }
  707|  11.9k|            ps_slice_hdr->i1_slice_cb_qp_offset = i4_value;
  708|       |
  709|  11.9k|            SEV_PARSE("slice_cr_qp_offset", i4_value, ps_bitstrm);
  ------------------
  |  |  162|  11.9k|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  710|  11.9k|            if(i4_value < -12 || i4_value > 12)
  ------------------
  |  Branch (710:16): [True: 0, False: 11.9k]
  |  Branch (710:34): [True: 8, False: 11.9k]
  ------------------
  711|      8|            {
  712|      8|                return IHEVCD_INVALID_PARAMETER;
  713|      8|            }
  714|  11.9k|            ps_slice_hdr->i1_slice_cr_qp_offset = i4_value;
  715|       |
  716|  11.9k|        }
  717|  20.3k|        ps_slice_hdr->i1_deblocking_filter_override_flag = 0;
  718|  20.3k|        ps_slice_hdr->i1_slice_disable_deblocking_filter_flag  = ps_pps->i1_pic_disable_deblocking_filter_flag;
  719|  20.3k|        ps_slice_hdr->i1_beta_offset_div2 = ps_pps->i1_beta_offset_div2;
  720|  20.3k|        ps_slice_hdr->i1_tc_offset_div2 = ps_pps->i1_tc_offset_div2;
  721|       |
  722|  20.3k|        disable_deblocking_filter_flag = ps_pps->i1_pic_disable_deblocking_filter_flag;
  723|       |
  724|  20.3k|        if(ps_pps->i1_deblocking_filter_control_present_flag)
  ------------------
  |  Branch (724:12): [True: 1.58k, False: 18.7k]
  ------------------
  725|  1.58k|        {
  726|       |
  727|  1.58k|            if(ps_pps->i1_deblocking_filter_override_enabled_flag)
  ------------------
  |  Branch (727:16): [True: 953, False: 635]
  ------------------
  728|    953|            {
  729|    953|                BITS_PARSE("deblocking_filter_override_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|    953|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  730|    953|                ps_slice_hdr->i1_deblocking_filter_override_flag = value;
  731|    953|            }
  732|       |
  733|  1.58k|            if(ps_slice_hdr->i1_deblocking_filter_override_flag)
  ------------------
  |  Branch (733:16): [True: 656, False: 932]
  ------------------
  734|    656|            {
  735|    656|                BITS_PARSE("slice_disable_deblocking_filter_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|    656|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  736|    656|                ps_slice_hdr->i1_slice_disable_deblocking_filter_flag = value;
  737|    656|                disable_deblocking_filter_flag = ps_slice_hdr->i1_slice_disable_deblocking_filter_flag;
  738|       |
  739|    656|                if(!ps_slice_hdr->i1_slice_disable_deblocking_filter_flag)
  ------------------
  |  Branch (739:20): [True: 356, False: 300]
  ------------------
  740|    356|                {
  741|    356|                    SEV_PARSE("beta_offset_div2", i4_value, ps_bitstrm);
  ------------------
  |  |  162|    356|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  742|    356|                    if(i4_value < -6 || i4_value > 6)
  ------------------
  |  Branch (742:24): [True: 0, False: 356]
  |  Branch (742:41): [True: 1, False: 355]
  ------------------
  743|      1|                    {
  744|      1|                        return IHEVCD_INVALID_PARAMETER;
  745|      1|                    }
  746|    355|                    ps_slice_hdr->i1_beta_offset_div2 = i4_value;
  747|       |
  748|    355|                    SEV_PARSE("tc_offset_div2", i4_value, ps_bitstrm);
  ------------------
  |  |  162|    355|    m_value = ihevcd_sev(m_ps_bitstrm);
  ------------------
  749|    355|                    if(i4_value < -6 || i4_value > 6)
  ------------------
  |  Branch (749:24): [True: 1, False: 354]
  |  Branch (749:41): [True: 9, False: 345]
  ------------------
  750|     10|                    {
  751|     10|                        return IHEVCD_INVALID_PARAMETER;
  752|     10|                    }
  753|    345|                    ps_slice_hdr->i1_tc_offset_div2 = i4_value;
  754|       |
  755|    345|                }
  756|    656|            }
  757|  1.58k|        }
  758|       |
  759|  20.3k|        ps_slice_hdr->i1_slice_loop_filter_across_slices_enabled_flag = ps_pps->i1_loop_filter_across_slices_enabled_flag;
  760|  20.3k|        if(ps_pps->i1_loop_filter_across_slices_enabled_flag  &&
  ------------------
  |  Branch (760:12): [True: 10.9k, False: 9.34k]
  ------------------
  761|  20.3k|                        (ps_slice_hdr->i1_slice_sao_luma_flag  ||  ps_slice_hdr->i1_slice_sao_chroma_flag  || !disable_deblocking_filter_flag))
  ------------------
  |  Branch (761:26): [True: 3.38k, False: 7.58k]
  |  Branch (761:68): [True: 467, False: 7.11k]
  |  Branch (761:111): [True: 6.74k, False: 364]
  ------------------
  762|  10.5k|        {
  763|  10.5k|            BITS_PARSE("slice_loop_filter_across_slices_enabled_flag", value, ps_bitstrm, 1);
  ------------------
  |  |  148|  10.5k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  764|  10.5k|            ps_slice_hdr->i1_slice_loop_filter_across_slices_enabled_flag = value;
  765|  10.5k|        }
  766|       |
  767|  20.3k|    }
  768|       |
  769|       |    /* Check sanity of slice */
  770|  22.3k|    if((!first_slice_in_pic_flag) &&
  ------------------
  |  Branch (770:8): [True: 4.08k, False: 18.2k]
  ------------------
  771|  22.3k|                    (ps_codec->i4_pic_present))
  ------------------
  |  Branch (771:21): [True: 3.08k, False: 1.00k]
  ------------------
  772|  3.08k|    {
  773|  3.08k|        slice_header_t *ps_slice_hdr_base = ps_codec->ps_slice_hdr_base;
  774|       |
  775|       |
  776|       |        /* According to the standard, the above conditions must be satisfied - But for error resilience,
  777|       |         * only the following conditions are checked */
  778|  3.08k|        if((ps_slice_hdr_base->i1_pps_id != ps_slice_hdr->i1_pps_id) ||
  ------------------
  |  Branch (778:12): [True: 87, False: 2.99k]
  ------------------
  779|  3.08k|                        (ps_slice_hdr_base->i4_pic_order_cnt_lsb != ps_slice_hdr->i4_pic_order_cnt_lsb))
  ------------------
  |  Branch (779:25): [True: 148, False: 2.84k]
  ------------------
  780|    235|        {
  781|    235|            return IHEVCD_IGNORE_SLICE;
  782|    235|        }
  783|       |
  784|  3.08k|    }
  785|       |
  786|       |
  787|  22.0k|    if(0 == ps_codec->i4_pic_present)
  ------------------
  |  Branch (787:8): [True: 19.2k, False: 2.84k]
  ------------------
  788|  19.2k|    {
  789|  19.2k|        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);
  790|  19.2k|    }
  791|  2.84k|    else
  792|  2.84k|    {
  793|  2.84k|        ps_slice_hdr->i4_abs_pic_order_cnt = ps_codec->s_parse.i4_abs_pic_order_cnt;
  794|  2.84k|    }
  795|       |
  796|       |
  797|  22.0k|    if(!first_slice_in_pic_flag)
  ------------------
  |  Branch (797:8): [True: 3.85k, False: 18.2k]
  ------------------
  798|  3.85k|    {
  799|       |        /* Check if the current slice belongs to the same pic (Pic being parsed) */
  800|  3.85k|        if(ps_codec->s_parse.i4_abs_pic_order_cnt == ps_slice_hdr->i4_abs_pic_order_cnt)
  ------------------
  |  Branch (800:12): [True: 3.24k, False: 607]
  ------------------
  801|  3.24k|        {
  802|       |
  803|       |            /* If the Next CTB's index is less than the slice address,
  804|       |             * the previous slice is incomplete.
  805|       |             * Indicate slice error, and treat the remaining CTBs as skip */
  806|  3.24k|            if(slice_address > ps_codec->s_parse.i4_next_ctb_indx)
  ------------------
  |  Branch (806:16): [True: 1.17k, False: 2.07k]
  ------------------
  807|  1.17k|            {
  808|  1.17k|                if(ps_codec->i4_pic_present)
  ------------------
  |  Branch (808:20): [True: 1.05k, False: 120]
  ------------------
  809|  1.05k|                {
  810|  1.05k|                    prev_slice_incomplete_flag = 1;
  811|  1.05k|                }
  812|    120|                else
  813|    120|                {
  814|    120|                    return IHEVCD_IGNORE_SLICE;
  815|    120|                }
  816|  1.17k|            }
  817|       |            /* If the slice address is less than the next CTB's index,
  818|       |             * extra CTBs have been decoded in the previous slice.
  819|       |             * Ignore the current slice. Treat it as incomplete */
  820|  2.07k|            else if(slice_address < ps_codec->s_parse.i4_next_ctb_indx)
  ------------------
  |  Branch (820:21): [True: 1.24k, False: 832]
  ------------------
  821|  1.24k|            {
  822|  1.24k|                return IHEVCD_IGNORE_SLICE;
  823|  1.24k|            }
  824|    832|            else
  825|    832|            {
  826|    832|                ps_codec->i4_slice_error = 0;
  827|    832|            }
  828|  3.24k|        }
  829|       |
  830|       |        /* The current slice does not belong to the pic that is being parsed */
  831|    607|        else
  832|    607|        {
  833|       |            /* The previous pic is incomplete.
  834|       |             * Treat the remaining CTBs as skip */
  835|    607|            if(ps_codec->i4_pic_present)
  ------------------
  |  Branch (835:16): [True: 0, False: 607]
  ------------------
  836|      0|            {
  837|      0|                slice_header_t *ps_slice_hdr_next;
  838|      0|                ps_codec->i4_slice_error = 1;
  839|      0|                ps_codec->s_parse.i4_cur_slice_idx--;
  840|      0|                if(ps_codec->s_parse.i4_cur_slice_idx < 0)
  ------------------
  |  Branch (840:20): [True: 0, False: 0]
  ------------------
  841|      0|                    ps_codec->s_parse.i4_cur_slice_idx = 0;
  842|       |
  843|      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
  |  |  ------------------
  ------------------
  844|      0|                ps_slice_hdr_next->i2_ctb_x = 0;
  845|      0|                ps_slice_hdr_next->i2_ctb_y = ps_codec->s_parse.ps_sps->i2_pic_ht_in_ctb;
  846|      0|                return ret;
  847|      0|            }
  848|       |
  849|       |            /* If the previous pic is complete,
  850|       |             * return if the current slice is dependant
  851|       |             * otherwise, update the parse context's POC */
  852|    607|            else
  853|    607|            {
  854|    607|                if(ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (854:20): [True: 0, False: 607]
  ------------------
  855|      0|                    return IHEVCD_IGNORE_SLICE;
  856|       |
  857|    607|                ps_codec->s_parse.i4_abs_pic_order_cnt = ps_slice_hdr->i4_abs_pic_order_cnt;
  858|    607|            }
  859|    607|        }
  860|  3.85k|    }
  861|       |
  862|       |    /* If the slice is the first slice in the pic, update the parse context's POC */
  863|  18.2k|    else
  864|  18.2k|    {
  865|       |        /* If the first slice is repeated, ignore the second occurrence
  866|       |         * If any other slice is repeated, the CTB addr will be greater than the slice addr,
  867|       |         * and hence the second occurrence is ignored */
  868|  18.2k|        if(ps_codec->s_parse.i4_abs_pic_order_cnt == ps_slice_hdr->i4_abs_pic_order_cnt)
  ------------------
  |  Branch (868:12): [True: 8.55k, False: 9.68k]
  ------------------
  869|  8.55k|            return IHEVCD_IGNORE_SLICE;
  870|       |
  871|  9.68k|        ps_codec->s_parse.i4_abs_pic_order_cnt = ps_slice_hdr->i4_abs_pic_order_cnt;
  872|  9.68k|    }
  873|       |
  874|       |    // printf("POC: %d\n", ps_slice_hdr->i4_abs_pic_order_cnt);
  875|       |    // AEV_TRACE("POC", ps_slice_hdr->i4_abs_pic_order_cnt, 0);
  876|  12.1k|    ps_slice_hdr->i4_num_entry_point_offsets = 0;
  877|  12.1k|    if((ps_pps->i1_tiles_enabled_flag) ||
  ------------------
  |  Branch (877:8): [True: 905, False: 11.2k]
  ------------------
  878|  12.1k|       (ps_pps->i1_entropy_coding_sync_enabled_flag))
  ------------------
  |  Branch (878:8): [True: 592, False: 10.6k]
  ------------------
  879|  1.49k|    {
  880|  1.49k|        UEV_PARSE("num_entry_point_offsets", value, ps_bitstrm);
  ------------------
  |  |  155|  1.49k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  881|  1.49k|        ps_slice_hdr->i4_num_entry_point_offsets = value;
  882|       |
  883|  1.49k|        {
  884|  1.49k|            WORD32 max_num_entry_point_offsets;
  885|  1.49k|            if((ps_pps->i1_tiles_enabled_flag) &&
  ------------------
  |  Branch (885:16): [True: 905, False: 592]
  ------------------
  886|  1.49k|                            (ps_pps->i1_entropy_coding_sync_enabled_flag))
  ------------------
  |  Branch (886:29): [True: 317, False: 588]
  ------------------
  887|    317|            {
  888|    317|                max_num_entry_point_offsets = ps_pps->i1_num_tile_columns * ps_sps->i2_pic_ht_in_ctb - 1;
  889|    317|            }
  890|  1.18k|            else if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (890:21): [True: 588, False: 592]
  ------------------
  891|    588|            {
  892|    588|                max_num_entry_point_offsets = ps_pps->i1_num_tile_columns * ps_pps->i1_num_tile_rows - 1 ;
  893|    588|            }
  894|    592|            else
  895|    592|            {
  896|    592|                max_num_entry_point_offsets = (ps_sps->i2_pic_ht_in_ctb - 1);
  897|    592|            }
  898|       |
  899|  1.49k|            if(ps_slice_hdr->i4_num_entry_point_offsets < 0 || ps_slice_hdr->i4_num_entry_point_offsets > max_num_entry_point_offsets)
  ------------------
  |  Branch (899:16): [True: 0, False: 1.49k]
  |  Branch (899:64): [True: 40, False: 1.45k]
  ------------------
  900|     40|            {
  901|     40|                return IHEVCD_INVALID_PARAMETER;
  902|     40|            }
  903|  1.49k|        }
  904|       |
  905|  1.45k|        if(ps_slice_hdr->i4_num_entry_point_offsets > 0)
  ------------------
  |  Branch (905:12): [True: 57, False: 1.40k]
  ------------------
  906|     57|        {
  907|     57|            UEV_PARSE("offset_len_minus1", value, ps_bitstrm);
  ------------------
  |  |  155|     57|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  908|     57|            if(value > 31)
  ------------------
  |  Branch (908:16): [True: 6, False: 51]
  ------------------
  909|      6|            {
  910|      6|                return IHEVCD_INVALID_PARAMETER;
  911|      6|            }
  912|     51|            ps_slice_hdr->i1_offset_len = value + 1;
  913|       |
  914|    143|            for(i = 0; i < ps_slice_hdr->i4_num_entry_point_offsets; i++)
  ------------------
  |  Branch (914:24): [True: 92, False: 51]
  ------------------
  915|     92|            {
  916|     92|                BITS_PARSE("entry_point_offset", value, ps_bitstrm, ps_slice_hdr->i1_offset_len);
  ------------------
  |  |  148|     92|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  917|       |
  918|       |                /* TODO: pu4_entry_point_offset needs to be initialized */
  919|       |                //ps_slice_hdr->pu4_entry_point_offset[i] = value;
  920|     92|            }
  921|       |
  922|     51|        }
  923|  1.45k|    }
  924|       |
  925|  12.1k|    if(ps_pps->i1_slice_header_extension_present_flag)
  ------------------
  |  Branch (925:8): [True: 4.39k, False: 7.73k]
  ------------------
  926|  4.39k|    {
  927|  4.39k|        UEV_PARSE("slice_header_extension_length", value, ps_bitstrm);
  ------------------
  |  |  155|  4.39k|    m_value = ihevcd_uev(m_ps_bitstrm);
  ------------------
  928|  4.39k|        if(value > 256)
  ------------------
  |  Branch (928:12): [True: 44, False: 4.35k]
  ------------------
  929|     44|        {
  930|     44|            return IHEVCD_INVALID_PARAMETER;
  931|     44|        }
  932|  4.35k|        ps_slice_hdr->i2_slice_header_extension_length = value;
  933|       |
  934|       |
  935|  6.97k|        for(i = 0; i < ps_slice_hdr->i2_slice_header_extension_length; i++)
  ------------------
  |  Branch (935:20): [True: 2.62k, False: 4.35k]
  ------------------
  936|  2.62k|        {
  937|  2.62k|            BITS_PARSE("slice_header_extension_data_byte", value, ps_bitstrm, 8);
  ------------------
  |  |  148|  2.62k|    m_value = ihevcd_bits_get(m_ps_bitstrm, m_numbits);
  ------------------
  938|  2.62k|        }
  939|       |
  940|  4.35k|    }
  941|       |
  942|  12.0k|    ihevcd_bits_flush_to_byte_boundary(ps_bitstrm);
  943|       |
  944|  12.0k|    if((UWORD8 *)ps_bitstrm->pu4_buf > ps_bitstrm->pu1_buf_max)
  ------------------
  |  Branch (944:8): [True: 71, False: 12.0k]
  ------------------
  945|     71|        return IHEVCD_INVALID_PARAMETER;
  946|       |
  947|  12.0k|    {
  948|  12.0k|        dpb_mgr_t *ps_dpb_mgr = (dpb_mgr_t *)ps_codec->pv_dpb_mgr;
  949|  12.0k|        WORD32 r_idx;
  950|       |
  951|  12.0k|        if((NAL_IDR_W_LP == ps_slice_hdr->i1_nal_unit_type) ||
  ------------------
  |  Branch (951:12): [True: 3.83k, False: 8.17k]
  ------------------
  952|  12.0k|                        (NAL_IDR_N_LP == ps_slice_hdr->i1_nal_unit_type)  ||
  ------------------
  |  Branch (952:25): [True: 3.20k, False: 4.97k]
  ------------------
  953|  12.0k|                        (NAL_BLA_N_LP == ps_slice_hdr->i1_nal_unit_type)  ||
  ------------------
  |  Branch (953:25): [True: 55, False: 4.91k]
  ------------------
  954|  12.0k|                        (NAL_BLA_W_DLP == ps_slice_hdr->i1_nal_unit_type) ||
  ------------------
  |  Branch (954:25): [True: 872, False: 4.04k]
  ------------------
  955|  12.0k|                        (NAL_BLA_W_LP == ps_slice_hdr->i1_nal_unit_type)  ||
  ------------------
  |  Branch (955:25): [True: 242, False: 3.80k]
  ------------------
  956|  12.0k|                        (0 == ps_codec->u4_pic_cnt))
  ------------------
  |  Branch (956:25): [True: 614, False: 3.18k]
  ------------------
  957|  8.82k|        {
  958|   573k|            for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|   573k|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  281|   573k|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (958:24): [True: 564k, False: 8.82k]
  ------------------
  959|   564k|            {
  960|   564k|                if(ps_dpb_mgr->as_dpb_info[i].ps_pic_buf)
  ------------------
  |  Branch (960:20): [True: 6.05k, False: 558k]
  ------------------
  961|  6.05k|                {
  962|  6.05k|                    pic_buf_t *ps_pic_buf = ps_dpb_mgr->as_dpb_info[i].ps_pic_buf;
  963|  6.05k|                    mv_buf_t *ps_mv_buf;
  964|       |
  965|       |                    /* Long term index is set to MAX_DPB_BUFS to ensure it is not added as LT */
  966|  6.05k|                    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);
  967|       |                    /* Find buffer id of the MV bank corresponding to the buffer being freed (Buffer with POC of u4_abs_poc) */
  968|  6.05k|                    ps_mv_buf = (mv_buf_t *)ps_codec->ps_mv_buf;
  969|  6.13k|                    for(j = 0; j < ps_codec->i4_max_dpb_size; j++)
  ------------------
  |  Branch (969:32): [True: 6.13k, False: 0]
  ------------------
  970|  6.13k|                    {
  971|  6.13k|                        if(ps_mv_buf && ps_mv_buf->i4_abs_poc == ps_pic_buf->i4_abs_poc)
  ------------------
  |  Branch (971:28): [True: 6.13k, False: 0]
  |  Branch (971:41): [True: 6.05k, False: 88]
  ------------------
  972|  6.05k|                        {
  973|  6.05k|                            ihevc_buf_mgr_release((buf_mgr_t *)ps_codec->pv_mv_buf_mgr, j, BUF_MGR_REF);
  ------------------
  |  |   40|  6.05k|#define BUF_MGR_REF         (1 << 1)
  ------------------
  974|  6.05k|                            break;
  975|  6.05k|                        }
  976|     88|                        ps_mv_buf++;
  977|     88|                    }
  978|       |
  979|  6.05k|                }
  980|       |
  981|   564k|            }
  982|       |
  983|       |            /* Initialize the reference lists to NULL
  984|       |             * This is done to take care of the cases where the first pic is not IDR
  985|       |             * but the reference list is not created for the first pic because
  986|       |             * pic count is zero leaving the reference list uninitialised  */
  987|   149k|            for(r_idx = 0; r_idx < MAX_DPB_SIZE; r_idx++)
  ------------------
  |  |  281|   149k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (987:28): [True: 141k, False: 8.82k]
  ------------------
  988|   141k|            {
  989|   141k|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf = NULL;
  990|   141k|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = NULL;
  991|       |
  992|   141k|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf = NULL;
  993|   141k|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = NULL;
  994|   141k|            }
  995|       |
  996|  8.82k|        }
  997|  3.18k|        else
  998|  3.18k|        {
  999|  3.18k|            ret = ihevcd_ref_list(ps_codec, ps_pps, ps_sps, ps_slice_hdr);
 1000|  3.18k|            if ((WORD32)IHEVCD_SUCCESS != ret)
  ------------------
  |  Branch (1000:17): [True: 656, False: 2.53k]
  ------------------
 1001|    656|            {
 1002|    656|                return ret;
 1003|    656|            }
 1004|       |
 1005|  3.18k|        }
 1006|       |
 1007|  12.0k|    }
 1008|       |
 1009|       |    /* Fill the remaining entries of the reference lists with the nearest POC
 1010|       |     * This is done to handle cases where there is a corruption in the reference index */
 1011|  11.3k|    if(ps_codec->i4_pic_present)
  ------------------
  |  Branch (1011:8): [True: 1.88k, False: 9.47k]
  ------------------
 1012|  1.88k|    {
 1013|  1.88k|        pic_buf_t *ps_pic_buf_ref;
 1014|  1.88k|        mv_buf_t *ps_mv_buf_ref;
 1015|  1.88k|        WORD32 r_idx;
 1016|  1.88k|        dpb_mgr_t *ps_dpb_mgr = (dpb_mgr_t *)ps_codec->pv_dpb_mgr;
 1017|  1.88k|        buf_mgr_t *ps_mv_buf_mgr = (buf_mgr_t *)ps_codec->pv_mv_buf_mgr;
 1018|       |
 1019|  1.88k|        ps_pic_buf_ref = ihevc_dpb_mgr_get_ref_by_nearest_poc(ps_dpb_mgr, ps_slice_hdr->i4_abs_pic_order_cnt);
 1020|  1.88k|        if(NULL == ps_pic_buf_ref)
  ------------------
  |  Branch (1020:12): [True: 1.52k, False: 364]
  ------------------
 1021|  1.52k|        {
 1022|  1.52k|            ps_pic_buf_ref = ps_codec->as_process[0].ps_cur_pic;
 1023|  1.52k|            ps_mv_buf_ref = ps_codec->s_parse.ps_cur_mv_buf;
 1024|  1.52k|        }
 1025|    364|        else
 1026|    364|        {
 1027|    364|            ps_mv_buf_ref = ihevcd_mv_mgr_get_poc(ps_mv_buf_mgr, ps_pic_buf_ref->i4_abs_poc);
 1028|    364|        }
 1029|       |
 1030|  2.39k|        for(r_idx = 0; r_idx < ps_slice_hdr->i1_num_ref_idx_l0_active; r_idx++)
  ------------------
  |  Branch (1030:24): [True: 505, False: 1.88k]
  ------------------
 1031|    505|        {
 1032|    505|            if(NULL == ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf)
  ------------------
  |  Branch (1032:16): [True: 90, False: 415]
  ------------------
 1033|     90|            {
 1034|     90|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1035|     90|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1036|     90|            }
 1037|    505|        }
 1038|       |
 1039|  31.5k|        for(r_idx = ps_slice_hdr->i1_num_ref_idx_l0_active; r_idx < MAX_DPB_SIZE; r_idx++)
  ------------------
  |  |  281|  31.5k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (1039:61): [True: 29.6k, False: 1.88k]
  ------------------
 1040|  29.6k|        {
 1041|  29.6k|            ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1042|  29.6k|            ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1043|  29.6k|        }
 1044|       |
 1045|  2.63k|        for(r_idx = 0; r_idx < ps_slice_hdr->i1_num_ref_idx_l1_active; r_idx++)
  ------------------
  |  Branch (1045:24): [True: 753, False: 1.88k]
  ------------------
 1046|    753|        {
 1047|    753|            if(NULL == ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf)
  ------------------
  |  Branch (1047:16): [True: 422, False: 331]
  ------------------
 1048|    422|            {
 1049|    422|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1050|    422|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1051|    422|            }
 1052|    753|        }
 1053|       |
 1054|  31.2k|        for(r_idx = ps_slice_hdr->i1_num_ref_idx_l1_active; r_idx < MAX_DPB_SIZE; r_idx++)
  ------------------
  |  |  281|  31.2k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (1054:61): [True: 29.4k, False: 1.88k]
  ------------------
 1055|  29.4k|        {
 1056|  29.4k|            ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1057|  29.4k|            ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1058|  29.4k|        }
 1059|  1.88k|    }
 1060|       |
 1061|       |    /* Update slice address in the header */
 1062|  11.3k|    if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (1062:8): [True: 2.44k, False: 8.90k]
  ------------------
 1063|  2.44k|    {
 1064|  2.44k|        ps_slice_hdr->i2_ctb_x = slice_address % ps_sps->i2_pic_wd_in_ctb;
 1065|  2.44k|        ps_slice_hdr->i2_ctb_y = slice_address / ps_sps->i2_pic_wd_in_ctb;
 1066|       |
 1067|  2.44k|        if(!ps_slice_hdr->i1_dependent_slice_flag)
  ------------------
  |  Branch (1067:12): [True: 1.10k, False: 1.34k]
  ------------------
 1068|  1.10k|        {
 1069|  1.10k|            ps_slice_hdr->i2_independent_ctb_x = ps_slice_hdr->i2_ctb_x;
 1070|  1.10k|            ps_slice_hdr->i2_independent_ctb_y = ps_slice_hdr->i2_ctb_y;
 1071|  1.10k|        }
 1072|  2.44k|    }
 1073|  8.90k|    else
 1074|  8.90k|    {
 1075|  8.90k|        ps_slice_hdr->i2_ctb_x = 0;
 1076|  8.90k|        ps_slice_hdr->i2_ctb_y = 0;
 1077|       |
 1078|  8.90k|        ps_slice_hdr->i2_independent_ctb_x = 0;
 1079|  8.90k|        ps_slice_hdr->i2_independent_ctb_y = 0;
 1080|  8.90k|    }
 1081|       |
 1082|       |    /* If the first slice in the pic is missing, copy the current slice header to
 1083|       |     * the first slice's header */
 1084|  11.3k|    if((!first_slice_in_pic_flag) &&
  ------------------
  |  Branch (1084:8): [True: 2.44k, False: 8.90k]
  ------------------
 1085|  11.3k|                    (0 == ps_codec->i4_pic_present))
  ------------------
  |  Branch (1085:21): [True: 561, False: 1.88k]
  ------------------
 1086|    561|    {
 1087|    561|        slice_header_t *ps_slice_hdr_prev = ps_codec->s_parse.ps_slice_hdr_base;
 1088|    561|        ihevcd_copy_slice_hdr(ps_codec, 0, (ps_codec->s_parse.i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1)));
  ------------------
  |  |  153|    561|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|    561|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
 1089|       |
 1090|    561|        prev_slice_incomplete_flag = 1;
 1091|    561|        ASSERT(ps_codec->s_parse.i4_cur_slice_idx == 1);
  ------------------
  |  |   55|    561|#define ASSERT(x) assert((x))
  ------------------
 1092|       |
 1093|    561|        ps_slice_hdr_prev->i2_ctb_x = 0;
 1094|    561|        ps_slice_hdr_prev->i2_ctb_y = 0;
 1095|       |
 1096|    561|        ps_codec->s_parse.i4_ctb_x = 0;
 1097|    561|        ps_codec->s_parse.i4_ctb_y = 0;
 1098|       |
 1099|    561|        ps_codec->s_parse.i4_cur_slice_idx = 0;
 1100|       |
 1101|    561|        if((ps_slice_hdr->i2_ctb_x == 0) &&
  ------------------
  |  Branch (1101:12): [True: 15, False: 546]
  ------------------
 1102|    561|                        (ps_slice_hdr->i2_ctb_y == 0))
  ------------------
  |  Branch (1102:25): [True: 0, False: 15]
  ------------------
 1103|      0|        {
 1104|      0|            ps_slice_hdr->i2_ctb_x++;
 1105|      0|        }
 1106|    561|    }
 1107|       |
 1108|  11.3k|    {
 1109|       |        /* If skip B is enabled,
 1110|       |         * ignore pictures that are non-reference
 1111|       |         * TODO: (i1_nal_unit_type < NAL_BLA_W_LP) && (i1_nal_unit_type % 2 == 0) only says it is
 1112|       |         * sub-layer non-reference slice. May need to find a way to detect actual non-reference pictures*/
 1113|       |
 1114|  11.3k|        if((i1_nal_unit_type < NAL_BLA_W_LP) &&
  ------------------
  |  Branch (1114:12): [True: 2.72k, False: 8.63k]
  ------------------
 1115|  11.3k|                        (i1_nal_unit_type % 2 == 0))
  ------------------
  |  Branch (1115:25): [True: 2.13k, False: 585]
  ------------------
 1116|  2.13k|        {
 1117|  2.13k|            if(IVD_SKIP_B == ps_codec->e_pic_skip_mode)
  ------------------
  |  Branch (1117:16): [True: 0, False: 2.13k]
  ------------------
 1118|      0|                return IHEVCD_IGNORE_SLICE;
 1119|  2.13k|        }
 1120|       |
 1121|       |        /* If skip PB is enabled,
 1122|       |         * decode only I slices */
 1123|  11.3k|        if((IVD_SKIP_PB == ps_codec->e_pic_skip_mode) &&
  ------------------
  |  Branch (1123:12): [True: 0, False: 11.3k]
  ------------------
 1124|  11.3k|                        (ISLICE != ps_slice_hdr->i1_slice_type))
  ------------------
  |  Branch (1124:25): [True: 0, False: 0]
  ------------------
 1125|      0|        {
 1126|      0|            return IHEVCD_IGNORE_SLICE;
 1127|      0|        }
 1128|  11.3k|    }
 1129|       |
 1130|  11.3k|    if(prev_slice_incomplete_flag)
  ------------------
  |  Branch (1130:8): [True: 1.61k, False: 9.74k]
  ------------------
 1131|  1.61k|    {
 1132|  1.61k|        ps_codec->i4_slice_error = 1;
 1133|  1.61k|        ps_codec->s_parse.i4_cur_slice_idx--;
 1134|  1.61k|        if(ps_codec->s_parse.i4_cur_slice_idx < 0)
  ------------------
  |  Branch (1134:12): [True: 561, False: 1.05k]
  ------------------
 1135|    561|            ps_codec->s_parse.i4_cur_slice_idx = 0;
 1136|  1.61k|    }
 1137|       |
 1138|  11.3k|    return ret;
 1139|  11.3k|}

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

ihevcd_mv_mgr_get_poc:
   74|  9.38k|{
   75|  9.38k|    UWORD32 i;
   76|  9.38k|    mv_buf_t *ps_mv_buf = NULL;
   77|       |
   78|       |
   79|       |
   80|  12.8k|    for(i = 0; i < ps_mv_buf_mgr->u4_max_buf_cnt; i++)
  ------------------
  |  Branch (80:16): [True: 12.8k, False: 0]
  ------------------
   81|  12.8k|    {
   82|  12.8k|        ps_mv_buf = (mv_buf_t *)ps_mv_buf_mgr->apv_ptr[i];
   83|  12.8k|        if(ps_mv_buf && (ps_mv_buf->i4_abs_poc == (WORD32)abs_poc))
  ------------------
  |  Branch (83:12): [True: 12.8k, False: 0]
  |  Branch (83:25): [True: 9.38k, False: 3.44k]
  ------------------
   84|  9.38k|        {
   85|  9.38k|            break;
   86|  9.38k|        }
   87|  12.8k|    }
   88|       |
   89|  9.38k|    return ps_mv_buf;
   90|  9.38k|}
ihevcd_ref_list:
   94|  3.18k|{
   95|  3.18k|    WORD32 i, j;
   96|  3.18k|    WORD32 st_rps_idx;
   97|  3.18k|    WORD32 num_neg_pics, num_pos_pics;
   98|  3.18k|    WORD8 *pi1_used;
   99|  3.18k|    WORD16 *pi2_delta_poc;
  100|  3.18k|    UWORD32 u4_max_poc_lsb;
  101|  3.18k|    pic_buf_t *ps_pic_buf;
  102|  3.18k|    mv_buf_t *ps_mv_buf;
  103|  3.18k|    UWORD32 r_idx;
  104|       |
  105|  3.18k|    dpb_mgr_t *ps_dpb_mgr = (dpb_mgr_t *)ps_codec->pv_dpb_mgr;
  106|  3.18k|    buf_mgr_t *ps_mv_buf_mgr = (buf_mgr_t *)ps_codec->pv_mv_buf_mgr;
  107|       |
  108|  3.18k|    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|  3.18k|    WORD32 ai4_poc_lt_curr[MAX_DPB_SIZE], ai4_poc_lt_foll[MAX_DPB_SIZE];
  110|  3.18k|    UWORD32 u4_num_st_curr_before, u4_num_st_foll, u4_num_st_curr_after, u4_num_lt_curr, u4_num_lt_foll;
  111|  3.18k|    UWORD32 u4_num_total_curr;
  112|       |
  113|  3.18k|    WORD8 ai1_curr_delta_poc_msb_present_flag[MAX_DPB_SIZE], ai1_foll_delta_poc_msb_present_flag[MAX_DPB_SIZE];
  114|       |
  115|  3.18k|    pic_buf_t *as_ref_pic_lt_curr[MAX_DPB_SIZE];
  116|  3.18k|    pic_buf_t *as_ref_pic_lt_foll[MAX_DPB_SIZE];
  117|  3.18k|    pic_buf_t *as_ref_pic_st_curr_after[MAX_DPB_SIZE];
  118|  3.18k|    pic_buf_t *as_ref_pic_st_curr_before[MAX_DPB_SIZE];
  119|  3.18k|    pic_buf_t *as_ref_pic_st_foll[MAX_DPB_SIZE];
  120|       |
  121|  3.18k|    pic_buf_t *as_ref_pic_list_temp0[MAX_DPB_SIZE], *as_ref_pic_list_temp1[MAX_DPB_SIZE];
  122|       |
  123|  3.18k|    UWORD32 u4_num_rps_curr_temp_list0, u4_num_rps_curr_temp_list1;
  124|       |
  125|  3.18k|    WORD32 i4_pic_order_cnt_val;
  126|  3.18k|    WORD32 i4_poc_lt;
  127|  3.18k|    UNUSED(as_ref_pic_lt_foll);
  ------------------
  |  |   38|  3.18k|#define UNUSED(x) ((void)(x))
  ------------------
  128|  3.18k|    UNUSED(as_ref_pic_st_foll);
  ------------------
  |  |   38|  3.18k|#define UNUSED(x) ((void)(x))
  ------------------
  129|  3.18k|    UNUSED(ps_pps);
  ------------------
  |  |   38|  3.18k|#define UNUSED(x) ((void)(x))
  ------------------
  130|       |
  131|  3.18k|    RETURN_IF_NAL_INFO;
  132|       |
  133|  3.18k|    u4_max_poc_lsb = (1 << ps_sps->i1_log2_max_pic_order_cnt_lsb);
  134|       |
  135|  3.18k|    i4_pic_order_cnt_val = ps_slice_hdr->i4_abs_pic_order_cnt;
  136|       |
  137|  3.18k|    if(1 == ps_slice_hdr->i1_short_term_ref_pic_set_sps_flag)
  ------------------
  |  Branch (137:8): [True: 2.06k, False: 1.12k]
  ------------------
  138|  2.06k|    {
  139|  2.06k|        st_rps_idx = ps_slice_hdr->i1_short_term_ref_pic_set_idx;
  140|  2.06k|        num_neg_pics = ps_sps->as_stref_picset[st_rps_idx].i1_num_neg_pics;
  141|  2.06k|        num_pos_pics = ps_sps->as_stref_picset[st_rps_idx].i1_num_pos_pics;
  142|  2.06k|        pi1_used = ps_sps->as_stref_picset[st_rps_idx].ai1_used;
  143|  2.06k|        pi2_delta_poc = ps_sps->as_stref_picset[st_rps_idx].ai2_delta_poc;
  144|  2.06k|    }
  145|  1.12k|    else
  146|  1.12k|    {
  147|  1.12k|        st_rps_idx = ps_sps->i1_num_short_term_ref_pic_sets;
  148|  1.12k|        num_neg_pics = ps_slice_hdr->s_stref_picset.i1_num_neg_pics;
  149|  1.12k|        num_pos_pics = ps_slice_hdr->s_stref_picset.i1_num_pos_pics;
  150|  1.12k|        pi1_used = ps_slice_hdr->s_stref_picset.ai1_used;
  151|  1.12k|        pi2_delta_poc = ps_slice_hdr->s_stref_picset.ai2_delta_poc;
  152|  1.12k|    }
  153|       |
  154|  3.18k|    u4_num_st_curr_before = 0;
  155|  3.18k|    u4_num_st_foll = 0;
  156|  9.62k|    for(i = 0; i < num_neg_pics; i++)
  ------------------
  |  Branch (156:16): [True: 6.43k, False: 3.18k]
  ------------------
  157|  6.43k|    {
  158|  6.43k|        if(pi1_used[i])
  ------------------
  |  Branch (158:12): [True: 5.41k, False: 1.02k]
  ------------------
  159|  5.41k|        {
  160|  5.41k|            ai4_poc_st_curr_before[u4_num_st_curr_before] = i4_pic_order_cnt_val + pi2_delta_poc[i];
  161|  5.41k|            u4_num_st_curr_before++;
  162|  5.41k|        }
  163|  1.02k|        else
  164|  1.02k|        {
  165|  1.02k|            ai4_poc_st_foll[u4_num_st_foll] = i4_pic_order_cnt_val + pi2_delta_poc[i];
  166|  1.02k|            u4_num_st_foll++;
  167|  1.02k|        }
  168|  6.43k|    }
  169|  3.18k|    u4_num_st_curr_after = 0;
  170|  6.94k|    for(i = num_neg_pics; i < num_neg_pics + num_pos_pics; i++)
  ------------------
  |  Branch (170:27): [True: 3.75k, False: 3.18k]
  ------------------
  171|  3.75k|    {
  172|  3.75k|        if(pi1_used[i])
  ------------------
  |  Branch (172:12): [True: 3.62k, False: 133]
  ------------------
  173|  3.62k|        {
  174|  3.62k|            ai4_poc_st_curr_after[u4_num_st_curr_after] = i4_pic_order_cnt_val + pi2_delta_poc[i];
  175|  3.62k|            u4_num_st_curr_after++;
  176|  3.62k|        }
  177|    133|        else
  178|    133|        {
  179|    133|            ai4_poc_st_foll[u4_num_st_foll] = i4_pic_order_cnt_val + pi2_delta_poc[i];
  180|    133|            u4_num_st_foll++;
  181|    133|        }
  182|  3.75k|    }
  183|       |
  184|  3.18k|    u4_num_lt_curr = 0;
  185|  3.18k|    u4_num_lt_foll = 0;
  186|  10.1k|    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: 6.92k, False: 3.18k]
  ------------------
  187|  6.92k|    {
  188|  6.92k|        i4_poc_lt = ps_slice_hdr->ai4_poc_lsb_lt[i];
  189|  6.92k|        if(ps_slice_hdr->ai1_delta_poc_msb_present_flag[i])
  ------------------
  |  Branch (189:12): [True: 2.95k, False: 3.97k]
  ------------------
  190|  2.95k|        {
  191|  2.95k|            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|  2.95k|        }
  193|       |
  194|  6.92k|        if(ps_slice_hdr->ai1_used_by_curr_pic_lt_flag[i])
  ------------------
  |  Branch (194:12): [True: 4.14k, False: 2.78k]
  ------------------
  195|  4.14k|        {
  196|  4.14k|            ai4_poc_lt_curr[u4_num_lt_curr] = i4_poc_lt;
  197|  4.14k|            ai1_curr_delta_poc_msb_present_flag[u4_num_lt_curr] = ps_slice_hdr->ai1_delta_poc_msb_present_flag[i];
  198|  4.14k|            u4_num_lt_curr++;
  199|  4.14k|        }
  200|  2.78k|        else
  201|  2.78k|        {
  202|  2.78k|            ai4_poc_lt_foll[u4_num_lt_foll] = i4_poc_lt;
  203|  2.78k|            ai1_foll_delta_poc_msb_present_flag[u4_num_lt_foll] = ps_slice_hdr->ai1_delta_poc_msb_present_flag[i];
  204|  2.78k|            u4_num_lt_foll++;
  205|  2.78k|        }
  206|  6.92k|    }
  207|       |
  208|  3.18k|    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|  3.18k|    if(0 == ps_codec->i4_pic_present)
  ------------------
  |  Branch (311:8): [True: 2.43k, False: 758]
  ------------------
  312|  2.43k|    {
  313|   157k|        for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|   157k|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  281|   157k|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (313:20): [True: 155k, False: 2.43k]
  ------------------
  314|   155k|        {
  315|   155k|            if(ps_dpb_mgr->as_dpb_info[i].ps_pic_buf)
  ------------------
  |  Branch (315:16): [True: 4.67k, False: 150k]
  ------------------
  316|  4.67k|                ps_dpb_mgr->as_dpb_info[i].ps_pic_buf->u1_used_as_ref = UNUSED_FOR_REF;
  317|   155k|        }
  318|  2.43k|    }
  319|       |
  320|  7.33k|    for(i = 0; i < (WORD32)u4_num_lt_curr; i++)
  ------------------
  |  Branch (320:16): [True: 4.14k, False: 3.18k]
  ------------------
  321|  4.14k|    {
  322|  4.14k|        if(0 == ai1_curr_delta_poc_msb_present_flag[i])
  ------------------
  |  Branch (322:12): [True: 2.36k, False: 1.78k]
  ------------------
  323|  2.36k|        {
  324|  2.36k|            ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc_lsb(ps_dpb_mgr, ai4_poc_lt_curr[i]);
  325|  2.36k|            if(NULL != ps_pic_buf)
  ------------------
  |  Branch (325:16): [True: 990, False: 1.37k]
  ------------------
  326|    990|                ps_pic_buf->u1_used_as_ref = LONG_TERM_REF;
  327|       |
  328|  2.36k|            as_ref_pic_lt_curr[i] = ps_pic_buf;
  329|  2.36k|        }
  330|  1.78k|        else
  331|  1.78k|        {
  332|  1.78k|            ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc(ps_dpb_mgr, ai4_poc_lt_curr[i]);
  333|  1.78k|            if(NULL != ps_pic_buf)
  ------------------
  |  Branch (333:16): [True: 188, False: 1.59k]
  ------------------
  334|    188|                ps_pic_buf->u1_used_as_ref = LONG_TERM_REF;
  335|       |
  336|  1.78k|            as_ref_pic_lt_curr[i] = ps_pic_buf;
  337|  1.78k|        }
  338|  4.14k|    }
  339|       |
  340|  5.96k|    for(i = 0; i < (WORD32)u4_num_lt_foll; i++)
  ------------------
  |  Branch (340:16): [True: 2.78k, False: 3.18k]
  ------------------
  341|  2.78k|    {
  342|  2.78k|        if(0 == ai1_foll_delta_poc_msb_present_flag[i])
  ------------------
  |  Branch (342:12): [True: 1.61k, False: 1.16k]
  ------------------
  343|  1.61k|        {
  344|  1.61k|            ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc_lsb(ps_dpb_mgr, ai4_poc_lt_foll[i]);
  345|  1.61k|            if(NULL != ps_pic_buf)
  ------------------
  |  Branch (345:16): [True: 551, False: 1.06k]
  ------------------
  346|    551|                ps_pic_buf->u1_used_as_ref = LONG_TERM_REF;
  347|       |
  348|  1.61k|            as_ref_pic_lt_foll[i] = ps_pic_buf;
  349|  1.61k|        }
  350|  1.16k|        else
  351|  1.16k|        {
  352|  1.16k|            ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc(ps_dpb_mgr, ai4_poc_lt_foll[i]);
  353|  1.16k|            if(NULL != ps_pic_buf)
  ------------------
  |  Branch (353:16): [True: 0, False: 1.16k]
  ------------------
  354|      0|                ps_pic_buf->u1_used_as_ref = LONG_TERM_REF;
  355|       |
  356|  1.16k|            as_ref_pic_lt_foll[i] = ps_pic_buf;
  357|  1.16k|        }
  358|  2.78k|    }
  359|       |
  360|       |
  361|  8.59k|    for(i = 0; i < (WORD32)u4_num_st_curr_before; i++)
  ------------------
  |  Branch (361:16): [True: 5.41k, False: 3.18k]
  ------------------
  362|  5.41k|    {
  363|       |
  364|  5.41k|        ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc(ps_dpb_mgr, ai4_poc_st_curr_before[i]);
  365|  5.41k|        if(NULL != ps_pic_buf)
  ------------------
  |  Branch (365:12): [True: 1.34k, False: 4.07k]
  ------------------
  366|  1.34k|            ps_pic_buf->u1_used_as_ref = SHORT_TERM_REF;
  367|       |
  368|  5.41k|        as_ref_pic_st_curr_before[i] = ps_pic_buf;
  369|  5.41k|    }
  370|       |
  371|  6.81k|    for(i = 0; i < (WORD32)u4_num_st_curr_after; i++)
  ------------------
  |  Branch (371:16): [True: 3.62k, False: 3.18k]
  ------------------
  372|  3.62k|    {
  373|  3.62k|        ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc(ps_dpb_mgr, ai4_poc_st_curr_after[i]);
  374|  3.62k|        if(NULL != ps_pic_buf)
  ------------------
  |  Branch (374:12): [True: 807, False: 2.81k]
  ------------------
  375|    807|            ps_pic_buf->u1_used_as_ref = SHORT_TERM_REF;
  376|       |
  377|  3.62k|        as_ref_pic_st_curr_after[i] = ps_pic_buf;
  378|  3.62k|    }
  379|       |
  380|  4.34k|    for(i = 0; i < (WORD32)u4_num_st_foll; i++)
  ------------------
  |  Branch (380:16): [True: 1.15k, False: 3.18k]
  ------------------
  381|  1.15k|    {
  382|  1.15k|        ps_pic_buf = ihevc_dpb_mgr_get_ref_by_poc(ps_dpb_mgr, ai4_poc_st_foll[i]);
  383|  1.15k|        if(NULL != ps_pic_buf)
  ------------------
  |  Branch (383:12): [True: 139, False: 1.01k]
  ------------------
  384|    139|            ps_pic_buf->u1_used_as_ref = SHORT_TERM_REF;
  385|       |
  386|  1.15k|        as_ref_pic_st_foll[i] = ps_pic_buf;
  387|  1.15k|    }
  388|       |
  389|       |    //TODO: Bit stream conformance tests to be included
  390|       |
  391|  3.18k|    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: 2.05k, False: 1.13k]
  ------------------
  392|       |
  393|  3.18k|    r_idx = 0;
  394|  3.18k|    if((PSLICE == ps_slice_hdr->i1_slice_type) ||
  ------------------
  |  Branch (394:8): [True: 256, False: 2.93k]
  ------------------
  395|  3.18k|       (BSLICE == ps_slice_hdr->i1_slice_type))
  ------------------
  |  Branch (395:8): [True: 2.22k, False: 705]
  ------------------
  396|  2.48k|    {
  397|  5.39k|        while(r_idx < u4_num_rps_curr_temp_list0)
  ------------------
  |  Branch (397:15): [True: 2.91k, False: 2.48k]
  ------------------
  398|  2.91k|        {
  399|  8.78k|            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: 5.98k, False: 2.79k]
  |  Branch (399:63): [True: 5.87k, False: 113]
  ------------------
  400|  5.87k|            {
  401|  5.87k|                if(NULL == as_ref_pic_st_curr_before[i])
  ------------------
  |  Branch (401:20): [True: 4.14k, False: 1.72k]
  ------------------
  402|  4.14k|                {
  403|  4.14k|                    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|  4.14k|                }
  405|  5.87k|                as_ref_pic_list_temp0[r_idx] = as_ref_pic_st_curr_before[i];
  406|  5.87k|            }
  407|       |
  408|  6.66k|            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: 3.80k, False: 2.86k]
  |  Branch (408:62): [True: 3.75k, False: 47]
  ------------------
  409|  3.75k|            {
  410|  3.75k|                if(NULL == as_ref_pic_st_curr_after[i])
  ------------------
  |  Branch (410:20): [True: 2.81k, False: 936]
  ------------------
  411|  2.81k|                {
  412|  2.81k|                    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|  2.81k|                }
  414|  3.75k|                as_ref_pic_list_temp0[r_idx] = as_ref_pic_st_curr_after[i];
  415|  3.75k|            }
  416|       |
  417|  7.11k|            for(i = 0; (i < (WORD32)u4_num_lt_curr) && (r_idx < u4_num_rps_curr_temp_list0); r_idx++, i++)
  ------------------
  |  Branch (417:24): [True: 4.24k, False: 2.86k]
  |  Branch (417:56): [True: 4.20k, False: 43]
  ------------------
  418|  4.20k|            {
  419|  4.20k|                if(NULL == as_ref_pic_lt_curr[i])
  ------------------
  |  Branch (419:20): [True: 2.98k, False: 1.22k]
  ------------------
  420|  2.98k|                {
  421|  2.98k|                    as_ref_pic_lt_curr[i] = ihevc_dpb_mgr_get_ref_by_nearest_poc(ps_dpb_mgr, ai4_poc_lt_curr[i]);
  422|  2.98k|                }
  423|  4.20k|                as_ref_pic_list_temp0[r_idx] = as_ref_pic_lt_curr[i];
  424|  4.20k|            }
  425|  2.91k|        }
  426|       |
  427|  6.96k|        for(r_idx = 0; (WORD32)r_idx < ps_slice_hdr->i1_num_ref_idx_l0_active; r_idx++)
  ------------------
  |  Branch (427:24): [True: 5.14k, False: 1.82k]
  ------------------
  428|  5.14k|        {
  429|  5.14k|            pic_buf_t *ps_pic_buf;
  430|  5.14k|            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: 2.35k, False: 2.78k]
  ------------------
  431|  5.14k|            ps_pic_buf = (pic_buf_t *)ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf;
  432|       |
  433|  5.14k|            if(ps_pic_buf == NULL)
  ------------------
  |  Branch (433:16): [True: 656, False: 4.48k]
  ------------------
  434|    656|                return IHEVCD_REF_PIC_NOT_FOUND;
  435|       |
  436|  4.48k|            ps_mv_buf = ihevcd_mv_mgr_get_poc(ps_mv_buf_mgr, ps_pic_buf->i4_abs_poc);
  437|  4.48k|            ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = ps_mv_buf;
  438|  4.48k|        }
  439|       |
  440|       |
  441|  1.82k|        if(ps_slice_hdr->i1_slice_type  == BSLICE)
  ------------------
  |  Branch (441:12): [True: 1.61k, False: 214]
  ------------------
  442|  1.61k|        {
  443|  1.61k|            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: 1.39k, False: 217]
  ------------------
  444|       |
  445|  1.61k|            r_idx = 0;
  446|  3.23k|            while(r_idx < u4_num_rps_curr_temp_list1)
  ------------------
  |  Branch (446:19): [True: 1.61k, False: 1.61k]
  ------------------
  447|  1.61k|            {
  448|  3.85k|                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: 2.24k, False: 1.61k]
  |  Branch (448:66): [True: 2.23k, False: 1]
  ------------------
  449|  2.23k|                {
  450|  2.23k|                    if(NULL == as_ref_pic_st_curr_after[i])
  ------------------
  |  Branch (450:24): [True: 0, False: 2.23k]
  ------------------
  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|  2.23k|                    as_ref_pic_list_temp1[r_idx] = as_ref_pic_st_curr_after[i];
  455|  2.23k|                }
  456|       |
  457|  5.53k|                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: 3.91k, False: 1.61k]
  |  Branch (457:67): [True: 3.91k, False: 2]
  ------------------
  458|  3.91k|                {
  459|  3.91k|                    if(NULL == as_ref_pic_st_curr_before[i])
  ------------------
  |  Branch (459:24): [True: 0, False: 3.91k]
  ------------------
  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|  3.91k|                    as_ref_pic_list_temp1[r_idx] = as_ref_pic_st_curr_before[i];
  464|  3.91k|                }
  465|       |
  466|  4.23k|                for(i = 0; (i < (WORD32)u4_num_lt_curr) && (r_idx < u4_num_rps_curr_temp_list1); r_idx++, i++)
  ------------------
  |  Branch (466:28): [True: 2.61k, False: 1.61k]
  |  Branch (466:60): [True: 2.61k, False: 0]
  ------------------
  467|  2.61k|                {
  468|  2.61k|                    if(NULL == as_ref_pic_lt_curr[i])
  ------------------
  |  Branch (468:24): [True: 0, False: 2.61k]
  ------------------
  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|  2.61k|                    as_ref_pic_list_temp1[r_idx] = as_ref_pic_lt_curr[i];
  473|  2.61k|                }
  474|  1.61k|            }
  475|       |
  476|  4.70k|            for(r_idx = 0; (WORD32)r_idx < ps_slice_hdr->i1_num_ref_idx_l1_active; r_idx++)
  ------------------
  |  Branch (476:28): [True: 3.09k, False: 1.61k]
  ------------------
  477|  3.09k|            {
  478|  3.09k|                pic_buf_t *ps_pic_buf;
  479|  3.09k|                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: 979, False: 2.11k]
  ------------------
  480|  3.09k|                ps_pic_buf = (pic_buf_t *)ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf;
  481|       |
  482|  3.09k|                if(ps_pic_buf == NULL)
  ------------------
  |  Branch (482:20): [True: 0, False: 3.09k]
  ------------------
  483|      0|                    return IHEVCD_REF_PIC_NOT_FOUND;
  484|       |
  485|  3.09k|                ps_mv_buf = ihevcd_mv_mgr_get_poc(ps_mv_buf_mgr, ps_pic_buf->i4_abs_poc);
  486|  3.09k|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = ps_mv_buf;
  487|  3.09k|            }
  488|  1.61k|        }
  489|  1.82k|    }
  490|       |
  491|  2.53k|    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|   164k|    for(i = 0; i < MAX_DPB_BUFS; i++)
  ------------------
  |  |   41|   164k|#define MAX_DPB_BUFS                (MAX_DPB_SIZE * 4)
  |  |  ------------------
  |  |  |  |  281|   164k|#define MAX_DPB_SIZE 16
  |  |  ------------------
  ------------------
  |  Branch (493:16): [True: 162k, False: 2.53k]
  ------------------
  494|   162k|    {
  495|   162k|        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: 4.16k, False: 157k]
  |  Branch (495:55): [True: 1.42k, False: 2.73k]
  ------------------
  496|  1.42k|        {
  497|  1.42k|            pic_buf_t *ps_pic_buf = ps_dpb_mgr->as_dpb_info[i].ps_pic_buf;
  498|  1.42k|            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|  1.42k|            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|  1.42k|            ps_mv_buf = (mv_buf_t *)ps_codec->ps_mv_buf;
  506|  2.95k|            for(j = 0; j < ps_codec->i4_max_dpb_size; j++)
  ------------------
  |  Branch (506:24): [True: 2.95k, False: 0]
  ------------------
  507|  2.95k|            {
  508|  2.95k|                if(ps_mv_buf && ps_mv_buf->i4_abs_poc == ps_pic_buf->i4_abs_poc)
  ------------------
  |  Branch (508:20): [True: 2.95k, False: 0]
  |  Branch (508:33): [True: 1.42k, False: 1.52k]
  ------------------
  509|  1.42k|                {
  510|  1.42k|                    ihevc_buf_mgr_release((buf_mgr_t *)ps_codec->pv_mv_buf_mgr, j, BUF_MGR_REF);
  ------------------
  |  |   40|  1.42k|#define BUF_MGR_REF         (1 << 1)
  ------------------
  511|  1.42k|                    break;
  512|  1.42k|                }
  513|  1.52k|                ps_mv_buf++;
  514|  1.52k|            }
  515|  1.42k|        }
  516|       |
  517|   162k|    }
  518|       |
  519|  2.53k|    return IHEVCD_SUCCESS;
  520|  3.18k|}

ihevcd_sao_shift_ctb:
  525|  7.49M|{
  526|  7.49M|    codec_t *ps_codec = ps_sao_ctxt->ps_codec;
  527|  7.49M|    UWORD8 *pu1_src_luma;
  528|  7.49M|    UWORD8 *pu1_src_chroma;
  529|  7.49M|    WORD32 src_strd;
  530|  7.49M|    WORD32 ctb_size;
  531|  7.49M|    WORD32 log2_ctb_size;
  532|  7.49M|    sps_t *ps_sps;
  533|  7.49M|    sao_t *ps_sao;
  534|  7.49M|    pps_t *ps_pps;
  535|  7.49M|    slice_header_t *ps_slice_hdr, *ps_slice_hdr_base;
  536|  7.49M|    tile_t *ps_tile;
  537|  7.49M|    UWORD16 *pu1_slice_idx;
  538|  7.49M|    UWORD16 *pu1_tile_idx;
  539|  7.49M|    WORD32 row, col;
  540|  7.49M|    UWORD8 au1_avail_luma[8];
  541|  7.49M|    UWORD8 au1_avail_chroma[8];
  542|  7.49M|    UWORD8 au1_tile_slice_boundary[8];
  543|  7.49M|    UWORD8 au4_ilf_across_tile_slice_enable[8];
  544|  7.49M|    WORD32 i;
  545|  7.49M|    UWORD8 *pu1_src_top_luma;
  546|  7.49M|    UWORD8 *pu1_src_top_chroma;
  547|  7.49M|    UWORD8 *pu1_src_left_luma;
  548|  7.49M|    UWORD8 *pu1_src_left_chroma;
  549|  7.49M|    UWORD8 au1_src_top_right[2];
  550|  7.49M|    UWORD8 au1_src_bot_left[2];
  551|  7.49M|    UWORD8 *pu1_no_loop_filter_flag;
  552|  7.49M|    UWORD8 *pu1_src_backup_luma;
  553|  7.49M|    UWORD8 *pu1_src_backup_chroma;
  554|  7.49M|    WORD32 backup_strd;
  555|  7.49M|    WORD32 loop_filter_strd;
  556|       |
  557|  7.49M|    WORD32 no_loop_filter_enabled_luma = 0;
  558|  7.49M|    WORD32 no_loop_filter_enabled_chroma = 0;
  559|  7.49M|    UWORD8 *pu1_sao_src_top_left_chroma_curr_ctb;
  560|  7.49M|    UWORD8 *pu1_sao_src_top_left_luma_curr_ctb;
  561|  7.49M|    UWORD8 *pu1_sao_src_luma_top_left_ctb;
  562|  7.49M|    UWORD8 *pu1_sao_src_chroma_top_left_ctb;
  563|  7.49M|    UWORD8 *pu1_sao_src_top_left_luma_top_right;
  564|  7.49M|    UWORD8 *pu1_sao_src_top_left_chroma_top_right;
  565|  7.49M|    UWORD8  u1_sao_src_top_left_luma_bot_left;
  566|  7.49M|    UWORD8  *pu1_sao_src_top_left_luma_bot_left;
  567|  7.49M|    UWORD8 *au1_sao_src_top_left_chroma_bot_left;
  568|  7.49M|    UWORD8 *pu1_sao_src_top_left_chroma_bot_left;
  569|       |    /* Only first 5 values are used, but arrays are large
  570|       |     enough so that SIMD functions can read 64 bits at a time */
  571|  7.49M|    WORD8 ai1_offset_y[8] = {0};
  572|  7.49M|    WORD8 ai1_offset_cb[8] = {0};
  573|  7.49M|    WORD8 ai1_offset_cr[8] = {0};
  574|  7.49M|    WORD32  chroma_yuv420sp_vu = ps_sao_ctxt->is_chroma_yuv420sp_vu;
  575|       |
  576|  7.49M|    PROFILE_DISABLE_SAO();
  ------------------
  |  |   51|  7.49M|#define PROFILE_DISABLE_SAO() ;
  ------------------
  577|       |
  578|  7.49M|    ps_sps = ps_sao_ctxt->ps_sps;
  579|  7.49M|    ps_pps = ps_sao_ctxt->ps_pps;
  580|  7.49M|    ps_tile = ps_sao_ctxt->ps_tile;
  581|       |
  582|  7.49M|    log2_ctb_size = ps_sps->i1_log2_ctb_size;
  583|  7.49M|    ctb_size = (1 << log2_ctb_size);
  584|  7.49M|    src_strd = ps_sao_ctxt->ps_codec->i4_strd;
  585|  7.49M|    ps_slice_hdr_base = ps_sao_ctxt->ps_codec->ps_slice_hdr_base;
  586|  7.49M|    ps_slice_hdr = ps_slice_hdr_base + (ps_sao_ctxt->i4_cur_slice_idx & (MAX_SLICE_HDR_CNT - 1));
  ------------------
  |  |  153|  7.49M|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  7.49M|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  587|       |
  588|  7.49M|    pu1_slice_idx = ps_sao_ctxt->pu1_slice_idx;
  589|  7.49M|    pu1_tile_idx = ps_sao_ctxt->pu1_tile_idx;
  590|  7.49M|    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));
  591|  7.49M|    pu1_src_chroma = ps_sao_ctxt->pu1_cur_pic_chroma + ((ps_sao_ctxt->i4_ctb_x + ps_sao_ctxt->i4_ctb_y * ps_sao_ctxt->ps_codec->i4_strd / 2) << (log2_ctb_size));
  592|       |
  593|       |    /*Stores the left value for each row ctbs- Needed for column tiles*/
  594|  7.49M|    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));
  595|  7.49M|    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));
  596|  7.49M|    pu1_sao_src_luma_top_left_ctb = ps_sao_ctxt->pu1_sao_src_luma_top_left_ctb + ((ps_sao_ctxt->i4_ctb_y));
  597|  7.49M|    pu1_sao_src_chroma_top_left_ctb = ps_sao_ctxt->pu1_sao_src_chroma_top_left_ctb + (2 * ps_sao_ctxt->i4_ctb_y);
  598|  7.49M|    u1_sao_src_top_left_luma_bot_left = ps_sao_ctxt->u1_sao_src_top_left_luma_bot_left; // + ((ps_sao_ctxt->i4_ctb_y));
  599|  7.49M|    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));
  600|  7.49M|    au1_sao_src_top_left_chroma_bot_left = ps_sao_ctxt->au1_sao_src_top_left_chroma_bot_left; // + (2 * ps_sao_ctxt->i4_ctb_y);
  601|  7.49M|    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);
  602|  7.49M|    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));
  603|  7.49M|    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);
  604|       |
  605|  7.49M|    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;
  606|  7.49M|    loop_filter_strd =  (ps_sps->i2_pic_width_in_luma_samples + 63) >> 6;
  607|  7.49M|    backup_strd = 2 * MAX_CTB_SIZE;
  ------------------
  |  |  341|  7.49M|#define MAX_CTB_SIZE        64
  ------------------
  608|       |
  609|  7.49M|    DEBUG_INIT_TMP_BUF(ps_sao_ctxt->pu1_tmp_buf_luma, ps_sao_ctxt->pu1_tmp_buf_chroma);
  610|       |
  611|  7.49M|    {
  612|       |        /* Check the loop filter flags and copy the original values for back up */
  613|       |        /* Luma */
  614|       |
  615|       |        /* Done unconditionally since SAO is done on a shifted CTB and the constituent CTBs
  616|       |         * can belong to different slice with their own sao_enable flag */
  617|  7.49M|        {
  618|  7.49M|            UWORD32 u4_no_loop_filter_flag;
  619|  7.49M|            WORD32 loop_filter_bit_pos;
  620|  7.49M|            WORD32 log2_min_cu = 3;
  621|  7.49M|            WORD32 min_cu = (1 << log2_min_cu);
  622|  7.49M|            UWORD8 *pu1_src_tmp_luma = pu1_src_luma;
  623|  7.49M|            WORD32 sao_blk_ht = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
  624|  7.49M|            WORD32 sao_blk_wd = ctb_size;
  625|  7.49M|            WORD32 remaining_rows;
  626|  7.49M|            WORD32 remaining_cols;
  627|       |
  628|  7.49M|            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|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
  629|  7.49M|            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|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
  630|  7.49M|            if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (630:16): [True: 283k, False: 7.20M]
  ------------------
  631|   283k|                sao_blk_ht += remaining_rows;
  632|  7.49M|            if(remaining_cols <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (632:16): [True: 473k, False: 7.01M]
  ------------------
  633|   473k|                sao_blk_wd += remaining_cols;
  634|       |
  635|  7.49M|            pu1_src_tmp_luma -= ps_sao_ctxt->i4_ctb_x ? SAO_SHIFT_CTB : 0;
  ------------------
  |  |   78|  7.01M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (635:33): [True: 7.01M, False: 473k]
  ------------------
  636|  7.49M|            pu1_src_tmp_luma -= ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB * src_strd : 0;
  ------------------
  |  |   78|  7.20M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (636:33): [True: 7.20M, False: 283k]
  ------------------
  637|       |
  638|  7.49M|            pu1_src_backup_luma = ps_sao_ctxt->pu1_tmp_buf_luma;
  639|       |
  640|  7.49M|            loop_filter_bit_pos = (ps_sao_ctxt->i4_ctb_x << (log2_ctb_size - 3)) +
  641|  7.49M|                            (ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 3)) * (loop_filter_strd << 3);
  642|  7.49M|            if(ps_sao_ctxt->i4_ctb_x > 0)
  ------------------
  |  Branch (642:16): [True: 7.01M, False: 473k]
  ------------------
  643|  7.01M|                loop_filter_bit_pos -= 1;
  644|       |
  645|  7.49M|            pu1_no_loop_filter_flag = ps_sao_ctxt->pu1_pic_no_loop_filter_flag +
  646|  7.49M|                            (loop_filter_bit_pos >> 3);
  647|       |
  648|  7.49M|            for(i = -(ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB : 0) >> log2_min_cu;
  ------------------
  |  |   78|  7.20M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (648:23): [True: 7.20M, False: 283k]
  ------------------
  649|  35.9M|                            i < (sao_blk_ht + (min_cu - 1)) >> log2_min_cu; i++)
  ------------------
  |  Branch (649:29): [True: 28.4M, False: 7.49M]
  ------------------
  650|  28.4M|            {
  651|  28.4M|                WORD32 tmp_wd = sao_blk_wd;
  652|       |
  653|  28.4M|                u4_no_loop_filter_flag = (*(UWORD32 *)(pu1_no_loop_filter_flag + i * loop_filter_strd)) >>
  654|  28.4M|                                (loop_filter_bit_pos & 7);
  655|  28.4M|                u4_no_loop_filter_flag &= (1 << ((tmp_wd + (min_cu - 1)) >> log2_min_cu)) - 1;
  656|       |
  657|  28.4M|                if(u4_no_loop_filter_flag)
  ------------------
  |  Branch (657:20): [True: 116k, False: 28.3M]
  ------------------
  658|   116k|                {
  659|   116k|                    no_loop_filter_enabled_luma = 1;
  660|   313k|                    while(tmp_wd > 0)
  ------------------
  |  Branch (660:27): [True: 196k, False: 116k]
  ------------------
  661|   196k|                    {
  662|   196k|                        if(CTZ(u4_no_loop_filter_flag))
  ------------------
  |  Branch (662:28): [True: 70.7k, False: 125k]
  ------------------
  663|  70.7k|                        {
  664|  70.7k|                            pu1_src_tmp_luma += MIN((WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|  70.7k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 36.7k, False: 33.9k]
  |  |  ------------------
  ------------------
  665|  70.7k|                            pu1_src_backup_luma += MIN((WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|  70.7k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 36.7k, False: 33.9k]
  |  |  ------------------
  ------------------
  666|  70.7k|                            tmp_wd -= (WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu);
  667|  70.7k|                            u4_no_loop_filter_flag  >>= (CTZ(u4_no_loop_filter_flag));
  668|  70.7k|                        }
  669|   125k|                        else
  670|   125k|                        {
  671|  1.11M|                            for(row = 0; row < min_cu; row++)
  ------------------
  |  Branch (671:42): [True: 992k, False: 125k]
  ------------------
  672|   992k|                            {
  673|  40.6M|                                for(col = 0; col < MIN((WORD32)(CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd); col++)
  ------------------
  |  |   43|  40.6M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 5.59M, False: 35.0M]
  |  |  ------------------
  ------------------
  |  Branch (673:46): [True: 39.6M, False: 992k]
  ------------------
  674|  39.6M|                                {
  675|  39.6M|                                    pu1_src_backup_luma[row * backup_strd + col] = pu1_src_tmp_luma[row * src_strd + col];
  676|  39.6M|                                }
  677|   992k|                            }
  678|   125k|                            pu1_src_tmp_luma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|   125k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 43.2k, False: 82.5k]
  |  |  ------------------
  ------------------
  679|   125k|                            pu1_src_backup_luma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|   125k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 43.3k, False: 82.5k]
  |  |  ------------------
  ------------------
  680|   125k|                            tmp_wd -= (WORD32)(CTZ(~u4_no_loop_filter_flag) << log2_min_cu);
  681|   125k|                            u4_no_loop_filter_flag  >>= (CTZ(~u4_no_loop_filter_flag));
  682|   125k|                        }
  683|   196k|                    }
  684|       |
  685|   116k|                    pu1_src_tmp_luma -= sao_blk_wd;
  686|   116k|                    pu1_src_backup_luma -= sao_blk_wd;
  687|   116k|                }
  688|       |
  689|  28.4M|                pu1_src_tmp_luma += (src_strd << log2_min_cu);
  690|  28.4M|                pu1_src_backup_luma += (backup_strd << log2_min_cu);
  691|  28.4M|            }
  692|  7.49M|        }
  693|       |
  694|       |        /* Chroma */
  695|       |
  696|  7.49M|        {
  697|  7.49M|            UWORD32 u4_no_loop_filter_flag;
  698|  7.49M|            WORD32 loop_filter_bit_pos;
  699|  7.49M|            WORD32 log2_min_cu = 3;
  700|  7.49M|            WORD32 min_cu = (1 << log2_min_cu);
  701|  7.49M|            UWORD8 *pu1_src_tmp_chroma = pu1_src_chroma;
  702|  7.49M|            WORD32 sao_blk_ht = ctb_size - 2 * SAO_SHIFT_CTB;
  ------------------
  |  |   78|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
  703|  7.49M|            WORD32 sao_blk_wd = ctb_size;
  704|  7.49M|            WORD32 remaining_rows;
  705|  7.49M|            WORD32 remaining_cols;
  706|       |
  707|  7.49M|            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|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
  708|  7.49M|            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|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
  709|  7.49M|            if(remaining_rows <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (709:16): [True: 283k, False: 7.20M]
  ------------------
  710|   283k|                sao_blk_ht += remaining_rows;
  711|  7.49M|            if(remaining_cols <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (711:16): [True: 473k, False: 7.01M]
  ------------------
  712|   473k|                sao_blk_wd += remaining_cols;
  713|       |
  714|  7.49M|            pu1_src_tmp_chroma -= ps_sao_ctxt->i4_ctb_x ? SAO_SHIFT_CTB * 2 : 0;
  ------------------
  |  |   78|  7.01M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (714:35): [True: 7.01M, False: 473k]
  ------------------
  715|  7.49M|            pu1_src_tmp_chroma -= ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB * src_strd : 0;
  ------------------
  |  |   78|  7.20M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (715:35): [True: 7.20M, False: 283k]
  ------------------
  716|       |
  717|  7.49M|            pu1_src_backup_chroma = ps_sao_ctxt->pu1_tmp_buf_chroma;
  718|       |
  719|  7.49M|            loop_filter_bit_pos = (ps_sao_ctxt->i4_ctb_x << (log2_ctb_size - 3)) +
  720|  7.49M|                            (ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 3)) * (loop_filter_strd << 3);
  721|  7.49M|            if(ps_sao_ctxt->i4_ctb_x > 0)
  ------------------
  |  Branch (721:16): [True: 7.01M, False: 472k]
  ------------------
  722|  7.01M|                loop_filter_bit_pos -= 2;
  723|       |
  724|  7.49M|            pu1_no_loop_filter_flag = ps_sao_ctxt->pu1_pic_no_loop_filter_flag +
  725|  7.49M|                            (loop_filter_bit_pos >> 3);
  726|       |
  727|  7.49M|            for(i = -(ps_sao_ctxt->i4_ctb_y ? 2 * SAO_SHIFT_CTB : 0) >> log2_min_cu;
  ------------------
  |  |   78|  7.20M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (727:23): [True: 7.20M, False: 283k]
  ------------------
  728|  35.9M|                            i < (sao_blk_ht + (min_cu - 1)) >> log2_min_cu; i++)
  ------------------
  |  Branch (728:29): [True: 28.4M, False: 7.49M]
  ------------------
  729|  28.4M|            {
  730|  28.4M|                WORD32 tmp_wd = sao_blk_wd;
  731|       |
  732|  28.4M|                u4_no_loop_filter_flag = (*(UWORD32 *)(pu1_no_loop_filter_flag + i * loop_filter_strd)) >>
  733|  28.4M|                                (loop_filter_bit_pos & 7);
  734|  28.4M|                u4_no_loop_filter_flag &= (1 << ((tmp_wd + (min_cu - 1)) >> log2_min_cu)) - 1;
  735|       |
  736|  28.4M|                if(u4_no_loop_filter_flag)
  ------------------
  |  Branch (736:20): [True: 115k, False: 28.3M]
  ------------------
  737|   115k|                {
  738|   115k|                    no_loop_filter_enabled_chroma = 1;
  739|   302k|                    while(tmp_wd > 0)
  ------------------
  |  Branch (739:27): [True: 187k, False: 115k]
  ------------------
  740|   187k|                    {
  741|   187k|                        if(CTZ(u4_no_loop_filter_flag))
  ------------------
  |  Branch (741:28): [True: 65.9k, False: 121k]
  ------------------
  742|  65.9k|                        {
  743|  65.9k|                            pu1_src_tmp_chroma += MIN(((WORD32)CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|  65.9k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 32.4k, False: 33.4k]
  |  |  ------------------
  ------------------
  744|  65.9k|                            pu1_src_backup_chroma += MIN(((WORD32)CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|  65.9k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 32.4k, False: 33.4k]
  |  |  ------------------
  ------------------
  745|  65.9k|                            tmp_wd -= (WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu);
  746|  65.9k|                            u4_no_loop_filter_flag  >>= (CTZ(u4_no_loop_filter_flag));
  747|  65.9k|                        }
  748|   121k|                        else
  749|   121k|                        {
  750|   606k|                            for(row = 0; row < min_cu / 2; row++)
  ------------------
  |  Branch (750:42): [True: 484k, False: 121k]
  ------------------
  751|   484k|                            {
  752|  21.3M|                                for(col = 0; col < MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd); col++)
  ------------------
  |  |   43|  21.3M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 3.27M, False: 18.0M]
  |  |  ------------------
  ------------------
  |  Branch (752:46): [True: 20.8M, False: 484k]
  ------------------
  753|  20.8M|                                {
  754|  20.8M|                                    pu1_src_backup_chroma[row * backup_strd + col] = pu1_src_tmp_chroma[row * src_strd + col];
  755|  20.8M|                                }
  756|   484k|                            }
  757|       |
  758|   121k|                            pu1_src_tmp_chroma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|   121k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 39.7k, False: 81.8k]
  |  |  ------------------
  ------------------
  759|   121k|                            pu1_src_backup_chroma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|   121k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 39.7k, False: 81.8k]
  |  |  ------------------
  ------------------
  760|   121k|                            tmp_wd -= (WORD32)(CTZ(~u4_no_loop_filter_flag) << log2_min_cu);
  761|   121k|                            u4_no_loop_filter_flag  >>= (CTZ(~u4_no_loop_filter_flag));
  762|   121k|                        }
  763|   187k|                    }
  764|       |
  765|   115k|                    pu1_src_tmp_chroma -= sao_blk_wd;
  766|   115k|                    pu1_src_backup_chroma -= sao_blk_wd;
  767|   115k|                }
  768|       |
  769|  28.4M|                pu1_src_tmp_chroma += ((src_strd / 2) << log2_min_cu);
  770|  28.4M|                pu1_src_backup_chroma += ((backup_strd / 2) << log2_min_cu);
  771|  28.4M|            }
  772|  7.49M|        }
  773|  7.49M|    }
  774|       |
  775|  7.49M|    DEBUG_PROCESS_TMP_BUF(ps_sao_ctxt->pu1_tmp_buf_luma, ps_sao_ctxt->pu1_tmp_buf_chroma);
  776|       |
  777|       |    /* Top-left CTB */
  778|  7.49M|    if(ps_sao_ctxt->i4_ctb_x > 0 && ps_sao_ctxt->i4_ctb_y > 0)
  ------------------
  |  Branch (778:8): [True: 7.02M, False: 472k]
  |  Branch (778:37): [True: 6.74M, False: 274k]
  ------------------
  779|  6.74M|    {
  780|  6.74M|        WORD32 sao_wd_luma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  6.74M|#define SAO_SHIFT_CTB    8
  ------------------
  781|  6.74M|        WORD32 sao_wd_chroma = 2 * SAO_SHIFT_CTB;
  ------------------
  |  |   78|  6.74M|#define SAO_SHIFT_CTB    8
  ------------------
  782|  6.74M|        WORD32 sao_ht_luma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  6.74M|#define SAO_SHIFT_CTB    8
  ------------------
  783|  6.74M|        WORD32 sao_ht_chroma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  6.74M|#define SAO_SHIFT_CTB    8
  ------------------
  784|       |
  785|  6.74M|        WORD32 ctbx_tl_t = 0, ctbx_tl_l = 0, ctbx_tl_r = 0, ctbx_tl_d = 0, ctbx_tl = 0;
  786|  6.74M|        WORD32 ctby_tl_t = 0, ctby_tl_l = 0, ctby_tl_r = 0, ctby_tl_d = 0, ctby_tl = 0;
  787|  6.74M|        WORD32 au4_idx_tl[8], idx_tl;
  788|       |
  789|  6.74M|        slice_header_t *ps_slice_hdr_top_left;
  790|  6.74M|        {
  791|  6.74M|            WORD32 top_left_ctb_indx = (ps_sao_ctxt->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb +
  792|  6.74M|                                        (ps_sao_ctxt->i4_ctb_x - 1);
  793|  6.74M|            ps_slice_hdr_top_left = ps_slice_hdr_base + pu1_slice_idx[top_left_ctb_indx];
  794|  6.74M|        }
  795|       |
  796|       |
  797|  6.74M|        pu1_src_luma -= (sao_wd_luma + sao_ht_luma * src_strd);
  798|  6.74M|        pu1_src_chroma -= (sao_wd_chroma + sao_ht_chroma * src_strd);
  799|  6.74M|        ps_sao -= (1 + ps_sps->i2_pic_wd_in_ctb);
  800|  6.74M|        pu1_src_top_luma = ps_sao_ctxt->pu1_sao_src_top_luma + (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_luma;
  801|  6.74M|        pu1_src_top_chroma = ps_sao_ctxt->pu1_sao_src_top_chroma + (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_chroma;
  802|  6.74M|        pu1_src_left_luma = ps_sao_ctxt->pu1_sao_src_left_luma + (ps_sao_ctxt->i4_ctb_y << log2_ctb_size) - sao_ht_luma;
  803|  6.74M|        pu1_src_left_chroma = ps_sao_ctxt->pu1_sao_src_left_chroma + (ps_sao_ctxt->i4_ctb_y << log2_ctb_size) - (2 * sao_ht_chroma);
  804|       |
  805|  6.74M|        if(ps_slice_hdr_top_left->i1_slice_sao_luma_flag)
  ------------------
  |  Branch (805:12): [True: 2.73M, False: 4.00M]
  ------------------
  806|  2.73M|        {
  807|  2.73M|            if(0 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (807:16): [True: 2.48M, False: 252k]
  ------------------
  808|  2.48M|            {
  809|       |                /* Update left, top and top-left */
  810|  22.3M|                for(row = 0; row < sao_ht_luma; row++)
  ------------------
  |  Branch (810:30): [True: 19.8M, False: 2.48M]
  ------------------
  811|  19.8M|                {
  812|  19.8M|                    pu1_src_left_luma[row] = pu1_src_luma[row * src_strd + (sao_wd_luma - 1)];
  813|  19.8M|                }
  814|  2.48M|                pu1_sao_src_luma_top_left_ctb[0] = pu1_src_top_luma[sao_wd_luma - 1];
  815|       |
  816|  2.48M|                ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_luma, &pu1_src_luma[(sao_ht_luma - 1) * src_strd], sao_wd_luma);
  817|       |
  818|       |
  819|  2.48M|            }
  820|       |
  821|   252k|            else if(1 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (821:21): [True: 127k, False: 124k]
  ------------------
  822|   127k|            {
  823|   127k|                ai1_offset_y[1] = ps_sao->b4_y_offset_1;
  824|   127k|                ai1_offset_y[2] = ps_sao->b4_y_offset_2;
  825|   127k|                ai1_offset_y[3] = ps_sao->b4_y_offset_3;
  826|   127k|                ai1_offset_y[4] = ps_sao->b4_y_offset_4;
  827|       |
  828|   127k|                ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr(pu1_src_luma,
  829|   127k|                                                                          src_strd,
  830|   127k|                                                                          pu1_src_left_luma,
  831|   127k|                                                                          pu1_src_top_luma,
  832|   127k|                                                                          pu1_sao_src_luma_top_left_ctb,
  833|   127k|                                                                          ps_sao->b5_y_band_pos,
  834|   127k|                                                                          ai1_offset_y,
  835|   127k|                                                                          sao_wd_luma,
  836|   127k|                                                                          sao_ht_luma
  837|   127k|                                                                         );
  838|   127k|            }
  839|       |
  840|   124k|            else // if(2 <= ps_sao->b3_y_type_idx)
  841|   124k|            {
  842|   124k|                ai1_offset_y[1] = ps_sao->b4_y_offset_1;
  843|   124k|                ai1_offset_y[2] = ps_sao->b4_y_offset_2;
  844|   124k|                ai1_offset_y[3] = ps_sao->b4_y_offset_3;
  845|   124k|                ai1_offset_y[4] = ps_sao->b4_y_offset_4;
  846|       |
  847|  1.12M|                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (847:28): [True: 998k, False: 124k]
  ------------------
  848|   998k|                {
  849|   998k|                    au1_avail_luma[i] = 255;
  850|   998k|                    au1_tile_slice_boundary[i] = 0;
  851|   998k|                    au4_idx_tl[i] = 0;
  852|   998k|                    au4_ilf_across_tile_slice_enable[i] = 1;
  853|   998k|                }
  854|       |
  855|       |                /******************************************************************
  856|       |                 * Derive the  Top-left CTB's neighbor pixel's slice indices.
  857|       |                 *
  858|       |                 *          TL_T
  859|       |                 *       4  _2__5________
  860|       |                 *     0   |    |       |
  861|       |                 *    TL_L | TL | 1 TL_R|
  862|       |                 *         |____|_______|____
  863|       |                 *        6|TL_D|7      |    |
  864|       |                 *         | 3  |       |    |
  865|       |                 *         |____|_______|    |
  866|       |                 *              |            |
  867|       |                 *              |            |
  868|       |                 *              |____________|
  869|       |                 *
  870|       |                 *****************************************************************/
  871|       |
  872|       |                /*In case of slices, unless we encounter multiple slice/tiled clips, don't enter*/
  873|   124k|                {
  874|   124k|                    if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (874:24): [True: 460, False: 124k]
  |  Branch (874:71): [True: 1.95k, False: 122k]
  ------------------
  875|  2.44k|                    {
  876|  2.44k|                        {
  877|       |                            /*Assuming that sao shift is uniform along x and y directions*/
  878|  2.44k|                            if((0 == (1 << log2_ctb_size) - sao_wd_luma) && (ps_sao_ctxt->i4_ctb_y > 1) && (ps_sao_ctxt->i4_ctb_x > 1))
  ------------------
  |  Branch (878:32): [True: 0, False: 2.44k]
  |  Branch (878:77): [True: 0, False: 0]
  |  Branch (878:108): [True: 0, False: 0]
  ------------------
  879|      0|                            {
  880|      0|                                ctby_tl_t = ps_sao_ctxt->i4_ctb_y - 2;
  881|      0|                                ctbx_tl_l = ps_sao_ctxt->i4_ctb_x - 2;
  882|      0|                            }
  883|  2.44k|                            else if(!(0 == (1 << log2_ctb_size) - sao_wd_luma))
  ------------------
  |  Branch (883:37): [True: 2.44k, False: 0]
  ------------------
  884|  2.44k|                            {
  885|  2.44k|                                ctby_tl_t = ps_sao_ctxt->i4_ctb_y - 1;
  886|  2.44k|                                ctbx_tl_l = ps_sao_ctxt->i4_ctb_x - 1;
  887|  2.44k|                            }
  888|  2.44k|                            ctbx_tl_t = ps_sao_ctxt->i4_ctb_x - 1;
  889|  2.44k|                            ctby_tl_l = ps_sao_ctxt->i4_ctb_y - 1;
  890|       |
  891|  2.44k|                            ctbx_tl_r = ps_sao_ctxt->i4_ctb_x;
  892|  2.44k|                            ctby_tl_r = ps_sao_ctxt->i4_ctb_y - 1;
  893|       |
  894|  2.44k|                            ctbx_tl_d =  ps_sao_ctxt->i4_ctb_x - 1;
  895|  2.44k|                            ctby_tl_d =  ps_sao_ctxt->i4_ctb_y;
  896|       |
  897|  2.44k|                            ctbx_tl = ps_sao_ctxt->i4_ctb_x - 1;
  898|  2.44k|                            ctby_tl = ps_sao_ctxt->i4_ctb_y - 1;
  899|  2.44k|                        }
  900|       |
  901|  2.44k|                        if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (901:28): [True: 494, False: 1.95k]
  ------------------
  902|    494|                        {
  903|       |                            /*Calculate slice indices for neighbor pixels*/
  904|    494|                            idx_tl   = pu1_slice_idx[ctbx_tl + (ctby_tl * ps_sps->i2_pic_wd_in_ctb)];
  905|    494|                            au4_idx_tl[2] = au4_idx_tl[4] = *(pu1_slice_idx + ctbx_tl_t + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb));
  906|    494|                            au4_idx_tl[0] =  pu1_slice_idx[ctbx_tl_l + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
  907|    494|                            au4_idx_tl[1] = au4_idx_tl[5] = pu1_slice_idx[ctbx_tl_r + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
  908|    494|                            au4_idx_tl[3] = au4_idx_tl[6] =   pu1_slice_idx[ctbx_tl_d + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  909|    494|                            au4_idx_tl[7] = pu1_slice_idx[ctbx_tl_d + 1 + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  910|       |
  911|    494|                            if((0 == (1 << log2_ctb_size) - sao_wd_luma))
  ------------------
  |  Branch (911:32): [True: 0, False: 494]
  ------------------
  912|      0|                            {
  913|      0|                                if(ps_sao_ctxt->i4_ctb_x == 1)
  ------------------
  |  Branch (913:36): [True: 0, False: 0]
  ------------------
  914|      0|                                {
  915|      0|                                    au4_idx_tl[6] = -1;
  916|      0|                                    au4_idx_tl[4] = -1;
  917|      0|                                }
  918|      0|                                else
  919|      0|                                {
  920|      0|                                    au4_idx_tl[6] = pu1_slice_idx[(ctbx_tl_d - 1) + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
  921|      0|                                }
  922|      0|                                if(ps_sao_ctxt->i4_ctb_y == 1)
  ------------------
  |  Branch (922:36): [True: 0, False: 0]
  ------------------
  923|      0|                                {
  924|      0|                                    au4_idx_tl[5] = -1;
  925|      0|                                    au4_idx_tl[4] = -1;
  926|      0|                                }
  927|      0|                                else
  928|      0|                                {
  929|      0|                                    au4_idx_tl[5] = pu1_slice_idx[(ctbx_tl_l + 1) + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
  930|      0|                                    au4_idx_tl[4] = pu1_slice_idx[(ctbx_tl_t - 1) + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb)];
  931|      0|                                }
  932|      0|                                au4_idx_tl[7] = pu1_slice_idx[(ctbx_tl_d + 1) + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
  933|      0|                            }
  934|       |
  935|       |                            /* Verify that the neighbor ctbs dont cross pic boundary.
  936|       |                             * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
  937|       |                             * of the pixel having a greater address is checked. Accordingly, set the availability flags.
  938|       |                             * Hence, for top and left pixels, current ctb flag is checked. For right and down pixels,
  939|       |                             * the respective pixel's flags are checked
  940|       |                             */
  941|       |
  942|    494|                            if((0 == (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_luma))
  ------------------
  |  Branch (942:32): [True: 0, False: 494]
  ------------------
  943|      0|                            {
  944|      0|                                au4_ilf_across_tile_slice_enable[4] = 0;
  945|      0|                                au4_ilf_across_tile_slice_enable[6] = 0;
  946|      0|                            }
  947|    494|                            else
  948|    494|                            {
  949|    494|                                au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + au4_idx_tl[6])->i1_slice_loop_filter_across_slices_enabled_flag;
  950|    494|                            }
  951|    494|                            if((0 == (ps_sao_ctxt->i4_ctb_y << log2_ctb_size) - sao_ht_luma))
  ------------------
  |  Branch (951:32): [True: 0, False: 494]
  ------------------
  952|      0|                            {
  953|      0|                                au4_ilf_across_tile_slice_enable[5] = 0;
  954|      0|                                au4_ilf_across_tile_slice_enable[4] = 0;
  955|      0|                            }
  956|    494|                            else
  957|    494|                            {
  958|    494|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  959|    494|                                au4_ilf_across_tile_slice_enable[4] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  960|    494|                            }
  961|    494|                            au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  962|    494|                            au4_ilf_across_tile_slice_enable[0] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
  963|    494|                            au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_tl[1])->i1_slice_loop_filter_across_slices_enabled_flag;
  964|    494|                            au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_tl[3])->i1_slice_loop_filter_across_slices_enabled_flag;
  965|    494|                            au4_ilf_across_tile_slice_enable[7] = (ps_slice_hdr_base + au4_idx_tl[7])->i1_slice_loop_filter_across_slices_enabled_flag;
  966|       |
  967|    494|                            if(au4_idx_tl[5] > idx_tl)
  ------------------
  |  Branch (967:32): [True: 372, False: 122]
  ------------------
  968|    372|                            {
  969|    372|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + au4_idx_tl[5])->i1_slice_loop_filter_across_slices_enabled_flag;
  970|    372|                            }
  971|       |
  972|       |                            /*
  973|       |                             * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
  974|       |                             * of the pixel having a greater address is checked. Accordingly, set the availability flags.
  975|       |                             * Hence, for top and left pixels, current ctb flag is checked. For right and down pixels,
  976|       |                             * the respective pixel's flags are checked
  977|       |                             */
  978|  4.44k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (978:40): [True: 3.95k, False: 494]
  ------------------
  979|  3.95k|                            {
  980|       |                                /*Sets the edges that lie on the slice/tile boundary*/
  981|  3.95k|                                if(au4_idx_tl[i] != idx_tl)
  ------------------
  |  Branch (981:36): [True: 1.41k, False: 2.54k]
  ------------------
  982|  1.41k|                                {
  983|  1.41k|                                    au1_tile_slice_boundary[i] = 1;
  984|  1.41k|                                }
  985|  2.54k|                                else
  986|  2.54k|                                {
  987|  2.54k|                                    au4_ilf_across_tile_slice_enable[i] = 1;
  988|  2.54k|                                }
  989|  3.95k|                            }
  990|       |
  991|    494|                            ps_codec->s_func_selector.ihevc_memset_mul_8_fptr((UWORD8 *)au4_idx_tl, 0, 8 * sizeof(WORD32));
  992|    494|                        }
  993|       |
  994|  2.44k|                        if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (994:28): [True: 2.27k, False: 167]
  ------------------
  995|  2.27k|                        {
  996|       |                            /* Calculate availability flags at slice boundary */
  997|  2.27k|                            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 (997:33): [True: 381, False: 1.89k]
  |  Branch (997:81): [True: 1.10k, False: 793]
  |  Branch (997:133): [True: 1.10k, False: 381]
  |  Branch (997:161): [True: 0, False: 1.10k]
  ------------------
  998|  1.48k|                            {
  999|       |                                /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 1000|  1.48k|                                if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (1000:36): [True: 1.14k, False: 341]
  ------------------
 1001|  1.14k|                                {
 1002|       |                                    /*Set the boundary arrays*/
 1003|       |                                    /*Calculate tile indices for neighbor pixels*/
 1004|  1.14k|                                    idx_tl   = pu1_tile_idx[ctbx_tl + (ctby_tl * ps_sps->i2_pic_wd_in_ctb)];
 1005|  1.14k|                                    au4_idx_tl[2] = au4_idx_tl[4] = *(pu1_tile_idx + ctbx_tl_t + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb));
 1006|  1.14k|                                    au4_idx_tl[0] =  pu1_tile_idx[ctbx_tl_l + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
 1007|  1.14k|                                    au4_idx_tl[1] = au4_idx_tl[5] = pu1_tile_idx[ctbx_tl_r + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
 1008|  1.14k|                                    au4_idx_tl[3] = au4_idx_tl[6] =   pu1_tile_idx[ctbx_tl_d + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
 1009|  1.14k|                                    au4_idx_tl[7] = pu1_tile_idx[ctbx_tl_d + 1 + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
 1010|       |
 1011|  1.14k|                                    if((0 == (1 << log2_ctb_size) - sao_wd_luma))
  ------------------
  |  Branch (1011:40): [True: 0, False: 1.14k]
  ------------------
 1012|      0|                                    {
 1013|      0|                                        if(ps_sao_ctxt->i4_ctb_x == 1)
  ------------------
  |  Branch (1013:44): [True: 0, False: 0]
  ------------------
 1014|      0|                                        {
 1015|      0|                                            au4_idx_tl[6] = -1;
 1016|      0|                                            au4_idx_tl[4] = -1;
 1017|      0|                                        }
 1018|      0|                                        else
 1019|      0|                                        {
 1020|      0|                                            au4_idx_tl[6] = pu1_tile_idx[(ctbx_tl_d - 1) + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
 1021|      0|                                        }
 1022|      0|                                        if(ps_sao_ctxt->i4_ctb_y == 1)
  ------------------
  |  Branch (1022:44): [True: 0, False: 0]
  ------------------
 1023|      0|                                        {
 1024|      0|                                            au4_idx_tl[5] = -1;
 1025|      0|                                            au4_idx_tl[4] = -1;
 1026|      0|                                        }
 1027|      0|                                        else
 1028|      0|                                        {
 1029|      0|                                            au4_idx_tl[5] = pu1_tile_idx[(ctbx_tl_l + 1) + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
 1030|      0|                                            au4_idx_tl[4] = pu1_tile_idx[(ctbx_tl_t - 1) + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb)];
 1031|      0|                                        }
 1032|      0|                                        au4_idx_tl[7] = pu1_tile_idx[(ctbx_tl_d + 1) + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
 1033|      0|                                    }
 1034|  10.2k|                                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1034:48): [True: 9.14k, False: 1.14k]
  ------------------
 1035|  9.14k|                                    {
 1036|       |                                        /*Sets the edges that lie on the tile boundary*/
 1037|  9.14k|                                        if(au4_idx_tl[i] != idx_tl)
  ------------------
  |  Branch (1037:44): [True: 3.42k, False: 5.71k]
  ------------------
 1038|  3.42k|                                        {
 1039|  3.42k|                                            au1_tile_slice_boundary[i] |= 1;
 1040|  3.42k|                                            au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag; //=0
 1041|  3.42k|                                        }
 1042|  9.14k|                                    }
 1043|  1.14k|                                }
 1044|  1.48k|                            }
 1045|  2.27k|                        }
 1046|       |
 1047|       |
 1048|       |                        /*Set availability flags based on tile and slice boundaries*/
 1049|  21.9k|                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1049:36): [True: 19.5k, False: 2.44k]
  ------------------
 1050|  19.5k|                        {
 1051|       |                            /*Sets the edges that lie on the slice/tile boundary*/
 1052|  19.5k|                            if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (1052:32): [True: 4.83k, False: 14.7k]
  |  Branch (1052:64): [True: 3.42k, False: 1.41k]
  ------------------
 1053|  3.42k|                            {
 1054|  3.42k|                                au1_avail_luma[i] = 0;
 1055|  3.42k|                            }
 1056|  19.5k|                        }
 1057|  2.44k|                    }
 1058|   124k|                }
 1059|       |
 1060|   124k|                if(0 == (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_luma)
  ------------------
  |  Branch (1060:20): [True: 0, False: 124k]
  ------------------
 1061|      0|                {
 1062|      0|                    au1_avail_luma[0] = 0;
 1063|      0|                    au1_avail_luma[4] = 0;
 1064|      0|                    au1_avail_luma[6] = 0;
 1065|      0|                }
 1066|       |
 1067|   124k|                if(ps_sps->i2_pic_wd_in_ctb == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1067:20): [True: 0, False: 124k]
  ------------------
 1068|      0|                {
 1069|      0|                    au1_avail_luma[1] = 0;
 1070|      0|                    au1_avail_luma[5] = 0;
 1071|      0|                    au1_avail_luma[7] = 0;
 1072|      0|                }
 1073|       |                //y==1 case
 1074|   124k|                if((0 == (ps_sao_ctxt->i4_ctb_y << log2_ctb_size) - sao_ht_luma))
  ------------------
  |  Branch (1074:20): [True: 0, False: 124k]
  ------------------
 1075|      0|                {
 1076|      0|                    au1_avail_luma[2] = 0;
 1077|      0|                    au1_avail_luma[4] = 0;
 1078|      0|                    au1_avail_luma[5] = 0;
 1079|      0|                }
 1080|   124k|                if(ps_sps->i2_pic_ht_in_ctb == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (1080:20): [True: 0, False: 124k]
  ------------------
 1081|      0|                {
 1082|      0|                    au1_avail_luma[3] = 0;
 1083|      0|                    au1_avail_luma[6] = 0;
 1084|      0|                    au1_avail_luma[7] = 0;
 1085|      0|                }
 1086|       |
 1087|   124k|                {
 1088|   124k|                    au1_src_top_right[0] = pu1_src_top_luma[sao_wd_luma];
 1089|   124k|                    u1_sao_src_top_left_luma_bot_left = pu1_src_left_luma[sao_ht_luma];
 1090|   124k|                    ps_codec->apf_sao_luma[ps_sao->b3_y_type_idx - 2](pu1_src_luma,
 1091|   124k|                                                                      src_strd,
 1092|   124k|                                                                      pu1_src_left_luma,
 1093|   124k|                                                                      pu1_src_top_luma,
 1094|   124k|                                                                      pu1_sao_src_luma_top_left_ctb,
 1095|   124k|                                                                      au1_src_top_right,
 1096|   124k|                                                                      &u1_sao_src_top_left_luma_bot_left,
 1097|   124k|                                                                      au1_avail_luma,
 1098|   124k|                                                                      ai1_offset_y,
 1099|   124k|                                                                      sao_wd_luma,
 1100|   124k|                                                                      sao_ht_luma);
 1101|   124k|                }
 1102|   124k|            }
 1103|       |
 1104|  2.73M|        }
 1105|  4.00M|        else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (1105:17): [True: 2.14M, False: 1.86M]
  |  Branch (1105:64): [True: 16.5k, False: 1.84M]
  ------------------
 1106|  2.16M|        {
 1107|       |            /* Update left, top and top-left */
 1108|  19.4M|            for(row = 0; row < sao_ht_luma; row++)
  ------------------
  |  Branch (1108:26): [True: 17.3M, False: 2.16M]
  ------------------
 1109|  17.3M|            {
 1110|  17.3M|                pu1_src_left_luma[row] = pu1_src_luma[row * src_strd + (sao_wd_luma - 1)];
 1111|  17.3M|            }
 1112|  2.16M|            pu1_sao_src_luma_top_left_ctb[0] = pu1_src_top_luma[sao_wd_luma - 1];
 1113|       |
 1114|  2.16M|            ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_luma, &pu1_src_luma[(sao_ht_luma - 1) * src_strd], sao_wd_luma);
 1115|  2.16M|        }
 1116|       |
 1117|  6.74M|        if(ps_slice_hdr_top_left->i1_slice_sao_chroma_flag)
  ------------------
  |  Branch (1117:12): [True: 2.81M, False: 3.93M]
  ------------------
 1118|  2.81M|        {
 1119|  2.81M|            if(0 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (1119:16): [True: 2.56M, False: 247k]
  ------------------
 1120|  2.56M|            {
 1121|  23.0M|                for(row = 0; row < sao_ht_chroma; row++)
  ------------------
  |  Branch (1121:30): [True: 20.5M, False: 2.56M]
  ------------------
 1122|  20.5M|                {
 1123|  20.5M|                    pu1_src_left_chroma[2 * row] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 2)];
 1124|  20.5M|                    pu1_src_left_chroma[2 * row + 1] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 1)];
 1125|  20.5M|                }
 1126|  2.56M|                pu1_sao_src_chroma_top_left_ctb[0] = pu1_src_top_chroma[sao_wd_chroma - 2];
 1127|  2.56M|                pu1_sao_src_chroma_top_left_ctb[1] = pu1_src_top_chroma[sao_wd_chroma - 1];
 1128|       |
 1129|  2.56M|                ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_chroma, &pu1_src_chroma[(sao_ht_chroma - 1) * src_strd], sao_wd_chroma);
 1130|       |
 1131|  2.56M|            }
 1132|       |
 1133|   247k|            else if(1 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (1133:21): [True: 132k, False: 115k]
  ------------------
 1134|   132k|            {
 1135|   132k|                ai1_offset_cb[1] = ps_sao->b4_cb_offset_1;
 1136|   132k|                ai1_offset_cb[2] = ps_sao->b4_cb_offset_2;
 1137|   132k|                ai1_offset_cb[3] = ps_sao->b4_cb_offset_3;
 1138|   132k|                ai1_offset_cb[4] = ps_sao->b4_cb_offset_4;
 1139|       |
 1140|   132k|                ai1_offset_cr[1] = ps_sao->b4_cr_offset_1;
 1141|   132k|                ai1_offset_cr[2] = ps_sao->b4_cr_offset_2;
 1142|   132k|                ai1_offset_cr[3] = ps_sao->b4_cr_offset_3;
 1143|   132k|                ai1_offset_cr[4] = ps_sao->b4_cr_offset_4;
 1144|       |
 1145|   132k|                if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (1145:20): [True: 56.1k, False: 76.3k]
  ------------------
 1146|  56.1k|                {
 1147|  56.1k|                    ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(pu1_src_chroma,
 1148|  56.1k|                                                                                src_strd,
 1149|  56.1k|                                                                                pu1_src_left_chroma,
 1150|  56.1k|                                                                                pu1_src_top_chroma,
 1151|  56.1k|                                                                                pu1_sao_src_chroma_top_left_ctb,
 1152|  56.1k|                                                                                ps_sao->b5_cr_band_pos,
 1153|  56.1k|                                                                                ps_sao->b5_cb_band_pos,
 1154|  56.1k|                                                                                ai1_offset_cr,
 1155|  56.1k|                                                                                ai1_offset_cb,
 1156|  56.1k|                                                                                sao_wd_chroma,
 1157|  56.1k|                                                                                sao_ht_chroma
 1158|  56.1k|                                                                               );
 1159|  56.1k|                }
 1160|  76.3k|                else
 1161|  76.3k|                {
 1162|  76.3k|                    ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(pu1_src_chroma,
 1163|  76.3k|                                                                                src_strd,
 1164|  76.3k|                                                                                pu1_src_left_chroma,
 1165|  76.3k|                                                                                pu1_src_top_chroma,
 1166|  76.3k|                                                                                pu1_sao_src_chroma_top_left_ctb,
 1167|  76.3k|                                                                                ps_sao->b5_cb_band_pos,
 1168|  76.3k|                                                                                ps_sao->b5_cr_band_pos,
 1169|  76.3k|                                                                                ai1_offset_cb,
 1170|  76.3k|                                                                                ai1_offset_cr,
 1171|  76.3k|                                                                                sao_wd_chroma,
 1172|  76.3k|                                                                                sao_ht_chroma
 1173|  76.3k|                                                                               );
 1174|  76.3k|                }
 1175|   132k|            }
 1176|       |
 1177|   115k|            else // if(2 <= ps_sao->b3_cb_type_idx)
 1178|   115k|            {
 1179|   115k|                ai1_offset_cb[1] = ps_sao->b4_cb_offset_1;
 1180|   115k|                ai1_offset_cb[2] = ps_sao->b4_cb_offset_2;
 1181|   115k|                ai1_offset_cb[3] = ps_sao->b4_cb_offset_3;
 1182|   115k|                ai1_offset_cb[4] = ps_sao->b4_cb_offset_4;
 1183|       |
 1184|   115k|                ai1_offset_cr[1] = ps_sao->b4_cr_offset_1;
 1185|   115k|                ai1_offset_cr[2] = ps_sao->b4_cr_offset_2;
 1186|   115k|                ai1_offset_cr[3] = ps_sao->b4_cr_offset_3;
 1187|   115k|                ai1_offset_cr[4] = ps_sao->b4_cr_offset_4;
 1188|  1.03M|                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1188:28): [True: 924k, False: 115k]
  ------------------
 1189|   924k|                {
 1190|   924k|                    au1_avail_chroma[i] = 255;
 1191|   924k|                    au1_tile_slice_boundary[i] = 0;
 1192|   924k|                    au4_idx_tl[i] = 0;
 1193|   924k|                    au4_ilf_across_tile_slice_enable[i] = 1;
 1194|   924k|                }
 1195|       |                /*In case of slices*/
 1196|   115k|                {
 1197|   115k|                    if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (1197:24): [True: 206, False: 114k]
  |  Branch (1197:71): [True: 1.13k, False: 113k]
  ------------------
 1198|  1.74k|                    {
 1199|  1.74k|                        if((0 == (1 << log2_ctb_size) - sao_wd_chroma) && (ps_sao_ctxt->i4_ctb_y > 1) && (ps_sao_ctxt->i4_ctb_x > 1))
  ------------------
  |  Branch (1199:28): [True: 97, False: 1.64k]
  |  Branch (1199:75): [True: 91, False: 6]
  |  Branch (1199:106): [True: 60, False: 31]
  ------------------
 1200|     60|                        {
 1201|     60|                            ctby_tl_t = ps_sao_ctxt->i4_ctb_y - 2;
 1202|     60|                            ctbx_tl_l = ps_sao_ctxt->i4_ctb_x - 2;
 1203|     60|                        }
 1204|  1.68k|                        else if(!(0 == (1 << log2_ctb_size) - sao_wd_chroma))
  ------------------
  |  Branch (1204:33): [True: 1.64k, False: 37]
  ------------------
 1205|  1.64k|                        {
 1206|  1.64k|                            ctby_tl_t = ps_sao_ctxt->i4_ctb_y - 1;
 1207|  1.64k|                            ctbx_tl_l = ps_sao_ctxt->i4_ctb_x - 1;
 1208|  1.64k|                        }
 1209|  1.74k|                        ctbx_tl_t = ps_sao_ctxt->i4_ctb_x - 1;
 1210|  1.74k|                        ctby_tl_l = ps_sao_ctxt->i4_ctb_y - 1;
 1211|       |
 1212|  1.74k|                        ctbx_tl_r = ps_sao_ctxt->i4_ctb_x;
 1213|  1.74k|                        ctby_tl_r = ps_sao_ctxt->i4_ctb_y - 1;
 1214|       |
 1215|  1.74k|                        ctbx_tl_d =  ps_sao_ctxt->i4_ctb_x - 1;
 1216|  1.74k|                        ctby_tl_d =  ps_sao_ctxt->i4_ctb_y;
 1217|       |
 1218|  1.74k|                        ctbx_tl = ps_sao_ctxt->i4_ctb_x - 1;
 1219|  1.74k|                        ctby_tl = ps_sao_ctxt->i4_ctb_y - 1;
 1220|       |
 1221|  1.74k|                        if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (1221:28): [True: 610, False: 1.13k]
  ------------------
 1222|    610|                        {
 1223|       |
 1224|    610|                            idx_tl   = pu1_slice_idx[ctbx_tl + (ctby_tl * ps_sps->i2_pic_wd_in_ctb)];
 1225|    610|                            au4_idx_tl[2] = au4_idx_tl[4] = *(pu1_slice_idx + ctbx_tl_t + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb));
 1226|    610|                            au4_idx_tl[0] =  pu1_slice_idx[ctbx_tl_l + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
 1227|    610|                            au4_idx_tl[1] = au4_idx_tl[5] = pu1_slice_idx[ctbx_tl_r + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
 1228|    610|                            au4_idx_tl[3] = au4_idx_tl[6] =   pu1_slice_idx[ctbx_tl_d + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
 1229|    610|                            au4_idx_tl[7] = pu1_slice_idx[ctbx_tl_d + 1 + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
 1230|       |
 1231|    610|                            if((0 == (1 << log2_ctb_size) - sao_wd_chroma))
  ------------------
  |  Branch (1231:32): [True: 4, False: 606]
  ------------------
 1232|      4|                            {
 1233|      4|                                if(ps_sao_ctxt->i4_ctb_x == 1)
  ------------------
  |  Branch (1233:36): [True: 2, False: 2]
  ------------------
 1234|      2|                                {
 1235|      2|                                    au4_idx_tl[6] = -1;
 1236|      2|                                    au4_idx_tl[4] = -1;
 1237|      2|                                }
 1238|      2|                                else
 1239|      2|                                {
 1240|      2|                                    au4_idx_tl[6] = pu1_slice_idx[(ctbx_tl_d - 1) + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
 1241|      2|                                }
 1242|      4|                                if(ps_sao_ctxt->i4_ctb_y == 1)
  ------------------
  |  Branch (1242:36): [True: 0, False: 4]
  ------------------
 1243|      0|                                {
 1244|      0|                                    au4_idx_tl[5] = -1;
 1245|      0|                                    au4_idx_tl[4] = -1;
 1246|      0|                                }
 1247|      4|                                else
 1248|      4|                                {
 1249|      4|                                    au4_idx_tl[5] = pu1_slice_idx[(ctbx_tl_l + 1) + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
 1250|      4|                                    au4_idx_tl[4] = pu1_slice_idx[(ctbx_tl_t - 1) + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb)];
 1251|      4|                                }
 1252|      4|                                au4_idx_tl[7] = pu1_slice_idx[(ctbx_tl_d + 1) + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
 1253|      4|                            }
 1254|       |
 1255|       |                            /* Verify that the neighbor ctbs don't cross pic boundary
 1256|       |                             * Also, the ILF flag belonging to the higher pixel address (between neighbor and current pixels) must be assigned*/
 1257|    610|                            if((0 == (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_chroma))
  ------------------
  |  Branch (1257:32): [True: 2, False: 608]
  ------------------
 1258|      2|                            {
 1259|      2|                                au4_ilf_across_tile_slice_enable[4] = 0;
 1260|      2|                                au4_ilf_across_tile_slice_enable[6] = 0;
 1261|      2|                            }
 1262|    608|                            else
 1263|    608|                            {
 1264|    608|                                au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + au4_idx_tl[6])->i1_slice_loop_filter_across_slices_enabled_flag;
 1265|    608|                            }
 1266|    610|                            if((0 == (ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 1)) - sao_ht_chroma))
  ------------------
  |  Branch (1266:32): [True: 0, False: 610]
  ------------------
 1267|      0|                            {
 1268|      0|                                au4_ilf_across_tile_slice_enable[5] = 0;
 1269|      0|                                au4_ilf_across_tile_slice_enable[4] = 0;
 1270|      0|                            }
 1271|    610|                            else
 1272|    610|                            {
 1273|    610|                                au4_ilf_across_tile_slice_enable[4] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
 1274|    610|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + au4_idx_tl[5])->i1_slice_loop_filter_across_slices_enabled_flag;
 1275|    610|                            }
 1276|    610|                            au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
 1277|    610|                            au4_ilf_across_tile_slice_enable[0] = (ps_slice_hdr_base + idx_tl)->i1_slice_loop_filter_across_slices_enabled_flag;
 1278|    610|                            au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_tl[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 1279|    610|                            au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_tl[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 1280|    610|                            au4_ilf_across_tile_slice_enable[7] = (ps_slice_hdr_base + au4_idx_tl[7])->i1_slice_loop_filter_across_slices_enabled_flag;
 1281|       |                            /*
 1282|       |                             * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
 1283|       |                             * of the pixel having a greater address is checked. Accordingly, set the availability flags
 1284|       |                             */
 1285|  5.49k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1285:40): [True: 4.88k, False: 610]
  ------------------
 1286|  4.88k|                            {
 1287|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 1288|  4.88k|                                if(au4_idx_tl[i] != idx_tl)
  ------------------
  |  Branch (1288:36): [True: 1.41k, False: 3.46k]
  ------------------
 1289|  1.41k|                                {
 1290|  1.41k|                                    au1_tile_slice_boundary[i] = 1;
 1291|  1.41k|                                }
 1292|  3.46k|                                else
 1293|  3.46k|                                {
 1294|  3.46k|                                    au4_ilf_across_tile_slice_enable[i] = 1;
 1295|  3.46k|                                }
 1296|  4.88k|                            }
 1297|       |
 1298|       |                            /*Reset indices*/
 1299|  5.49k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1299:40): [True: 4.88k, False: 610]
  ------------------
 1300|  4.88k|                            {
 1301|  4.88k|                                au4_idx_tl[i] = 0;
 1302|  4.88k|                            }
 1303|    610|                        }
 1304|  1.74k|                        if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (1304:28): [True: 1.53k, False: 214]
  ------------------
 1305|  1.53k|                        {
 1306|       |                            /* Calculate availability flags at slice boundary */
 1307|  1.53k|                            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 (1307:33): [True: 844, False: 688]
  |  Branch (1307:81): [True: 279, False: 409]
  |  Branch (1307:133): [True: 273, False: 850]
  |  Branch (1307:161): [True: 0, False: 273]
  ------------------
 1308|  1.12k|                            {
 1309|       |                                /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 1310|  1.12k|                                if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (1310:36): [True: 710, False: 413]
  ------------------
 1311|    710|                                {
 1312|       |                                    /*Set the boundary arrays*/
 1313|       |                                    /*Calculate tile indices for neighbor pixels*/
 1314|    710|                                    idx_tl   = pu1_tile_idx[ctbx_tl + (ctby_tl * ps_sps->i2_pic_wd_in_ctb)];
 1315|    710|                                    au4_idx_tl[2] = au4_idx_tl[4] = *(pu1_tile_idx + ctbx_tl_t + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb));
 1316|    710|                                    au4_idx_tl[0] =  pu1_tile_idx[ctbx_tl_l + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
 1317|    710|                                    au4_idx_tl[1] = au4_idx_tl[5] = pu1_tile_idx[ctbx_tl_r + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
 1318|    710|                                    au4_idx_tl[3] = au4_idx_tl[6] =   pu1_tile_idx[ctbx_tl_d + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
 1319|    710|                                    au4_idx_tl[7] = pu1_tile_idx[ctbx_tl_d + 1 + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
 1320|       |
 1321|    710|                                    if((0 == (1 << log2_ctb_size) - sao_wd_luma))
  ------------------
  |  Branch (1321:40): [True: 0, False: 710]
  ------------------
 1322|      0|                                    {
 1323|      0|                                        if(ps_sao_ctxt->i4_ctb_x == 1)
  ------------------
  |  Branch (1323:44): [True: 0, False: 0]
  ------------------
 1324|      0|                                        {
 1325|      0|                                            au4_idx_tl[6] = -1;
 1326|      0|                                            au4_idx_tl[4] = -1;
 1327|      0|                                        }
 1328|      0|                                        else
 1329|      0|                                        {
 1330|      0|                                            au4_idx_tl[6] = pu1_tile_idx[(ctbx_tl_d - 1) + (ctby_tl_r * ps_sps->i2_pic_wd_in_ctb)];
 1331|      0|                                        }
 1332|      0|                                        if(ps_sao_ctxt->i4_ctb_y == 1)
  ------------------
  |  Branch (1332:44): [True: 0, False: 0]
  ------------------
 1333|      0|                                        {
 1334|      0|                                            au4_idx_tl[5] = -1;
 1335|      0|                                            au4_idx_tl[4] = -1;
 1336|      0|                                        }
 1337|      0|                                        else
 1338|      0|                                        {
 1339|      0|                                            au4_idx_tl[5] = pu1_tile_idx[(ctbx_tl_l + 1) + (ctby_tl_l * ps_sps->i2_pic_wd_in_ctb)];
 1340|      0|                                            au4_idx_tl[4] = pu1_tile_idx[(ctbx_tl_t - 1) + (ctby_tl_t * ps_sps->i2_pic_wd_in_ctb)];
 1341|      0|                                        }
 1342|      0|                                        au4_idx_tl[7] = pu1_tile_idx[(ctbx_tl_d + 1) + (ctby_tl_d * ps_sps->i2_pic_wd_in_ctb)];
 1343|      0|                                    }
 1344|  6.39k|                                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1344:48): [True: 5.68k, False: 710]
  ------------------
 1345|  5.68k|                                    {
 1346|       |                                        /*Sets the edges that lie on the tile boundary*/
 1347|  5.68k|                                        if(au4_idx_tl[i] != idx_tl)
  ------------------
  |  Branch (1347:44): [True: 2.13k, False: 3.54k]
  ------------------
 1348|  2.13k|                                        {
 1349|  2.13k|                                            au1_tile_slice_boundary[i] |= 1;
 1350|  2.13k|                                            au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag; //=0
 1351|  2.13k|                                        }
 1352|  5.68k|                                    }
 1353|    710|                                }
 1354|  1.12k|                            }
 1355|  1.53k|                        }
 1356|       |
 1357|  15.7k|                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1357:36): [True: 13.9k, False: 1.74k]
  ------------------
 1358|  13.9k|                        {
 1359|       |                            /*Sets the edges that lie on the slice/tile boundary*/
 1360|  13.9k|                            if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (1360:32): [True: 3.54k, False: 10.4k]
  |  Branch (1360:64): [True: 2.14k, False: 1.40k]
  ------------------
 1361|  2.14k|                            {
 1362|  2.14k|                                au1_avail_chroma[i] = 0;
 1363|  2.14k|                            }
 1364|  13.9k|                        }
 1365|  1.74k|                    }
 1366|   115k|                }
 1367|       |
 1368|   115k|                if(0 == (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_chroma)
  ------------------
  |  Branch (1368:20): [True: 34, False: 115k]
  ------------------
 1369|     34|                {
 1370|     34|                    au1_avail_chroma[0] = 0;
 1371|     34|                    au1_avail_chroma[4] = 0;
 1372|     34|                    au1_avail_chroma[6] = 0;
 1373|     34|                }
 1374|   115k|                if(ps_sps->i2_pic_wd_in_ctb == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1374:20): [True: 0, False: 115k]
  ------------------
 1375|      0|                {
 1376|      0|                    au1_avail_chroma[1] = 0;
 1377|      0|                    au1_avail_chroma[5] = 0;
 1378|      0|                    au1_avail_chroma[7] = 0;
 1379|      0|                }
 1380|       |
 1381|   115k|                if(0 == (ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 1)) - sao_ht_chroma)
  ------------------
  |  Branch (1381:20): [True: 80, False: 115k]
  ------------------
 1382|     80|                {
 1383|     80|                    au1_avail_chroma[2] = 0;
 1384|     80|                    au1_avail_chroma[4] = 0;
 1385|     80|                    au1_avail_chroma[5] = 0;
 1386|     80|                }
 1387|   115k|                if(ps_sps->i2_pic_ht_in_ctb == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (1387:20): [True: 0, False: 115k]
  ------------------
 1388|      0|                {
 1389|      0|                    au1_avail_chroma[3] = 0;
 1390|      0|                    au1_avail_chroma[6] = 0;
 1391|      0|                    au1_avail_chroma[7] = 0;
 1392|      0|                }
 1393|       |
 1394|   115k|                {
 1395|   115k|                    au1_src_top_right[0] = pu1_src_top_chroma[sao_wd_chroma];
 1396|   115k|                    au1_src_top_right[1] = pu1_src_top_chroma[sao_wd_chroma + 1];
 1397|   115k|                    au1_sao_src_top_left_chroma_bot_left[0] = pu1_src_left_chroma[2 * sao_ht_chroma];
 1398|   115k|                    au1_sao_src_top_left_chroma_bot_left[1] = pu1_src_left_chroma[2 * sao_ht_chroma + 1];
 1399|   115k|                    if((ctb_size == 16) && (ps_sao_ctxt->i4_ctb_y != ps_sps->i2_pic_ht_in_ctb - 1))
  ------------------
  |  Branch (1399:24): [True: 179, False: 114k]
  |  Branch (1399:44): [True: 105, False: 74]
  ------------------
 1400|    105|                    {
 1401|    105|                        au1_sao_src_top_left_chroma_bot_left[0] = pu1_src_chroma[sao_ht_chroma * src_strd - 2];
 1402|    105|                        au1_sao_src_top_left_chroma_bot_left[1] = pu1_src_chroma[sao_ht_chroma * src_strd - 1];
 1403|    105|                    }
 1404|       |
 1405|   115k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (1405:24): [True: 47.7k, False: 67.4k]
  ------------------
 1406|  47.7k|                    {
 1407|  47.7k|                        ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 1408|  47.7k|                                                                             src_strd,
 1409|  47.7k|                                                                             pu1_src_left_chroma,
 1410|  47.7k|                                                                             pu1_src_top_chroma,
 1411|  47.7k|                                                                             pu1_sao_src_chroma_top_left_ctb,
 1412|  47.7k|                                                                             au1_src_top_right,
 1413|  47.7k|                                                                             au1_sao_src_top_left_chroma_bot_left,
 1414|  47.7k|                                                                             au1_avail_chroma,
 1415|  47.7k|                                                                             ai1_offset_cr,
 1416|  47.7k|                                                                             ai1_offset_cb,
 1417|  47.7k|                                                                             sao_wd_chroma,
 1418|  47.7k|                                                                             sao_ht_chroma);
 1419|  47.7k|                    }
 1420|  67.4k|                    else
 1421|  67.4k|                    {
 1422|  67.4k|                        ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 1423|  67.4k|                                                                             src_strd,
 1424|  67.4k|                                                                             pu1_src_left_chroma,
 1425|  67.4k|                                                                             pu1_src_top_chroma,
 1426|  67.4k|                                                                             pu1_sao_src_chroma_top_left_ctb,
 1427|  67.4k|                                                                             au1_src_top_right,
 1428|  67.4k|                                                                             au1_sao_src_top_left_chroma_bot_left,
 1429|  67.4k|                                                                             au1_avail_chroma,
 1430|  67.4k|                                                                             ai1_offset_cb,
 1431|  67.4k|                                                                             ai1_offset_cr,
 1432|  67.4k|                                                                             sao_wd_chroma,
 1433|  67.4k|                                                                             sao_ht_chroma);
 1434|  67.4k|                    }
 1435|   115k|                }
 1436|   115k|            }
 1437|  2.81M|        }
 1438|  3.93M|        else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (1438:17): [True: 2.07M, False: 1.85M]
  |  Branch (1438:64): [True: 16.7k, False: 1.84M]
  ------------------
 1439|  2.09M|        {
 1440|  18.8M|            for(row = 0; row < sao_ht_chroma; row++)
  ------------------
  |  Branch (1440:26): [True: 16.7M, False: 2.09M]
  ------------------
 1441|  16.7M|            {
 1442|  16.7M|                pu1_src_left_chroma[2 * row] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 2)];
 1443|  16.7M|                pu1_src_left_chroma[2 * row + 1] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 1)];
 1444|  16.7M|            }
 1445|  2.09M|            pu1_sao_src_chroma_top_left_ctb[0] = pu1_src_top_chroma[sao_wd_chroma - 2];
 1446|  2.09M|            pu1_sao_src_chroma_top_left_ctb[1] = pu1_src_top_chroma[sao_wd_chroma - 1];
 1447|       |
 1448|  2.09M|            ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_chroma, &pu1_src_chroma[(sao_ht_chroma - 1) * src_strd], sao_wd_chroma);
 1449|  2.09M|        }
 1450|       |
 1451|  6.74M|        pu1_src_luma += sao_wd_luma + sao_ht_luma * src_strd;
 1452|  6.74M|        pu1_src_chroma += sao_wd_chroma + sao_ht_chroma * src_strd;
 1453|  6.74M|        ps_sao += (1 + ps_sps->i2_pic_wd_in_ctb);
 1454|  6.74M|    }
 1455|       |
 1456|       |
 1457|       |    /* Top CTB */
 1458|  7.49M|    if((ps_sao_ctxt->i4_ctb_y > 0))
  ------------------
  |  Branch (1458:8): [True: 7.20M, False: 284k]
  ------------------
 1459|  7.20M|    {
 1460|  7.20M|        WORD32 sao_wd_luma = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  7.20M|#define SAO_SHIFT_CTB    8
  ------------------
 1461|  7.20M|        WORD32 sao_wd_chroma = ctb_size - 2 * SAO_SHIFT_CTB;
  ------------------
  |  |   78|  7.20M|#define SAO_SHIFT_CTB    8
  ------------------
 1462|  7.20M|        WORD32 sao_ht_luma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  7.20M|#define SAO_SHIFT_CTB    8
  ------------------
 1463|  7.20M|        WORD32 sao_ht_chroma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  7.20M|#define SAO_SHIFT_CTB    8
  ------------------
 1464|       |
 1465|  7.20M|        WORD32 ctbx_t_t = 0, ctbx_t_l = 0, ctbx_t_r = 0, ctbx_t_d = 0, ctbx_t = 0;
 1466|  7.20M|        WORD32 ctby_t_t = 0, ctby_t_l = 0, ctby_t_r = 0, ctby_t_d = 0, ctby_t = 0;
 1467|  7.20M|        WORD32 au4_idx_t[8], idx_t;
 1468|       |
 1469|  7.20M|        WORD32 remaining_cols;
 1470|       |
 1471|  7.20M|        slice_header_t *ps_slice_hdr_top;
 1472|  7.20M|        {
 1473|  7.20M|            WORD32 top_ctb_indx = (ps_sao_ctxt->i4_ctb_y - 1) * ps_sps->i2_pic_wd_in_ctb +
 1474|  7.20M|                                        (ps_sao_ctxt->i4_ctb_x);
 1475|  7.20M|            ps_slice_hdr_top = ps_slice_hdr_base + pu1_slice_idx[top_ctb_indx];
 1476|  7.20M|        }
 1477|       |
 1478|  7.20M|        remaining_cols = ps_sps->i2_pic_width_in_luma_samples - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) + sao_wd_luma);
 1479|  7.20M|        if(remaining_cols <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  7.20M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (1479:12): [True: 464k, False: 6.74M]
  ------------------
 1480|   464k|        {
 1481|   464k|            sao_wd_luma += remaining_cols;
 1482|   464k|        }
 1483|  7.20M|        remaining_cols = ps_sps->i2_pic_width_in_luma_samples - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) + sao_wd_chroma);
 1484|  7.20M|        if(remaining_cols <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|  7.20M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (1484:12): [True: 464k, False: 6.74M]
  ------------------
 1485|   464k|        {
 1486|   464k|            sao_wd_chroma += remaining_cols;
 1487|   464k|        }
 1488|       |
 1489|  7.20M|        pu1_src_luma -= (sao_ht_luma * src_strd);
 1490|  7.20M|        pu1_src_chroma -= (sao_ht_chroma * src_strd);
 1491|  7.20M|        ps_sao -= (ps_sps->i2_pic_wd_in_ctb);
 1492|  7.20M|        pu1_src_top_luma = ps_sao_ctxt->pu1_sao_src_top_luma + (ps_sao_ctxt->i4_ctb_x << log2_ctb_size);
 1493|  7.20M|        pu1_src_top_chroma = ps_sao_ctxt->pu1_sao_src_top_chroma + (ps_sao_ctxt->i4_ctb_x << log2_ctb_size);
 1494|  7.20M|        pu1_src_left_luma = ps_sao_ctxt->pu1_sao_src_left_luma + (ps_sao_ctxt->i4_ctb_y << log2_ctb_size) - sao_ht_chroma;
 1495|  7.20M|        pu1_src_left_chroma = ps_sao_ctxt->pu1_sao_src_left_chroma + (ps_sao_ctxt->i4_ctb_y << log2_ctb_size) - (2 * sao_ht_chroma);
 1496|       |
 1497|  7.20M|        if(0 != sao_wd_luma)
  ------------------
  |  Branch (1497:12): [True: 7.20M, False: 18.4E]
  ------------------
 1498|  7.20M|        {
 1499|  7.20M|            if(ps_slice_hdr_top->i1_slice_sao_luma_flag)
  ------------------
  |  Branch (1499:16): [True: 2.82M, False: 4.38M]
  ------------------
 1500|  2.82M|            {
 1501|  2.82M|                if(0 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (1501:20): [True: 2.55M, False: 265k]
  ------------------
 1502|  2.55M|                {
 1503|       |                    /* Update left, top and top-left */
 1504|  23.0M|                    for(row = 0; row < sao_ht_luma; row++)
  ------------------
  |  Branch (1504:34): [True: 20.4M, False: 2.55M]
  ------------------
 1505|  20.4M|                    {
 1506|  20.4M|                        pu1_src_left_luma[row] = pu1_src_luma[row * src_strd + (sao_wd_luma - 1)];
 1507|  20.4M|                    }
 1508|  2.55M|                    pu1_sao_src_luma_top_left_ctb[0] = pu1_src_top_luma[sao_wd_luma - 1];
 1509|       |
 1510|  2.55M|                    ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_luma, &pu1_src_luma[(sao_ht_luma - 1) * src_strd], sao_wd_luma);
 1511|       |
 1512|  2.55M|                }
 1513|       |
 1514|   265k|                else if(1 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (1514:25): [True: 132k, False: 133k]
  ------------------
 1515|   132k|                {
 1516|   132k|                    ai1_offset_y[1] = ps_sao->b4_y_offset_1;
 1517|   132k|                    ai1_offset_y[2] = ps_sao->b4_y_offset_2;
 1518|   132k|                    ai1_offset_y[3] = ps_sao->b4_y_offset_3;
 1519|   132k|                    ai1_offset_y[4] = ps_sao->b4_y_offset_4;
 1520|       |
 1521|   132k|                    ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr(pu1_src_luma,
 1522|   132k|                                                                              src_strd,
 1523|   132k|                                                                              pu1_src_left_luma,
 1524|   132k|                                                                              pu1_src_top_luma,
 1525|   132k|                                                                              pu1_sao_src_luma_top_left_ctb,
 1526|   132k|                                                                              ps_sao->b5_y_band_pos,
 1527|   132k|                                                                              ai1_offset_y,
 1528|   132k|                                                                              sao_wd_luma,
 1529|   132k|                                                                              sao_ht_luma
 1530|   132k|                                                                             );
 1531|   132k|                }
 1532|       |
 1533|   133k|                else // if(2 <= ps_sao->b3_y_type_idx)
 1534|   133k|                {
 1535|   133k|                    ai1_offset_y[1] = ps_sao->b4_y_offset_1;
 1536|   133k|                    ai1_offset_y[2] = ps_sao->b4_y_offset_2;
 1537|   133k|                    ai1_offset_y[3] = ps_sao->b4_y_offset_3;
 1538|   133k|                    ai1_offset_y[4] = ps_sao->b4_y_offset_4;
 1539|       |
 1540|   133k|                    ps_codec->s_func_selector.ihevc_memset_mul_8_fptr(au1_avail_luma, 255, 8);
 1541|   133k|                    ps_codec->s_func_selector.ihevc_memset_mul_8_fptr(au1_tile_slice_boundary, 0, 8);
 1542|   133k|                    ps_codec->s_func_selector.ihevc_memset_mul_8_fptr((UWORD8 *)au4_idx_t, 0, 8 * sizeof(WORD32));
 1543|       |
 1544|  1.20M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1544:32): [True: 1.07M, False: 133k]
  ------------------
 1545|  1.07M|                    {
 1546|       |
 1547|  1.07M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 1548|  1.07M|                    }
 1549|       |                    /******************************************************************
 1550|       |                     * Derive the  Top-left CTB's neighbor pixel's slice indices.
 1551|       |                     *
 1552|       |                     *               T_T
 1553|       |                     *          ____________
 1554|       |                     *         |    |       |
 1555|       |                     *         | T_L|  T    |T_R
 1556|       |                     *         |    | ______|____
 1557|       |                     *         |    |  T_D  |    |
 1558|       |                     *         |    |       |    |
 1559|       |                     *         |____|_______|    |
 1560|       |                     *              |            |
 1561|       |                     *              |            |
 1562|       |                     *              |____________|
 1563|       |                     *
 1564|       |                     *****************************************************************/
 1565|       |
 1566|       |                    /*In case of slices*/
 1567|   133k|                    {
 1568|   133k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (1568:28): [True: 18.4E, False: 133k]
  |  Branch (1568:75): [True: 2.34k, False: 131k]
  ------------------
 1569|  2.59k|                        {
 1570|       |
 1571|  2.59k|                            ctbx_t_t = ps_sao_ctxt->i4_ctb_x;
 1572|  2.59k|                            ctby_t_t = ps_sao_ctxt->i4_ctb_y - 1;
 1573|       |
 1574|  2.59k|                            ctbx_t_l = ps_sao_ctxt->i4_ctb_x - 1;
 1575|  2.59k|                            ctby_t_l = ps_sao_ctxt->i4_ctb_y - 1;
 1576|       |
 1577|  2.59k|                            ctbx_t_r = ps_sao_ctxt->i4_ctb_x;
 1578|  2.59k|                            ctby_t_r = ps_sao_ctxt->i4_ctb_y - 1;
 1579|       |
 1580|  2.59k|                            ctbx_t_d =  ps_sao_ctxt->i4_ctb_x;
 1581|  2.59k|                            ctby_t_d =  ps_sao_ctxt->i4_ctb_y;
 1582|       |
 1583|  2.59k|                            ctbx_t = ps_sao_ctxt->i4_ctb_x;
 1584|  2.59k|                            ctby_t = ps_sao_ctxt->i4_ctb_y - 1;
 1585|       |
 1586|  2.59k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (1586:32): [True: 251, False: 2.34k]
  ------------------
 1587|    251|                            {
 1588|       |                                /*Calculate neighbor ctb slice indices*/
 1589|    251|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1589:36): [True: 83, False: 168]
  ------------------
 1590|     83|                                {
 1591|     83|                                    au4_idx_t[0] = -1;
 1592|     83|                                    au4_idx_t[6] = -1;
 1593|     83|                                    au4_idx_t[4] = -1;
 1594|     83|                                }
 1595|    168|                                else
 1596|    168|                                {
 1597|    168|                                    au4_idx_t[0] = au4_idx_t[4] = pu1_slice_idx[ctbx_t_l + (ctby_t_l * ps_sps->i2_pic_wd_in_ctb)];
 1598|    168|                                    au4_idx_t[6] = pu1_slice_idx[ctbx_t_d - 1 + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1599|    168|                                }
 1600|    251|                                idx_t   = pu1_slice_idx[ctbx_t + (ctby_t * ps_sps->i2_pic_wd_in_ctb)];
 1601|    251|                                au4_idx_t[2] = au4_idx_t[5] = pu1_slice_idx[ctbx_t_t + (ctby_t_t * ps_sps->i2_pic_wd_in_ctb)];
 1602|    251|                                au4_idx_t[1] = pu1_slice_idx[ctbx_t_r + (ctby_t_r * ps_sps->i2_pic_wd_in_ctb)];
 1603|    251|                                au4_idx_t[3] = au4_idx_t[7] = pu1_slice_idx[ctbx_t_d + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1604|       |
 1605|       |                                /*Verify that the neighbor ctbs don't cross pic boundary.*/
 1606|    251|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1606:36): [True: 83, False: 168]
  ------------------
 1607|     83|                                {
 1608|     83|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 1609|     83|                                    au4_ilf_across_tile_slice_enable[6] = 0;
 1610|     83|                                    au4_ilf_across_tile_slice_enable[0] = 0;
 1611|     83|                                }
 1612|    168|                                else
 1613|    168|                                {
 1614|    168|                                    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;
 1615|    168|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + au4_idx_t[6])->i1_slice_loop_filter_across_slices_enabled_flag;
 1616|    168|                                }
 1617|       |
 1618|       |
 1619|       |
 1620|    251|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1621|    251|                                au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1622|    251|                                au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_t[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 1623|    251|                                au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_t[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 1624|    251|                                au4_ilf_across_tile_slice_enable[7] = (ps_slice_hdr_base + au4_idx_t[7])->i1_slice_loop_filter_across_slices_enabled_flag;
 1625|       |
 1626|    251|                                if(au4_idx_t[6] < idx_t)
  ------------------
  |  Branch (1626:36): [True: 83, False: 168]
  ------------------
 1627|     83|                                {
 1628|     83|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1629|     83|                                }
 1630|       |
 1631|       |                                /*
 1632|       |                                 * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
 1633|       |                                 * of the pixel having a greater address is checked. Accordingly, set the availability flags
 1634|       |                                 */
 1635|       |
 1636|  2.25k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1636:44): [True: 2.00k, False: 251]
  ------------------
 1637|  2.00k|                                {
 1638|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 1639|  2.00k|                                    if(au4_idx_t[i] != idx_t)
  ------------------
  |  Branch (1639:40): [True: 695, False: 1.31k]
  ------------------
 1640|    695|                                    {
 1641|    695|                                        au1_tile_slice_boundary[i] = 1;
 1642|       |                                        /*Check for slice flag at such boundaries*/
 1643|    695|                                    }
 1644|  1.31k|                                    else
 1645|  1.31k|                                    {
 1646|  1.31k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 1647|  1.31k|                                    }
 1648|  2.00k|                                }
 1649|       |                                /*Reset indices*/
 1650|  2.25k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1650:44): [True: 2.00k, False: 251]
  ------------------
 1651|  2.00k|                                {
 1652|  2.00k|                                    au4_idx_t[i] = 0;
 1653|  2.00k|                                }
 1654|    251|                            }
 1655|       |
 1656|  2.59k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (1656:32): [True: 2.42k, False: 176]
  ------------------
 1657|  2.42k|                            {
 1658|       |                                /* Calculate availability flags at slice boundary */
 1659|  2.42k|                                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 (1659:37): [True: 651, False: 1.77k]
  |  Branch (1659:85): [True: 1.03k, False: 734]
  |  Branch (1659:137): [True: 1.68k, False: 2]
  |  Branch (1659:165): [True: 392, False: 1.29k]
  ------------------
 1660|  1.29k|                                {
 1661|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 1662|  1.29k|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (1662:40): [True: 1.29k, False: 2]
  ------------------
 1663|  1.29k|                                    {
 1664|       |                                        /*Calculate neighbor ctb slice indices*/
 1665|  1.29k|                                        if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1665:44): [True: 257, False: 1.03k]
  ------------------
 1666|    257|                                        {
 1667|    257|                                            au4_idx_t[0] = -1;
 1668|    257|                                            au4_idx_t[6] = -1;
 1669|    257|                                            au4_idx_t[4] = -1;
 1670|    257|                                        }
 1671|  1.03k|                                        else
 1672|  1.03k|                                        {
 1673|  1.03k|                                            au4_idx_t[0] = au4_idx_t[4] = pu1_tile_idx[ctbx_t_l + (ctby_t_l * ps_sps->i2_pic_wd_in_ctb)];
 1674|  1.03k|                                            au4_idx_t[6] = pu1_tile_idx[ctbx_t_d - 1 + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1675|  1.03k|                                        }
 1676|  1.29k|                                        idx_t   = pu1_tile_idx[ctbx_t + (ctby_t * ps_sps->i2_pic_wd_in_ctb)];
 1677|  1.29k|                                        au4_idx_t[2] = au4_idx_t[5] = pu1_tile_idx[ctbx_t_t + (ctby_t_t * ps_sps->i2_pic_wd_in_ctb)];
 1678|  1.29k|                                        au4_idx_t[1] = pu1_tile_idx[ctbx_t_r + (ctby_t_r * ps_sps->i2_pic_wd_in_ctb)];
 1679|  1.29k|                                        au4_idx_t[3] = au4_idx_t[7] = pu1_tile_idx[ctbx_t_d + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1680|       |
 1681|  11.6k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1681:52): [True: 10.3k, False: 1.29k]
  ------------------
 1682|  10.3k|                                        {
 1683|       |                                            /*Sets the edges that lie on the tile boundary*/
 1684|  10.3k|                                            if(au4_idx_t[i] != idx_t)
  ------------------
  |  Branch (1684:48): [True: 4.20k, False: 6.15k]
  ------------------
 1685|  4.20k|                                            {
 1686|  4.20k|                                                au1_tile_slice_boundary[i] |= 1;
 1687|  4.20k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag;
 1688|  4.20k|                                            }
 1689|  10.3k|                                        }
 1690|  1.29k|                                    }
 1691|  1.29k|                                }
 1692|  2.42k|                            }
 1693|       |
 1694|  23.3k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1694:40): [True: 20.7k, False: 2.59k]
  ------------------
 1695|  20.7k|                            {
 1696|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 1697|  20.7k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (1697:36): [True: 4.90k, False: 15.8k]
  |  Branch (1697:68): [True: 4.37k, False: 523]
  ------------------
 1698|  4.37k|                                {
 1699|  4.37k|                                    au1_avail_luma[i] = 0;
 1700|  4.37k|                                }
 1701|  20.7k|                            }
 1702|  2.59k|                        }
 1703|   133k|                    }
 1704|       |
 1705|       |
 1706|   133k|                    if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1706:24): [True: 9.20k, False: 124k]
  ------------------
 1707|  9.20k|                    {
 1708|  9.20k|                        au1_avail_luma[0] = 0;
 1709|  9.20k|                        au1_avail_luma[4] = 0;
 1710|  9.20k|                        au1_avail_luma[6] = 0;
 1711|  9.20k|                    }
 1712|       |
 1713|   133k|                    if(ps_sps->i2_pic_width_in_luma_samples - (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) <= sao_wd_luma)
  ------------------
  |  Branch (1713:24): [True: 9.21k, False: 124k]
  ------------------
 1714|  9.21k|                    {
 1715|  9.21k|                        au1_avail_luma[1] = 0;
 1716|  9.21k|                        au1_avail_luma[5] = 0;
 1717|  9.21k|                        au1_avail_luma[7] = 0;
 1718|  9.21k|                    }
 1719|       |
 1720|   133k|                    if(0 == (ps_sao_ctxt->i4_ctb_y << log2_ctb_size) - sao_ht_luma)
  ------------------
  |  Branch (1720:24): [True: 0, False: 133k]
  ------------------
 1721|      0|                    {
 1722|      0|                        au1_avail_luma[2] = 0;
 1723|      0|                        au1_avail_luma[4] = 0;
 1724|      0|                        au1_avail_luma[5] = 0;
 1725|      0|                    }
 1726|       |
 1727|   133k|                    if(ps_sps->i2_pic_ht_in_ctb == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (1727:24): [True: 0, False: 133k]
  ------------------
 1728|      0|                    {
 1729|      0|                        au1_avail_luma[3] = 0;
 1730|      0|                        au1_avail_luma[6] = 0;
 1731|      0|                        au1_avail_luma[7] = 0;
 1732|      0|                    }
 1733|       |
 1734|   133k|                    {
 1735|   133k|                        au1_src_top_right[0] = pu1_sao_src_top_left_luma_top_right[0];
 1736|   133k|                        u1_sao_src_top_left_luma_bot_left = pu1_src_luma[sao_ht_luma * src_strd - 1];
 1737|   133k|                        ps_codec->apf_sao_luma[ps_sao->b3_y_type_idx - 2](pu1_src_luma,
 1738|   133k|                                                                          src_strd,
 1739|   133k|                                                                          pu1_src_left_luma,
 1740|   133k|                                                                          pu1_src_top_luma,
 1741|   133k|                                                                          pu1_sao_src_luma_top_left_ctb,
 1742|   133k|                                                                          au1_src_top_right,
 1743|   133k|                                                                          &u1_sao_src_top_left_luma_bot_left,
 1744|   133k|                                                                          au1_avail_luma,
 1745|   133k|                                                                          ai1_offset_y,
 1746|   133k|                                                                          sao_wd_luma,
 1747|   133k|                                                                          sao_ht_luma);
 1748|   133k|                    }
 1749|   133k|                }
 1750|  2.82M|            }
 1751|  4.38M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (1751:21): [True: 2.19M, False: 2.18M]
  |  Branch (1751:68): [True: 17.1k, False: 2.17M]
  ------------------
 1752|  2.21M|            {
 1753|       |                /* Update left, top and top-left */
 1754|  19.8M|                for(row = 0; row < sao_ht_luma; row++)
  ------------------
  |  Branch (1754:30): [True: 17.6M, False: 2.21M]
  ------------------
 1755|  17.6M|                {
 1756|  17.6M|                    pu1_src_left_luma[row] = pu1_src_luma[row * src_strd + (sao_wd_luma - 1)];
 1757|  17.6M|                }
 1758|  2.21M|                pu1_sao_src_luma_top_left_ctb[0] = pu1_src_top_luma[sao_wd_luma - 1];
 1759|       |
 1760|  2.21M|                ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_luma, &pu1_src_luma[(sao_ht_luma - 1) * src_strd], sao_wd_luma);
 1761|  2.21M|            }
 1762|  7.20M|        }
 1763|       |
 1764|  7.20M|        if(0 != sao_wd_chroma)
  ------------------
  |  Branch (1764:12): [True: 2.79M, False: 4.41M]
  ------------------
 1765|  2.79M|        {
 1766|  2.79M|            if(ps_slice_hdr_top->i1_slice_sao_chroma_flag)
  ------------------
  |  Branch (1766:16): [True: 830k, False: 1.96M]
  ------------------
 1767|   830k|            {
 1768|   830k|                if(0 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (1768:20): [True: 570k, False: 259k]
  ------------------
 1769|   570k|                {
 1770|       |
 1771|  5.13M|                    for(row = 0; row < sao_ht_chroma; row++)
  ------------------
  |  Branch (1771:34): [True: 4.56M, False: 570k]
  ------------------
 1772|  4.56M|                    {
 1773|  4.56M|                        pu1_src_left_chroma[2 * row] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 2)];
 1774|  4.56M|                        pu1_src_left_chroma[2 * row + 1] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 1)];
 1775|  4.56M|                    }
 1776|   570k|                    pu1_sao_src_chroma_top_left_ctb[0] = pu1_src_top_chroma[sao_wd_chroma - 2];
 1777|   570k|                    pu1_sao_src_chroma_top_left_ctb[1] = pu1_src_top_chroma[sao_wd_chroma - 1];
 1778|       |
 1779|   570k|                    ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_chroma, &pu1_src_chroma[(sao_ht_chroma - 1) * src_strd], sao_wd_chroma);
 1780|       |
 1781|   570k|                }
 1782|       |
 1783|   259k|                else if(1 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (1783:25): [True: 137k, False: 122k]
  ------------------
 1784|   137k|                {
 1785|   137k|                    ai1_offset_cb[1] = ps_sao->b4_cb_offset_1;
 1786|   137k|                    ai1_offset_cb[2] = ps_sao->b4_cb_offset_2;
 1787|   137k|                    ai1_offset_cb[3] = ps_sao->b4_cb_offset_3;
 1788|   137k|                    ai1_offset_cb[4] = ps_sao->b4_cb_offset_4;
 1789|       |
 1790|   137k|                    ai1_offset_cr[1] = ps_sao->b4_cr_offset_1;
 1791|   137k|                    ai1_offset_cr[2] = ps_sao->b4_cr_offset_2;
 1792|   137k|                    ai1_offset_cr[3] = ps_sao->b4_cr_offset_3;
 1793|   137k|                    ai1_offset_cr[4] = ps_sao->b4_cr_offset_4;
 1794|       |
 1795|   137k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (1795:24): [True: 58.5k, False: 78.8k]
  ------------------
 1796|  58.5k|                    {
 1797|  58.5k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(pu1_src_chroma,
 1798|  58.5k|                                                                                    src_strd,
 1799|  58.5k|                                                                                    pu1_src_left_chroma,
 1800|  58.5k|                                                                                    pu1_src_top_chroma,
 1801|  58.5k|                                                                                    pu1_sao_src_chroma_top_left_ctb,
 1802|  58.5k|                                                                                    ps_sao->b5_cr_band_pos,
 1803|  58.5k|                                                                                    ps_sao->b5_cb_band_pos,
 1804|  58.5k|                                                                                    ai1_offset_cr,
 1805|  58.5k|                                                                                    ai1_offset_cb,
 1806|  58.5k|                                                                                    sao_wd_chroma,
 1807|  58.5k|                                                                                    sao_ht_chroma
 1808|  58.5k|                                                                                   );
 1809|  58.5k|                    }
 1810|  78.8k|                    else
 1811|  78.8k|                    {
 1812|  78.8k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(pu1_src_chroma,
 1813|  78.8k|                                                                                    src_strd,
 1814|  78.8k|                                                                                    pu1_src_left_chroma,
 1815|  78.8k|                                                                                    pu1_src_top_chroma,
 1816|  78.8k|                                                                                    pu1_sao_src_chroma_top_left_ctb,
 1817|  78.8k|                                                                                    ps_sao->b5_cb_band_pos,
 1818|  78.8k|                                                                                    ps_sao->b5_cr_band_pos,
 1819|  78.8k|                                                                                    ai1_offset_cb,
 1820|  78.8k|                                                                                    ai1_offset_cr,
 1821|  78.8k|                                                                                    sao_wd_chroma,
 1822|  78.8k|                                                                                    sao_ht_chroma
 1823|  78.8k|                                                                                   );
 1824|  78.8k|                    }
 1825|   137k|                }
 1826|   122k|                else // if(2 <= ps_sao->b3_cb_type_idx)
 1827|   122k|                {
 1828|   122k|                    ai1_offset_cb[1] = ps_sao->b4_cb_offset_1;
 1829|   122k|                    ai1_offset_cb[2] = ps_sao->b4_cb_offset_2;
 1830|   122k|                    ai1_offset_cb[3] = ps_sao->b4_cb_offset_3;
 1831|   122k|                    ai1_offset_cb[4] = ps_sao->b4_cb_offset_4;
 1832|       |
 1833|   122k|                    ai1_offset_cr[1] = ps_sao->b4_cr_offset_1;
 1834|   122k|                    ai1_offset_cr[2] = ps_sao->b4_cr_offset_2;
 1835|   122k|                    ai1_offset_cr[3] = ps_sao->b4_cr_offset_3;
 1836|   122k|                    ai1_offset_cr[4] = ps_sao->b4_cr_offset_4;
 1837|       |
 1838|  1.10M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1838:32): [True: 979k, False: 122k]
  ------------------
 1839|   979k|                    {
 1840|   979k|                        au1_avail_chroma[i] = 255;
 1841|   979k|                        au1_tile_slice_boundary[i] = 0;
 1842|   979k|                        au4_idx_t[i] = 0;
 1843|   979k|                        au4_ilf_across_tile_slice_enable[i] = 1;
 1844|   979k|                    }
 1845|       |
 1846|   122k|                    {
 1847|   122k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (1847:28): [True: 185, False: 121k]
  |  Branch (1847:75): [True: 1.45k, False: 120k]
  ------------------
 1848|  1.92k|                        {
 1849|  1.92k|                            ctbx_t_t = ps_sao_ctxt->i4_ctb_x;
 1850|  1.92k|                            ctby_t_t = ps_sao_ctxt->i4_ctb_y - 1;
 1851|       |
 1852|  1.92k|                            ctbx_t_l = ps_sao_ctxt->i4_ctb_x - 1;
 1853|  1.92k|                            ctby_t_l = ps_sao_ctxt->i4_ctb_y - 1;
 1854|       |
 1855|  1.92k|                            ctbx_t_r = ps_sao_ctxt->i4_ctb_x;
 1856|  1.92k|                            ctby_t_r = ps_sao_ctxt->i4_ctb_y - 1;
 1857|       |
 1858|  1.92k|                            ctbx_t_d =  ps_sao_ctxt->i4_ctb_x;
 1859|  1.92k|                            ctby_t_d =  ps_sao_ctxt->i4_ctb_y;
 1860|       |
 1861|  1.92k|                            ctbx_t = ps_sao_ctxt->i4_ctb_x;
 1862|  1.92k|                            ctby_t = ps_sao_ctxt->i4_ctb_y - 1;
 1863|       |
 1864|  1.92k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (1864:32): [True: 473, False: 1.45k]
  ------------------
 1865|    473|                            {
 1866|    473|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1866:36): [True: 135, False: 338]
  ------------------
 1867|    135|                                {
 1868|    135|                                    au4_idx_t[0] = -1;
 1869|    135|                                    au4_idx_t[6] = -1;
 1870|    135|                                    au4_idx_t[4] = -1;
 1871|    135|                                }
 1872|    338|                                else
 1873|    338|                                {
 1874|    338|                                    au4_idx_t[0] = au4_idx_t[4] = pu1_slice_idx[ctbx_t_l + (ctby_t_l * ps_sps->i2_pic_wd_in_ctb)];
 1875|    338|                                    au4_idx_t[6] = pu1_slice_idx[ctbx_t_d - 1 + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1876|    338|                                }
 1877|    473|                                idx_t   = pu1_slice_idx[ctbx_t + (ctby_t * ps_sps->i2_pic_wd_in_ctb)];
 1878|    473|                                au4_idx_t[2] = au4_idx_t[5] = pu1_slice_idx[ctbx_t_t + (ctby_t_t * ps_sps->i2_pic_wd_in_ctb)];
 1879|    473|                                au4_idx_t[1] = pu1_slice_idx[ctbx_t_r + (ctby_t_r * ps_sps->i2_pic_wd_in_ctb)];
 1880|    473|                                au4_idx_t[3] = au4_idx_t[7] = pu1_slice_idx[ctbx_t_d + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1881|       |
 1882|       |                                /*Verify that the neighbor ctbs don't cross pic boundary.*/
 1883|       |
 1884|    473|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1884:36): [True: 135, False: 338]
  ------------------
 1885|    135|                                {
 1886|    135|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 1887|    135|                                    au4_ilf_across_tile_slice_enable[6] = 0;
 1888|    135|                                    au4_ilf_across_tile_slice_enable[0] = 0;
 1889|    135|                                }
 1890|    338|                                else
 1891|    338|                                {
 1892|    338|                                    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;
 1893|    338|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + au4_idx_t[6])->i1_slice_loop_filter_across_slices_enabled_flag;
 1894|    338|                                }
 1895|       |
 1896|    473|                                au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + au4_idx_t[5])->i1_slice_loop_filter_across_slices_enabled_flag;
 1897|    473|                                au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1898|    473|                                au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_t[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 1899|    473|                                au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_t[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 1900|    473|                                au4_ilf_across_tile_slice_enable[7] = (ps_slice_hdr_base + au4_idx_t[7])->i1_slice_loop_filter_across_slices_enabled_flag;
 1901|       |
 1902|    473|                                if(idx_t > au4_idx_t[6])
  ------------------
  |  Branch (1902:36): [True: 259, False: 214]
  ------------------
 1903|    259|                                {
 1904|    259|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + idx_t)->i1_slice_loop_filter_across_slices_enabled_flag;
 1905|    259|                                }
 1906|       |
 1907|       |                                /*
 1908|       |                                 * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
 1909|       |                                 * of the pixel having a greater address is checked. Accordingly, set the availability flags
 1910|       |                                 */
 1911|  4.25k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1911:44): [True: 3.78k, False: 473]
  ------------------
 1912|  3.78k|                                {
 1913|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 1914|  3.78k|                                    if(au4_idx_t[i] != idx_t)
  ------------------
  |  Branch (1914:40): [True: 1.01k, False: 2.77k]
  ------------------
 1915|  1.01k|                                    {
 1916|  1.01k|                                        au1_tile_slice_boundary[i] = 1;
 1917|  1.01k|                                    }
 1918|  2.77k|                                    else
 1919|  2.77k|                                    {
 1920|       |                                        /*Indicates that the neighbour belongs to same/dependent slice*/
 1921|  2.77k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 1922|  2.77k|                                    }
 1923|  3.78k|                                }
 1924|       |                                /*Reset indices*/
 1925|  4.25k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1925:44): [True: 3.78k, False: 473]
  ------------------
 1926|  3.78k|                                {
 1927|  3.78k|                                    au4_idx_t[i] = 0;
 1928|  3.78k|                                }
 1929|    473|                            }
 1930|  1.92k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (1930:32): [True: 1.65k, False: 272]
  ------------------
 1931|  1.65k|                            {
 1932|       |                                /* Calculate availability flags at slice boundary */
 1933|  1.65k|                                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 (1933:37): [True: 1.05k, False: 600]
  |  Branch (1933:85): [True: 267, False: 333]
  |  Branch (1933:137): [True: 841, False: 483]
  |  Branch (1933:165): [True: 500, False: 341]
  ------------------
 1934|    824|                                {
 1935|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 1936|    824|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (1936:40): [True: 698, False: 126]
  ------------------
 1937|    698|                                    {
 1938|       |                                        /*Calculate neighbor ctb slice indices*/
 1939|    698|                                        if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1939:44): [True: 75, False: 623]
  ------------------
 1940|     75|                                        {
 1941|     75|                                            au4_idx_t[0] = -1;
 1942|     75|                                            au4_idx_t[6] = -1;
 1943|     75|                                            au4_idx_t[4] = -1;
 1944|     75|                                        }
 1945|    623|                                        else
 1946|    623|                                        {
 1947|    623|                                            au4_idx_t[0] = au4_idx_t[4] = pu1_tile_idx[ctbx_t_l + (ctby_t_l * ps_sps->i2_pic_wd_in_ctb)];
 1948|    623|                                            au4_idx_t[6] = pu1_tile_idx[ctbx_t_d - 1 + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1949|    623|                                        }
 1950|    698|                                        idx_t   = pu1_tile_idx[ctbx_t + (ctby_t * ps_sps->i2_pic_wd_in_ctb)];
 1951|    698|                                        au4_idx_t[2] = au4_idx_t[5] = pu1_tile_idx[ctbx_t_t + (ctby_t_t * ps_sps->i2_pic_wd_in_ctb)];
 1952|    698|                                        au4_idx_t[1] = pu1_tile_idx[ctbx_t_r + (ctby_t_r * ps_sps->i2_pic_wd_in_ctb)];
 1953|    698|                                        au4_idx_t[3] = au4_idx_t[7] = pu1_tile_idx[ctbx_t_d + (ctby_t_d * ps_sps->i2_pic_wd_in_ctb)];
 1954|       |
 1955|  6.28k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1955:52): [True: 5.58k, False: 698]
  ------------------
 1956|  5.58k|                                        {
 1957|       |                                            /*Sets the edges that lie on the tile boundary*/
 1958|  5.58k|                                            if(au4_idx_t[i] != idx_t)
  ------------------
  |  Branch (1958:48): [True: 2.20k, False: 3.38k]
  ------------------
 1959|  2.20k|                                            {
 1960|  2.20k|                                                au1_tile_slice_boundary[i] |= 1;
 1961|  2.20k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag;
 1962|  2.20k|                                            }
 1963|  5.58k|                                        }
 1964|    698|                                    }
 1965|    824|                                }
 1966|  1.65k|                            }
 1967|  17.3k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (1967:40): [True: 15.4k, False: 1.92k]
  ------------------
 1968|  15.4k|                            {
 1969|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 1970|  15.4k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (1970:36): [True: 3.21k, False: 12.2k]
  |  Branch (1970:68): [True: 2.53k, False: 684]
  ------------------
 1971|  2.53k|                                {
 1972|  2.53k|                                    au1_avail_chroma[i] = 0;
 1973|  2.53k|                                }
 1974|  15.4k|                            }
 1975|       |
 1976|  1.92k|                        }
 1977|   122k|                    }
 1978|   122k|                    if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (1978:24): [True: 6.29k, False: 115k]
  ------------------
 1979|  6.29k|                    {
 1980|  6.29k|                        au1_avail_chroma[0] = 0;
 1981|  6.29k|                        au1_avail_chroma[4] = 0;
 1982|  6.29k|                        au1_avail_chroma[6] = 0;
 1983|  6.29k|                    }
 1984|       |
 1985|   122k|                    if(ps_sps->i2_pic_width_in_luma_samples - (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) <= sao_wd_chroma)
  ------------------
  |  Branch (1985:24): [True: 6.97k, False: 115k]
  ------------------
 1986|  6.97k|                    {
 1987|  6.97k|                        au1_avail_chroma[1] = 0;
 1988|  6.97k|                        au1_avail_chroma[5] = 0;
 1989|  6.97k|                        au1_avail_chroma[7] = 0;
 1990|  6.97k|                    }
 1991|       |
 1992|   122k|                    if(0 == (ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 1)) - sao_ht_chroma)
  ------------------
  |  Branch (1992:24): [True: 170, False: 121k]
  ------------------
 1993|    170|                    {
 1994|    170|                        au1_avail_chroma[2] = 0;
 1995|    170|                        au1_avail_chroma[4] = 0;
 1996|    170|                        au1_avail_chroma[5] = 0;
 1997|    170|                    }
 1998|       |
 1999|   122k|                    if(ps_sps->i2_pic_ht_in_ctb == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (1999:24): [True: 0, False: 122k]
  ------------------
 2000|      0|                    {
 2001|      0|                        au1_avail_chroma[3] = 0;
 2002|      0|                        au1_avail_chroma[6] = 0;
 2003|      0|                        au1_avail_chroma[7] = 0;
 2004|      0|                    }
 2005|       |
 2006|   122k|                    {
 2007|   122k|                        au1_src_top_right[0] = pu1_sao_src_top_left_chroma_top_right[0];
 2008|   122k|                        au1_src_top_right[1] = pu1_sao_src_top_left_chroma_top_right[1];
 2009|   122k|                        au1_sao_src_top_left_chroma_bot_left[0] = pu1_src_chroma[sao_ht_chroma * src_strd - 2];
 2010|   122k|                        au1_sao_src_top_left_chroma_bot_left[1] = pu1_src_chroma[sao_ht_chroma * src_strd - 1];
 2011|       |
 2012|   122k|                        if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (2012:28): [True: 50.5k, False: 71.5k]
  ------------------
 2013|  50.5k|                        {
 2014|  50.5k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 2015|  50.5k|                                                                                 src_strd,
 2016|  50.5k|                                                                                 pu1_src_left_chroma,
 2017|  50.5k|                                                                                 pu1_src_top_chroma,
 2018|  50.5k|                                                                                 pu1_sao_src_chroma_top_left_ctb,
 2019|  50.5k|                                                                                 au1_src_top_right,
 2020|  50.5k|                                                                                 au1_sao_src_top_left_chroma_bot_left,
 2021|  50.5k|                                                                                 au1_avail_chroma,
 2022|  50.5k|                                                                                 ai1_offset_cr,
 2023|  50.5k|                                                                                 ai1_offset_cb,
 2024|  50.5k|                                                                                 sao_wd_chroma,
 2025|  50.5k|                                                                                 sao_ht_chroma);
 2026|  50.5k|                        }
 2027|  71.5k|                        else
 2028|  71.5k|                        {
 2029|  71.5k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 2030|  71.5k|                                                                                 src_strd,
 2031|  71.5k|                                                                                 pu1_src_left_chroma,
 2032|  71.5k|                                                                                 pu1_src_top_chroma,
 2033|  71.5k|                                                                                 pu1_sao_src_chroma_top_left_ctb,
 2034|  71.5k|                                                                                 au1_src_top_right,
 2035|  71.5k|                                                                                 au1_sao_src_top_left_chroma_bot_left,
 2036|  71.5k|                                                                                 au1_avail_chroma,
 2037|  71.5k|                                                                                 ai1_offset_cb,
 2038|  71.5k|                                                                                 ai1_offset_cr,
 2039|  71.5k|                                                                                 sao_wd_chroma,
 2040|  71.5k|                                                                                 sao_ht_chroma);
 2041|  71.5k|                        }
 2042|   122k|                    }
 2043|       |
 2044|   122k|                }
 2045|   830k|            }
 2046|  1.96M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2046:21): [True: 19.6k, False: 1.94M]
  |  Branch (2046:68): [True: 17.7k, False: 1.92M]
  ------------------
 2047|  37.3k|            {
 2048|   336k|                for(row = 0; row < sao_ht_chroma; row++)
  ------------------
  |  Branch (2048:30): [True: 298k, False: 37.3k]
  ------------------
 2049|   298k|                {
 2050|   298k|                    pu1_src_left_chroma[2 * row] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 2)];
 2051|   298k|                    pu1_src_left_chroma[2 * row + 1] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 1)];
 2052|   298k|                }
 2053|  37.3k|                pu1_sao_src_chroma_top_left_ctb[0] = pu1_src_top_chroma[sao_wd_chroma - 2];
 2054|  37.3k|                pu1_sao_src_chroma_top_left_ctb[1] = pu1_src_top_chroma[sao_wd_chroma - 1];
 2055|       |
 2056|  37.3k|                ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_chroma, &pu1_src_chroma[(sao_ht_chroma - 1) * src_strd], sao_wd_chroma);
 2057|  37.3k|            }
 2058|  2.79M|        }
 2059|       |
 2060|  7.20M|        pu1_src_luma += sao_ht_luma * src_strd;
 2061|  7.20M|        pu1_src_chroma += sao_ht_chroma * src_strd;
 2062|  7.20M|        ps_sao += (ps_sps->i2_pic_wd_in_ctb);
 2063|  7.20M|    }
 2064|       |
 2065|       |    /* Left CTB */
 2066|  7.49M|    if(ps_sao_ctxt->i4_ctb_x > 0)
  ------------------
  |  Branch (2066:8): [True: 7.01M, False: 473k]
  ------------------
 2067|  7.01M|    {
 2068|  7.01M|        WORD32 sao_wd_luma = SAO_SHIFT_CTB;
  ------------------
  |  |   78|  7.01M|#define SAO_SHIFT_CTB    8
  ------------------
 2069|  7.01M|        WORD32 sao_wd_chroma = 2 * SAO_SHIFT_CTB;
  ------------------
  |  |   78|  7.01M|#define SAO_SHIFT_CTB    8
  ------------------
 2070|  7.01M|        WORD32 sao_ht_luma = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  7.01M|#define SAO_SHIFT_CTB    8
  ------------------
 2071|  7.01M|        WORD32 sao_ht_chroma = ctb_size / 2 - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  7.01M|#define SAO_SHIFT_CTB    8
  ------------------
 2072|       |
 2073|  7.01M|        WORD32 ctbx_l_t = 0, ctbx_l_l = 0, ctbx_l_r = 0, ctbx_l_d = 0, ctbx_l = 0;
 2074|  7.01M|        WORD32 ctby_l_t = 0, ctby_l_l = 0, ctby_l_r = 0, ctby_l_d = 0, ctby_l = 0;
 2075|  7.01M|        WORD32 au4_idx_l[8], idx_l;
 2076|       |
 2077|  7.01M|        WORD32 remaining_rows;
 2078|  7.01M|        slice_header_t *ps_slice_hdr_left;
 2079|  7.01M|        {
 2080|  7.01M|            WORD32 left_ctb_indx = (ps_sao_ctxt->i4_ctb_y) * ps_sps->i2_pic_wd_in_ctb +
 2081|  7.01M|                                        (ps_sao_ctxt->i4_ctb_x - 1);
 2082|  7.01M|            ps_slice_hdr_left = ps_slice_hdr_base + pu1_slice_idx[left_ctb_indx];
 2083|  7.01M|        }
 2084|       |
 2085|  7.01M|        remaining_rows = ps_sps->i2_pic_height_in_luma_samples - ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) + sao_ht_luma);
 2086|  7.01M|        if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  7.01M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (2086:12): [True: 274k, False: 6.74M]
  ------------------
 2087|   274k|        {
 2088|   274k|            sao_ht_luma += remaining_rows;
 2089|   274k|        }
 2090|  7.01M|        remaining_rows = ps_sps->i2_pic_height_in_luma_samples / 2 - ((ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 1)) + sao_ht_chroma);
 2091|  7.01M|        if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  7.01M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (2091:12): [True: 274k, False: 6.74M]
  ------------------
 2092|   274k|        {
 2093|   274k|            sao_ht_chroma += remaining_rows;
 2094|   274k|        }
 2095|       |
 2096|  7.01M|        pu1_src_luma -= sao_wd_luma;
 2097|  7.01M|        pu1_src_chroma -= sao_wd_chroma;
 2098|  7.01M|        ps_sao -= 1;
 2099|  7.01M|        pu1_src_top_luma = ps_sao_ctxt->pu1_sao_src_top_luma + (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_luma;
 2100|  7.01M|        pu1_src_top_chroma = ps_sao_ctxt->pu1_sao_src_top_chroma + (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_chroma;
 2101|  7.01M|        pu1_src_left_luma = ps_sao_ctxt->pu1_sao_src_left_luma + (ps_sao_ctxt->i4_ctb_y << log2_ctb_size);
 2102|  7.01M|        pu1_src_left_chroma = ps_sao_ctxt->pu1_sao_src_left_chroma + (ps_sao_ctxt->i4_ctb_y << log2_ctb_size);
 2103|       |
 2104|       |
 2105|  7.01M|        if(0 != sao_ht_luma)
  ------------------
  |  Branch (2105:12): [True: 7.01M, False: 18.4E]
  ------------------
 2106|  7.01M|        {
 2107|  7.01M|            if(ps_slice_hdr_left->i1_slice_sao_luma_flag)
  ------------------
  |  Branch (2107:16): [True: 2.79M, False: 4.22M]
  ------------------
 2108|  2.79M|            {
 2109|  2.79M|                if(0 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (2109:20): [True: 2.53M, False: 260k]
  ------------------
 2110|  2.53M|                {
 2111|       |                    /* Update left, top and top-left */
 2112|  33.3M|                    for(row = 0; row < sao_ht_luma; row++)
  ------------------
  |  Branch (2112:34): [True: 30.8M, False: 2.53M]
  ------------------
 2113|  30.8M|                    {
 2114|  30.8M|                        pu1_src_left_luma[row] = pu1_src_luma[row * src_strd + (sao_wd_luma - 1)];
 2115|  30.8M|                    }
 2116|       |                    /*Update in next location*/
 2117|  2.53M|                    pu1_sao_src_top_left_luma_curr_ctb[0] = pu1_src_top_luma[sao_wd_luma - 1];
 2118|       |
 2119|  2.53M|                    ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_luma, &pu1_src_luma[(sao_ht_luma - 1) * src_strd], sao_wd_luma);
 2120|       |
 2121|  2.53M|                }
 2122|       |
 2123|   260k|                else if(1 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (2123:25): [True: 131k, False: 129k]
  ------------------
 2124|   131k|                {
 2125|   131k|                    ai1_offset_y[1] = ps_sao->b4_y_offset_1;
 2126|   131k|                    ai1_offset_y[2] = ps_sao->b4_y_offset_2;
 2127|   131k|                    ai1_offset_y[3] = ps_sao->b4_y_offset_3;
 2128|   131k|                    ai1_offset_y[4] = ps_sao->b4_y_offset_4;
 2129|       |
 2130|   131k|                    ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr(pu1_src_luma,
 2131|   131k|                                                                              src_strd,
 2132|   131k|                                                                              pu1_src_left_luma,
 2133|   131k|                                                                              pu1_src_top_luma,
 2134|   131k|                                                                              pu1_sao_src_top_left_luma_curr_ctb,
 2135|   131k|                                                                              ps_sao->b5_y_band_pos,
 2136|   131k|                                                                              ai1_offset_y,
 2137|   131k|                                                                              sao_wd_luma,
 2138|   131k|                                                                              sao_ht_luma
 2139|   131k|                                                                             );
 2140|   131k|                }
 2141|       |
 2142|   129k|                else // if(2 <= ps_sao->b3_y_type_idx)
 2143|   129k|                {
 2144|   129k|                    ai1_offset_y[1] = ps_sao->b4_y_offset_1;
 2145|   129k|                    ai1_offset_y[2] = ps_sao->b4_y_offset_2;
 2146|   129k|                    ai1_offset_y[3] = ps_sao->b4_y_offset_3;
 2147|   129k|                    ai1_offset_y[4] = ps_sao->b4_y_offset_4;
 2148|       |
 2149|  1.16M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2149:32): [True: 1.03M, False: 129k]
  ------------------
 2150|  1.03M|                    {
 2151|  1.03M|                        au1_avail_luma[i] = 255;
 2152|  1.03M|                        au1_tile_slice_boundary[i] = 0;
 2153|  1.03M|                        au4_idx_l[i] = 0;
 2154|  1.03M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 2155|  1.03M|                    }
 2156|       |                    /******************************************************************
 2157|       |                     * Derive the  Top-left CTB's neighbour pixel's slice indices.
 2158|       |                     *
 2159|       |                     *
 2160|       |                     *          ____________
 2161|       |                     *         |    |       |
 2162|       |                     *         | L_T|       |
 2163|       |                     *         |____|_______|____
 2164|       |                     *         |    |       |    |
 2165|       |                     *     L_L |  L |  L_R  |    |
 2166|       |                     *         |____|_______|    |
 2167|       |                     *              |            |
 2168|       |                     *          L_D |            |
 2169|       |                     *              |____________|
 2170|       |                     *
 2171|       |                     *****************************************************************/
 2172|       |
 2173|       |                    /*In case of slices or tiles*/
 2174|   129k|                    {
 2175|   129k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2175:28): [True: 415, False: 128k]
  |  Branch (2175:75): [True: 2.11k, False: 126k]
  ------------------
 2176|  2.66k|                        {
 2177|  2.66k|                            ctbx_l_t = ps_sao_ctxt->i4_ctb_x - 1;
 2178|  2.66k|                            ctby_l_t = ps_sao_ctxt->i4_ctb_y - 1;
 2179|       |
 2180|  2.66k|                            ctbx_l_l = ps_sao_ctxt->i4_ctb_x - 1;
 2181|  2.66k|                            ctby_l_l = ps_sao_ctxt->i4_ctb_y;
 2182|       |
 2183|  2.66k|                            ctbx_l_r = ps_sao_ctxt->i4_ctb_x;
 2184|  2.66k|                            ctby_l_r = ps_sao_ctxt->i4_ctb_y;
 2185|       |
 2186|  2.66k|                            ctbx_l_d =  ps_sao_ctxt->i4_ctb_x - 1;
 2187|  2.66k|                            ctby_l_d =  ps_sao_ctxt->i4_ctb_y;
 2188|       |
 2189|  2.66k|                            ctbx_l = ps_sao_ctxt->i4_ctb_x - 1;
 2190|  2.66k|                            ctby_l = ps_sao_ctxt->i4_ctb_y;
 2191|       |
 2192|  2.66k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (2192:32): [True: 554, False: 2.11k]
  ------------------
 2193|    554|                            {
 2194|    554|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2194:36): [True: 91, False: 463]
  ------------------
 2195|     91|                                {
 2196|     91|                                    au4_idx_l[2] = -1;
 2197|     91|                                    au4_idx_l[4] = -1;
 2198|     91|                                    au4_idx_l[5] = -1;
 2199|     91|                                }
 2200|    463|                                else
 2201|    463|                                {
 2202|    463|                                    au4_idx_l[2] = au4_idx_l[4] = pu1_slice_idx[ctbx_l_t + (ctby_l_t * ps_sps->i2_pic_wd_in_ctb)];
 2203|    463|                                    au4_idx_l[5] =  pu1_slice_idx[ctbx_l_t + 1 + (ctby_l_t  * ps_sps->i2_pic_wd_in_ctb)];
 2204|    463|                                }
 2205|    554|                                idx_l   = au4_idx_l[6] = pu1_slice_idx[ctbx_l + (ctby_l * ps_sps->i2_pic_wd_in_ctb)];
 2206|    554|                                au4_idx_l[0] = pu1_slice_idx[ctbx_l_l + (ctby_l_l * ps_sps->i2_pic_wd_in_ctb)];
 2207|    554|                                au4_idx_l[1] = au4_idx_l[7] = pu1_slice_idx[ctbx_l_r + (ctby_l_r * ps_sps->i2_pic_wd_in_ctb)];
 2208|    554|                                au4_idx_l[3] = pu1_slice_idx[ctbx_l_d + (ctby_l_d * ps_sps->i2_pic_wd_in_ctb)];
 2209|       |
 2210|       |                                /*Verify that the neighbor ctbs don't cross pic boundary.*/
 2211|    554|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2211:36): [True: 91, False: 463]
  ------------------
 2212|     91|                                {
 2213|     91|                                    au4_ilf_across_tile_slice_enable[2] = 0;
 2214|     91|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 2215|     91|                                    au4_ilf_across_tile_slice_enable[5] = 0;
 2216|     91|                                }
 2217|    463|                                else
 2218|    463|                                {
 2219|    463|                                    au4_ilf_across_tile_slice_enable[2] =  (ps_slice_hdr_base + idx_l)->i1_slice_loop_filter_across_slices_enabled_flag;
 2220|    463|                                    au4_ilf_across_tile_slice_enable[5] = au4_ilf_across_tile_slice_enable[4] = au4_ilf_across_tile_slice_enable[2];
 2221|       |
 2222|    463|                                }
 2223|       |                                //TODO: ILF flag checks for [0] and [6] is missing.
 2224|    554|                                au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_l[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 2225|    554|                                au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_l[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 2226|    554|                                au4_ilf_across_tile_slice_enable[7] = (ps_slice_hdr_base + au4_idx_l[7])->i1_slice_loop_filter_across_slices_enabled_flag;
 2227|       |
 2228|    554|                                if(idx_l < au4_idx_l[5])
  ------------------
  |  Branch (2228:36): [True: 321, False: 233]
  ------------------
 2229|    321|                                {
 2230|    321|                                    au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + au4_idx_l[5])->i1_slice_loop_filter_across_slices_enabled_flag;
 2231|    321|                                }
 2232|       |
 2233|       |                                /*
 2234|       |                                 * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
 2235|       |                                 * of the pixel having a greater address is checked. Accordingly, set the availability flags
 2236|       |                                 */
 2237|  4.98k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2237:44): [True: 4.43k, False: 554]
  ------------------
 2238|  4.43k|                                {
 2239|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 2240|  4.43k|                                    if(au4_idx_l[i] != idx_l)
  ------------------
  |  Branch (2240:40): [True: 1.49k, False: 2.93k]
  ------------------
 2241|  1.49k|                                    {
 2242|  1.49k|                                        au1_tile_slice_boundary[i] = 1;
 2243|  1.49k|                                    }
 2244|  2.93k|                                    else
 2245|  2.93k|                                    {
 2246|  2.93k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 2247|  2.93k|                                    }
 2248|  4.43k|                                }
 2249|       |                                /*Reset indices*/
 2250|  4.98k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2250:44): [True: 4.43k, False: 554]
  ------------------
 2251|  4.43k|                                {
 2252|  4.43k|                                    au4_idx_l[i] = 0;
 2253|  4.43k|                                }
 2254|    554|                            }
 2255|       |
 2256|  2.66k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (2256:32): [True: 2.43k, False: 227]
  ------------------
 2257|  2.43k|                            {
 2258|       |                                /* Calculate availability flags at slice boundary */
 2259|  2.43k|                                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 (2259:37): [True: 381, False: 2.05k]
  |  Branch (2259:85): [True: 1.43k, False: 625]
  |  Branch (2259:137): [True: 1.43k, False: 381]
  |  Branch (2259:165): [True: 742, False: 690]
  ------------------
 2260|  1.07k|                                {
 2261|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 2262|  1.07k|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (2262:40): [True: 730, False: 341]
  ------------------
 2263|    730|                                    {
 2264|    730|                                        if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2264:44): [True: 3, False: 727]
  ------------------
 2265|      3|                                        {
 2266|      3|                                            au4_idx_l[2] = -1;
 2267|      3|                                            au4_idx_l[4] = -1;
 2268|      3|                                            au4_idx_l[5] = -1;
 2269|      3|                                        }
 2270|    727|                                        else
 2271|    727|                                        {
 2272|    727|                                            au4_idx_l[2] = au4_idx_l[4] = pu1_tile_idx[ctbx_l_t + (ctby_l_t * ps_sps->i2_pic_wd_in_ctb)];
 2273|    727|                                            au4_idx_l[5] =  pu1_tile_idx[ctbx_l_t + 1 + (ctby_l_t  * ps_sps->i2_pic_wd_in_ctb)];
 2274|    727|                                        }
 2275|       |
 2276|    730|                                        idx_l   = au4_idx_l[6] = pu1_tile_idx[ctbx_l + (ctby_l * ps_sps->i2_pic_wd_in_ctb)];
 2277|    730|                                        au4_idx_l[0] = pu1_tile_idx[ctbx_l_l + (ctby_l_l * ps_sps->i2_pic_wd_in_ctb)];
 2278|    730|                                        au4_idx_l[1] = au4_idx_l[7] = pu1_tile_idx[ctbx_l_r + (ctby_l_r * ps_sps->i2_pic_wd_in_ctb)];
 2279|    730|                                        au4_idx_l[3] = pu1_tile_idx[ctbx_l_d + (ctby_l_d * ps_sps->i2_pic_wd_in_ctb)];
 2280|       |
 2281|  6.57k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2281:52): [True: 5.84k, False: 730]
  ------------------
 2282|  5.84k|                                        {
 2283|       |                                            /*Sets the edges that lie on the slice/tile boundary*/
 2284|  5.84k|                                            if(au4_idx_l[i] != idx_l)
  ------------------
  |  Branch (2284:48): [True: 2.19k, False: 3.64k]
  ------------------
 2285|  2.19k|                                            {
 2286|  2.19k|                                                au1_tile_slice_boundary[i] |= 1;
 2287|  2.19k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag;
 2288|  2.19k|                                            }
 2289|  5.84k|                                        }
 2290|    730|                                    }
 2291|  1.07k|                                }
 2292|  2.43k|                            }
 2293|       |
 2294|  23.9k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2294:40): [True: 21.3k, False: 2.66k]
  ------------------
 2295|  21.3k|                            {
 2296|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 2297|  21.3k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (2297:36): [True: 3.69k, False: 17.6k]
  |  Branch (2297:68): [True: 2.49k, False: 1.19k]
  ------------------
 2298|  2.49k|                                {
 2299|  2.49k|                                    au1_avail_luma[i] = 0;
 2300|  2.49k|                                }
 2301|  21.3k|                            }
 2302|  2.66k|                        }
 2303|   129k|                    }
 2304|   129k|                    if(0 == (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_luma)
  ------------------
  |  Branch (2304:24): [True: 0, False: 129k]
  ------------------
 2305|      0|                    {
 2306|      0|                        au1_avail_luma[0] = 0;
 2307|      0|                        au1_avail_luma[4] = 0;
 2308|      0|                        au1_avail_luma[6] = 0;
 2309|      0|                    }
 2310|   129k|                    if(ps_sps->i2_pic_wd_in_ctb == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2310:24): [True: 0, False: 129k]
  ------------------
 2311|      0|                    {
 2312|      0|                        au1_avail_luma[1] = 0;
 2313|      0|                        au1_avail_luma[5] = 0;
 2314|      0|                        au1_avail_luma[7] = 0;
 2315|      0|                    }
 2316|       |
 2317|   129k|                    if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2317:24): [True: 12.9k, False: 116k]
  ------------------
 2318|  12.9k|                    {
 2319|  12.9k|                        au1_avail_luma[2] = 0;
 2320|  12.9k|                        au1_avail_luma[4] = 0;
 2321|  12.9k|                        au1_avail_luma[5] = 0;
 2322|  12.9k|                    }
 2323|       |
 2324|   129k|                    if(ps_sps->i2_pic_height_in_luma_samples - (ps_sao_ctxt->i4_ctb_y  << log2_ctb_size) <= sao_ht_luma)
  ------------------
  |  Branch (2324:24): [True: 4.29k, False: 124k]
  ------------------
 2325|  4.29k|                    {
 2326|  4.29k|                        au1_avail_luma[3] = 0;
 2327|  4.29k|                        au1_avail_luma[6] = 0;
 2328|  4.29k|                        au1_avail_luma[7] = 0;
 2329|  4.29k|                    }
 2330|       |
 2331|   129k|                    {
 2332|   129k|                        au1_src_top_right[0] = pu1_src_top_luma[sao_wd_luma];
 2333|   129k|                        u1_sao_src_top_left_luma_bot_left = pu1_sao_src_top_left_luma_bot_left[0];
 2334|   129k|                        ps_codec->apf_sao_luma[ps_sao->b3_y_type_idx - 2](pu1_src_luma,
 2335|   129k|                                                                          src_strd,
 2336|   129k|                                                                          pu1_src_left_luma,
 2337|   129k|                                                                          pu1_src_top_luma,
 2338|   129k|                                                                          pu1_sao_src_top_left_luma_curr_ctb,
 2339|   129k|                                                                          au1_src_top_right,
 2340|   129k|                                                                          &u1_sao_src_top_left_luma_bot_left,
 2341|   129k|                                                                          au1_avail_luma,
 2342|   129k|                                                                          ai1_offset_y,
 2343|   129k|                                                                          sao_wd_luma,
 2344|   129k|                                                                          sao_ht_luma);
 2345|   129k|                    }
 2346|       |
 2347|   129k|                }
 2348|  2.79M|            }
 2349|  4.22M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2349:21): [True: 2.15M, False: 2.06M]
  |  Branch (2349:68): [True: 22.8k, False: 2.04M]
  ------------------
 2350|  2.18M|            {
 2351|       |                /* Update left, top and top-left */
 2352|  20.9M|                for(row = 0; row < sao_ht_luma; row++)
  ------------------
  |  Branch (2352:30): [True: 18.7M, False: 2.18M]
  ------------------
 2353|  18.7M|                {
 2354|  18.7M|                    pu1_src_left_luma[row] = pu1_src_luma[row * src_strd + (sao_wd_luma - 1)];
 2355|  18.7M|                }
 2356|       |                /*Update in next location*/
 2357|  2.18M|                pu1_sao_src_top_left_luma_curr_ctb[0] = pu1_src_top_luma[sao_wd_luma - 1];
 2358|       |
 2359|  2.18M|                ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_luma, &pu1_src_luma[(sao_ht_luma - 1) * src_strd], sao_wd_luma);
 2360|  2.18M|            }
 2361|  7.01M|        }
 2362|       |
 2363|  7.01M|        if(0 != sao_ht_chroma)
  ------------------
  |  Branch (2363:12): [True: 2.60M, False: 4.41M]
  ------------------
 2364|  2.60M|        {
 2365|  2.60M|            if(ps_slice_hdr_left->i1_slice_sao_chroma_flag)
  ------------------
  |  Branch (2365:16): [True: 540k, False: 2.06M]
  ------------------
 2366|   540k|            {
 2367|   540k|                if(0 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (2367:20): [True: 286k, False: 254k]
  ------------------
 2368|   286k|                {
 2369|  5.99M|                    for(row = 0; row < sao_ht_chroma; row++)
  ------------------
  |  Branch (2369:34): [True: 5.70M, False: 286k]
  ------------------
 2370|  5.70M|                    {
 2371|  5.70M|                        pu1_src_left_chroma[2 * row] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 2)];
 2372|  5.70M|                        pu1_src_left_chroma[2 * row + 1] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 1)];
 2373|  5.70M|                    }
 2374|   286k|                    pu1_sao_src_top_left_chroma_curr_ctb[0] = pu1_src_top_chroma[sao_wd_chroma - 2];
 2375|   286k|                    pu1_sao_src_top_left_chroma_curr_ctb[1] = pu1_src_top_chroma[sao_wd_chroma - 1];
 2376|       |
 2377|   286k|                    ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_chroma, &pu1_src_chroma[(sao_ht_chroma - 1) * src_strd], sao_wd_chroma);
 2378|   286k|                }
 2379|       |
 2380|   254k|                else if(1 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (2380:25): [True: 134k, False: 119k]
  ------------------
 2381|   134k|                {
 2382|   134k|                    ai1_offset_cb[1] = ps_sao->b4_cb_offset_1;
 2383|   134k|                    ai1_offset_cb[2] = ps_sao->b4_cb_offset_2;
 2384|   134k|                    ai1_offset_cb[3] = ps_sao->b4_cb_offset_3;
 2385|   134k|                    ai1_offset_cb[4] = ps_sao->b4_cb_offset_4;
 2386|       |
 2387|   134k|                    ai1_offset_cr[1] = ps_sao->b4_cr_offset_1;
 2388|   134k|                    ai1_offset_cr[2] = ps_sao->b4_cr_offset_2;
 2389|   134k|                    ai1_offset_cr[3] = ps_sao->b4_cr_offset_3;
 2390|   134k|                    ai1_offset_cr[4] = ps_sao->b4_cr_offset_4;
 2391|       |
 2392|   134k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (2392:24): [True: 57.1k, False: 77.5k]
  ------------------
 2393|  57.1k|                    {
 2394|  57.1k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(pu1_src_chroma,
 2395|  57.1k|                                                                                    src_strd,
 2396|  57.1k|                                                                                    pu1_src_left_chroma,
 2397|  57.1k|                                                                                    pu1_src_top_chroma,
 2398|  57.1k|                                                                                    pu1_sao_src_top_left_chroma_curr_ctb,
 2399|  57.1k|                                                                                    ps_sao->b5_cr_band_pos,
 2400|  57.1k|                                                                                    ps_sao->b5_cb_band_pos,
 2401|  57.1k|                                                                                    ai1_offset_cr,
 2402|  57.1k|                                                                                    ai1_offset_cb,
 2403|  57.1k|                                                                                    sao_wd_chroma,
 2404|  57.1k|                                                                                    sao_ht_chroma
 2405|  57.1k|                                                                                   );
 2406|  57.1k|                    }
 2407|  77.5k|                    else
 2408|  77.5k|                    {
 2409|  77.5k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(pu1_src_chroma,
 2410|  77.5k|                                                                                    src_strd,
 2411|  77.5k|                                                                                    pu1_src_left_chroma,
 2412|  77.5k|                                                                                    pu1_src_top_chroma,
 2413|  77.5k|                                                                                    pu1_sao_src_top_left_chroma_curr_ctb,
 2414|  77.5k|                                                                                    ps_sao->b5_cb_band_pos,
 2415|  77.5k|                                                                                    ps_sao->b5_cr_band_pos,
 2416|  77.5k|                                                                                    ai1_offset_cb,
 2417|  77.5k|                                                                                    ai1_offset_cr,
 2418|  77.5k|                                                                                    sao_wd_chroma,
 2419|  77.5k|                                                                                    sao_ht_chroma
 2420|  77.5k|                                                                                   );
 2421|  77.5k|                    }
 2422|   134k|                }
 2423|       |
 2424|   119k|                else // if(2 <= ps_sao->b3_cb_type_idx)
 2425|   119k|                {
 2426|   119k|                    ai1_offset_cb[1] = ps_sao->b4_cb_offset_1;
 2427|   119k|                    ai1_offset_cb[2] = ps_sao->b4_cb_offset_2;
 2428|   119k|                    ai1_offset_cb[3] = ps_sao->b4_cb_offset_3;
 2429|   119k|                    ai1_offset_cb[4] = ps_sao->b4_cb_offset_4;
 2430|       |
 2431|   119k|                    ai1_offset_cr[1] = ps_sao->b4_cr_offset_1;
 2432|   119k|                    ai1_offset_cr[2] = ps_sao->b4_cr_offset_2;
 2433|   119k|                    ai1_offset_cr[3] = ps_sao->b4_cr_offset_3;
 2434|   119k|                    ai1_offset_cr[4] = ps_sao->b4_cr_offset_4;
 2435|       |
 2436|  1.08M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2436:32): [True: 960k, False: 119k]
  ------------------
 2437|   960k|                    {
 2438|   960k|                        au1_avail_chroma[i] = 255;
 2439|   960k|                        au1_tile_slice_boundary[i] = 0;
 2440|   960k|                        au4_idx_l[i] = 0;
 2441|   960k|                        au4_ilf_across_tile_slice_enable[i] = 1;
 2442|   960k|                    }
 2443|       |                    /*In case of slices*/
 2444|   119k|                    {
 2445|   119k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2445:28): [True: 617, False: 119k]
  |  Branch (2445:75): [True: 1.30k, False: 117k]
  ------------------
 2446|  2.04k|                        {
 2447|  2.04k|                            ctbx_l_t = ps_sao_ctxt->i4_ctb_x - 1;
 2448|  2.04k|                            ctby_l_t = ps_sao_ctxt->i4_ctb_y - 1;
 2449|       |
 2450|  2.04k|                            ctbx_l_l = ps_sao_ctxt->i4_ctb_x - 1;
 2451|  2.04k|                            ctby_l_l = ps_sao_ctxt->i4_ctb_y;
 2452|       |
 2453|  2.04k|                            ctbx_l_r = ps_sao_ctxt->i4_ctb_x;
 2454|  2.04k|                            ctby_l_r = ps_sao_ctxt->i4_ctb_y;
 2455|       |
 2456|  2.04k|                            ctbx_l_d =  ps_sao_ctxt->i4_ctb_x - 1;
 2457|  2.04k|                            ctby_l_d =  ps_sao_ctxt->i4_ctb_y;
 2458|       |
 2459|  2.04k|                            ctbx_l = ps_sao_ctxt->i4_ctb_x - 1;
 2460|  2.04k|                            ctby_l = ps_sao_ctxt->i4_ctb_y;
 2461|       |
 2462|  2.04k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (2462:32): [True: 741, False: 1.30k]
  ------------------
 2463|    741|                            {
 2464|    741|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2464:36): [True: 224, False: 517]
  ------------------
 2465|    224|                                {
 2466|    224|                                    au4_idx_l[2] = -1;
 2467|    224|                                    au4_idx_l[4] = -1;
 2468|    224|                                    au4_idx_l[5] = -1;
 2469|    224|                                }
 2470|    517|                                else
 2471|    517|                                {
 2472|    517|                                    au4_idx_l[2] = au4_idx_l[4] = pu1_slice_idx[ctbx_l_t + (ctby_l_t * ps_sps->i2_pic_wd_in_ctb)];
 2473|    517|                                    au4_idx_l[5] =  pu1_slice_idx[ctbx_l_t + 1 + (ctby_l_t  * ps_sps->i2_pic_wd_in_ctb)];
 2474|    517|                                }
 2475|    741|                                idx_l   = au4_idx_l[6] = pu1_slice_idx[ctbx_l + (ctby_l * ps_sps->i2_pic_wd_in_ctb)];
 2476|    741|                                au4_idx_l[0] = pu1_slice_idx[ctbx_l_l + (ctby_l_l * ps_sps->i2_pic_wd_in_ctb)];
 2477|    741|                                au4_idx_l[1] = au4_idx_l[7] = pu1_slice_idx[ctbx_l_r + (ctby_l_r * ps_sps->i2_pic_wd_in_ctb)];
 2478|    741|                                au4_idx_l[3] = pu1_slice_idx[ctbx_l_d + (ctby_l_d * ps_sps->i2_pic_wd_in_ctb)];
 2479|       |
 2480|       |                                /*Verify that the neighbour ctbs dont cross pic boundary.*/
 2481|    741|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2481:36): [True: 224, False: 517]
  ------------------
 2482|    224|                                {
 2483|    224|                                    au4_ilf_across_tile_slice_enable[2] = 0;
 2484|    224|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 2485|    224|                                    au4_ilf_across_tile_slice_enable[5] = 0;
 2486|    224|                                }
 2487|    517|                                else
 2488|    517|                                {
 2489|    517|                                    au4_ilf_across_tile_slice_enable[2] =  (ps_slice_hdr_base + idx_l)->i1_slice_loop_filter_across_slices_enabled_flag;
 2490|    517|                                    au4_ilf_across_tile_slice_enable[5] = au4_ilf_across_tile_slice_enable[4] = au4_ilf_across_tile_slice_enable[2];
 2491|    517|                                }
 2492|       |
 2493|    741|                                if(au4_idx_l[5] > idx_l)
  ------------------
  |  Branch (2493:36): [True: 309, False: 432]
  ------------------
 2494|    309|                                {
 2495|    309|                                    au4_ilf_across_tile_slice_enable[5] = (ps_slice_hdr_base + au4_idx_l[5])->i1_slice_loop_filter_across_slices_enabled_flag;
 2496|    309|                                }
 2497|       |
 2498|       |                                //  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;
 2499|    741|                                au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_l[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 2500|    741|                                au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_l[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 2501|    741|                                au4_ilf_across_tile_slice_enable[7] = (ps_slice_hdr_base + au4_idx_l[7])->i1_slice_loop_filter_across_slices_enabled_flag;
 2502|       |                                /*
 2503|       |                                 * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
 2504|       |                                 * of the pixel having a greater address is checked. Accordingly, set the availability flags
 2505|       |                                 */
 2506|  6.66k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2506:44): [True: 5.92k, False: 741]
  ------------------
 2507|  5.92k|                                {
 2508|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 2509|  5.92k|                                    if(au4_idx_l[i] != idx_l)
  ------------------
  |  Branch (2509:40): [True: 1.83k, False: 4.09k]
  ------------------
 2510|  1.83k|                                    {
 2511|  1.83k|                                        au1_tile_slice_boundary[i] = 1;
 2512|  1.83k|                                    }
 2513|  4.09k|                                    else
 2514|  4.09k|                                    {
 2515|  4.09k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 2516|  4.09k|                                    }
 2517|  5.92k|                                }
 2518|       |                                /*Reset indices*/
 2519|  6.66k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2519:44): [True: 5.92k, False: 741]
  ------------------
 2520|  5.92k|                                {
 2521|  5.92k|                                    au4_idx_l[i] = 0;
 2522|  5.92k|                                }
 2523|    741|                            }
 2524|  2.04k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (2524:32): [True: 1.70k, False: 345]
  ------------------
 2525|  1.70k|                            {
 2526|       |                                /* Calculate availability flags at slice boundary */
 2527|  1.70k|                                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 (2527:37): [True: 1.01k, False: 682]
  |  Branch (2527:85): [True: 451, False: 231]
  |  Branch (2527:137): [True: 411, False: 1.05k]
  |  Branch (2527:165): [True: 162, False: 249]
  ------------------
 2528|  1.30k|                                {
 2529|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 2530|  1.30k|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (2530:40): [True: 895, False: 413]
  ------------------
 2531|    895|                                    {
 2532|    895|                                        if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2532:44): [True: 466, False: 429]
  ------------------
 2533|    466|                                        {
 2534|    466|                                            au4_idx_l[2] = -1;
 2535|    466|                                            au4_idx_l[4] = -1;
 2536|    466|                                            au4_idx_l[5] = -1;
 2537|    466|                                        }
 2538|    429|                                        else
 2539|    429|                                        {
 2540|    429|                                            au4_idx_l[2] = au4_idx_l[4] = pu1_tile_idx[ctbx_l_t + (ctby_l_t * ps_sps->i2_pic_wd_in_ctb)];
 2541|    429|                                            au4_idx_l[5] =  pu1_tile_idx[ctbx_l_t + 1 + (ctby_l_t  * ps_sps->i2_pic_wd_in_ctb)];
 2542|    429|                                        }
 2543|       |
 2544|    895|                                        idx_l   = au4_idx_l[6] = pu1_tile_idx[ctbx_l + (ctby_l * ps_sps->i2_pic_wd_in_ctb)];
 2545|    895|                                        au4_idx_l[0] = pu1_tile_idx[ctbx_l_l + (ctby_l_l * ps_sps->i2_pic_wd_in_ctb)];
 2546|    895|                                        au4_idx_l[1] = au4_idx_l[7] = pu1_tile_idx[ctbx_l_r + (ctby_l_r * ps_sps->i2_pic_wd_in_ctb)];
 2547|    895|                                        au4_idx_l[3] = pu1_tile_idx[ctbx_l_d + (ctby_l_d * ps_sps->i2_pic_wd_in_ctb)];
 2548|       |
 2549|  8.05k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2549:52): [True: 7.16k, False: 895]
  ------------------
 2550|  7.16k|                                        {
 2551|       |                                            /*Sets the edges that lie on the slice/tile boundary*/
 2552|  7.16k|                                            if(au4_idx_l[i] != idx_l)
  ------------------
  |  Branch (2552:48): [True: 3.53k, False: 3.62k]
  ------------------
 2553|  3.53k|                                            {
 2554|  3.53k|                                                au1_tile_slice_boundary[i] |= 1;
 2555|  3.53k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag; //=0
 2556|  3.53k|                                            }
 2557|  7.16k|                                        }
 2558|    895|                                    }
 2559|  1.30k|                                }
 2560|  1.70k|                            }
 2561|  18.4k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2561:40): [True: 16.3k, False: 2.04k]
  ------------------
 2562|  16.3k|                            {
 2563|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 2564|  16.3k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (2564:36): [True: 5.37k, False: 10.9k]
  |  Branch (2564:68): [True: 4.20k, False: 1.16k]
  ------------------
 2565|  4.20k|                                {
 2566|  4.20k|                                    au1_avail_chroma[i] = 0;
 2567|  4.20k|                                }
 2568|  16.3k|                            }
 2569|  2.04k|                        }
 2570|   119k|                    }
 2571|   119k|                    if(0 == (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) - sao_wd_chroma)
  ------------------
  |  Branch (2571:24): [True: 2, False: 119k]
  ------------------
 2572|      2|                    {
 2573|      2|                        au1_avail_chroma[0] = 0;
 2574|      2|                        au1_avail_chroma[4] = 0;
 2575|      2|                        au1_avail_chroma[6] = 0;
 2576|      2|                    }
 2577|       |
 2578|   119k|                    if(ps_sps->i2_pic_wd_in_ctb == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2578:24): [True: 0, False: 119k]
  ------------------
 2579|      0|                    {
 2580|      0|                        au1_avail_chroma[1] = 0;
 2581|      0|                        au1_avail_chroma[5] = 0;
 2582|      0|                        au1_avail_chroma[7] = 0;
 2583|      0|                    }
 2584|       |
 2585|   119k|                    if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2585:24): [True: 8.07k, False: 111k]
  ------------------
 2586|  8.07k|                    {
 2587|  8.07k|                        au1_avail_chroma[2] = 0;
 2588|  8.07k|                        au1_avail_chroma[4] = 0;
 2589|  8.07k|                        au1_avail_chroma[5] = 0;
 2590|  8.07k|                    }
 2591|       |
 2592|   119k|                    if(ps_sps->i2_pic_height_in_luma_samples / 2 - (ps_sao_ctxt->i4_ctb_y  << (log2_ctb_size - 1)) <= sao_ht_chroma)
  ------------------
  |  Branch (2592:24): [True: 4.53k, False: 115k]
  ------------------
 2593|  4.53k|                    {
 2594|  4.53k|                        au1_avail_chroma[3] = 0;
 2595|  4.53k|                        au1_avail_chroma[6] = 0;
 2596|  4.53k|                        au1_avail_chroma[7] = 0;
 2597|  4.53k|                    }
 2598|       |
 2599|   119k|                    {
 2600|   119k|                        au1_src_top_right[0] = pu1_src_top_chroma[sao_wd_chroma];
 2601|   119k|                        au1_src_top_right[1] = pu1_src_top_chroma[sao_wd_chroma + 1];
 2602|   119k|                        au1_src_bot_left[0] = pu1_sao_src_top_left_chroma_bot_left[0];
 2603|   119k|                        au1_src_bot_left[1] = pu1_sao_src_top_left_chroma_bot_left[1];
 2604|       |                        //au1_src_bot_left[0] = pu1_src_chroma[sao_ht_chroma * src_strd - 2];
 2605|       |                        //au1_src_bot_left[1] = pu1_src_chroma[sao_ht_chroma * src_strd - 1];
 2606|   119k|                        if((ctb_size == 16) && (ps_sao_ctxt->i4_ctb_x != ps_sps->i2_pic_wd_in_ctb - 1))
  ------------------
  |  Branch (2606:28): [True: 53, False: 119k]
  |  Branch (2606:48): [True: 53, False: 0]
  ------------------
 2607|     53|                        {
 2608|     53|                            au1_src_top_right[0] = pu1_src_chroma[sao_wd_chroma - src_strd];
 2609|     53|                            au1_src_top_right[1] = pu1_src_chroma[sao_wd_chroma - src_strd + 1];
 2610|     53|                        }
 2611|       |
 2612|       |
 2613|   119k|                        if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (2613:28): [True: 49.3k, False: 70.5k]
  ------------------
 2614|  49.3k|                        {
 2615|  49.3k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 2616|  49.3k|                                                                                 src_strd,
 2617|  49.3k|                                                                                 pu1_src_left_chroma,
 2618|  49.3k|                                                                                 pu1_src_top_chroma,
 2619|  49.3k|                                                                                 pu1_sao_src_top_left_chroma_curr_ctb,
 2620|  49.3k|                                                                                 au1_src_top_right,
 2621|  49.3k|                                                                                 au1_src_bot_left,
 2622|  49.3k|                                                                                 au1_avail_chroma,
 2623|  49.3k|                                                                                 ai1_offset_cr,
 2624|  49.3k|                                                                                 ai1_offset_cb,
 2625|  49.3k|                                                                                 sao_wd_chroma,
 2626|  49.3k|                                                                                 sao_ht_chroma);
 2627|  49.3k|                        }
 2628|  70.5k|                        else
 2629|  70.5k|                        {
 2630|  70.5k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 2631|  70.5k|                                                                                 src_strd,
 2632|  70.5k|                                                                                 pu1_src_left_chroma,
 2633|  70.5k|                                                                                 pu1_src_top_chroma,
 2634|  70.5k|                                                                                 pu1_sao_src_top_left_chroma_curr_ctb,
 2635|  70.5k|                                                                                 au1_src_top_right,
 2636|  70.5k|                                                                                 au1_src_bot_left,
 2637|  70.5k|                                                                                 au1_avail_chroma,
 2638|  70.5k|                                                                                 ai1_offset_cb,
 2639|  70.5k|                                                                                 ai1_offset_cr,
 2640|  70.5k|                                                                                 sao_wd_chroma,
 2641|  70.5k|                                                                                 sao_ht_chroma);
 2642|  70.5k|                        }
 2643|   119k|                    }
 2644|       |
 2645|   119k|                }
 2646|   540k|            }
 2647|  2.06M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2647:21): [True: 18.0k, False: 2.04M]
  |  Branch (2647:68): [True: 19.2k, False: 2.02M]
  ------------------
 2648|  37.4k|            {
 2649|   643k|                for(row = 0; row < sao_ht_chroma; row++)
  ------------------
  |  Branch (2649:30): [True: 606k, False: 37.4k]
  ------------------
 2650|   606k|                {
 2651|   606k|                    pu1_src_left_chroma[2 * row] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 2)];
 2652|   606k|                    pu1_src_left_chroma[2 * row + 1] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 1)];
 2653|   606k|                }
 2654|  37.4k|                pu1_sao_src_top_left_chroma_curr_ctb[0] = pu1_src_top_chroma[sao_wd_chroma - 2];
 2655|  37.4k|                pu1_sao_src_top_left_chroma_curr_ctb[1] = pu1_src_top_chroma[sao_wd_chroma - 1];
 2656|       |
 2657|  37.4k|                ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_chroma, &pu1_src_chroma[(sao_ht_chroma - 1) * src_strd], sao_wd_chroma);
 2658|  37.4k|            }
 2659|       |
 2660|  2.60M|        }
 2661|  7.01M|        pu1_src_luma += sao_wd_luma;
 2662|  7.01M|        pu1_src_chroma += sao_wd_chroma;
 2663|  7.01M|        ps_sao += 1;
 2664|  7.01M|    }
 2665|       |
 2666|       |
 2667|       |    /* Current CTB */
 2668|  7.49M|    {
 2669|  7.49M|        WORD32 sao_wd_luma = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
 2670|  7.49M|        WORD32 sao_wd_chroma = ctb_size - SAO_SHIFT_CTB * 2;
  ------------------
  |  |   78|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
 2671|  7.49M|        WORD32 sao_ht_luma = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
 2672|  7.49M|        WORD32 sao_ht_chroma = ctb_size / 2 - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
 2673|  7.49M|        WORD32 ctbx_c_t = 0, ctbx_c_l = 0, ctbx_c_r = 0, ctbx_c_d = 0, ctbx_c = 0;
 2674|  7.49M|        WORD32 ctby_c_t = 0, ctby_c_l = 0, ctby_c_r = 0, ctby_c_d = 0, ctby_c = 0;
 2675|  7.49M|        WORD32 au4_idx_c[8], idx_c;
 2676|       |
 2677|  7.49M|        WORD32 remaining_rows;
 2678|  7.49M|        WORD32 remaining_cols;
 2679|       |
 2680|  7.49M|        remaining_cols = ps_sps->i2_pic_width_in_luma_samples - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) + sao_wd_luma);
 2681|  7.49M|        if(remaining_cols <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (2681:12): [True: 473k, False: 7.01M]
  ------------------
 2682|   473k|        {
 2683|   473k|            sao_wd_luma += remaining_cols;
 2684|   473k|        }
 2685|  7.49M|        remaining_cols = ps_sps->i2_pic_width_in_luma_samples - ((ps_sao_ctxt->i4_ctb_x << log2_ctb_size) + sao_wd_chroma);
 2686|  7.49M|        if(remaining_cols <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (2686:12): [True: 473k, False: 7.01M]
  ------------------
 2687|   473k|        {
 2688|   473k|            sao_wd_chroma += remaining_cols;
 2689|   473k|        }
 2690|       |
 2691|  7.49M|        remaining_rows = ps_sps->i2_pic_height_in_luma_samples - ((ps_sao_ctxt->i4_ctb_y << log2_ctb_size) + sao_ht_luma);
 2692|  7.49M|        if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (2692:12): [True: 283k, False: 7.20M]
  ------------------
 2693|   283k|        {
 2694|   283k|            sao_ht_luma += remaining_rows;
 2695|   283k|        }
 2696|  7.49M|        remaining_rows = ps_sps->i2_pic_height_in_luma_samples / 2 - ((ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 1)) + sao_ht_chroma);
 2697|  7.49M|        if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  7.49M|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (2697:12): [True: 283k, False: 7.20M]
  ------------------
 2698|   283k|        {
 2699|   283k|            sao_ht_chroma += remaining_rows;
 2700|   283k|        }
 2701|       |
 2702|  7.49M|        pu1_src_top_luma = ps_sao_ctxt->pu1_sao_src_top_luma + (ps_sao_ctxt->i4_ctb_x << log2_ctb_size);
 2703|  7.49M|        pu1_src_top_chroma = ps_sao_ctxt->pu1_sao_src_top_chroma + (ps_sao_ctxt->i4_ctb_x << log2_ctb_size);
 2704|  7.49M|        pu1_src_left_luma = ps_sao_ctxt->pu1_sao_src_left_luma + (ps_sao_ctxt->i4_ctb_y << log2_ctb_size);
 2705|  7.49M|        pu1_src_left_chroma = ps_sao_ctxt->pu1_sao_src_left_chroma + (ps_sao_ctxt->i4_ctb_y << log2_ctb_size);
 2706|       |
 2707|  7.49M|        if((0 != sao_wd_luma) && (0 != sao_ht_luma))
  ------------------
  |  Branch (2707:12): [True: 7.49M, False: 174]
  |  Branch (2707:34): [True: 7.49M, False: 18.4E]
  ------------------
 2708|  7.49M|        {
 2709|  7.49M|            if(ps_sao_ctxt->ps_slice_hdr->i1_slice_sao_luma_flag)
  ------------------
  |  Branch (2709:16): [True: 2.88M, False: 4.60M]
  ------------------
 2710|  2.88M|            {
 2711|  2.88M|                if(0 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (2711:20): [True: 2.61M, False: 276k]
  ------------------
 2712|  2.61M|                {
 2713|       |                    /* Update left, top and top-left */
 2714|  34.6M|                    for(row = 0; row < sao_ht_luma; row++)
  ------------------
  |  Branch (2714:34): [True: 32.0M, False: 2.61M]
  ------------------
 2715|  32.0M|                    {
 2716|  32.0M|                        pu1_src_left_luma[row] = pu1_src_luma[row * src_strd + (sao_wd_luma - 1)];
 2717|  32.0M|                    }
 2718|  2.61M|                    pu1_sao_src_top_left_luma_curr_ctb[0] = pu1_src_top_luma[sao_wd_luma - 1];
 2719|       |
 2720|  2.61M|                    ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_luma, &pu1_src_luma[(sao_ht_luma - 1) * src_strd], sao_wd_luma);
 2721|       |
 2722|  2.61M|                    pu1_sao_src_top_left_luma_top_right[0] = pu1_src_luma[(sao_ht_luma - 1) * src_strd + sao_wd_luma];
 2723|       |
 2724|  2.61M|                }
 2725|       |
 2726|   276k|                else if(1 == ps_sao->b3_y_type_idx)
  ------------------
  |  Branch (2726:25): [True: 137k, False: 138k]
  ------------------
 2727|   137k|                {
 2728|   137k|                    ai1_offset_y[1] = ps_sao->b4_y_offset_1;
 2729|   137k|                    ai1_offset_y[2] = ps_sao->b4_y_offset_2;
 2730|   137k|                    ai1_offset_y[3] = ps_sao->b4_y_offset_3;
 2731|   137k|                    ai1_offset_y[4] = ps_sao->b4_y_offset_4;
 2732|       |
 2733|   137k|                    ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr(pu1_src_luma,
 2734|   137k|                                                                              src_strd,
 2735|   137k|                                                                              pu1_src_left_luma,
 2736|   137k|                                                                              pu1_src_top_luma,
 2737|   137k|                                                                              pu1_sao_src_top_left_luma_curr_ctb,
 2738|   137k|                                                                              ps_sao->b5_y_band_pos,
 2739|   137k|                                                                              ai1_offset_y,
 2740|   137k|                                                                              sao_wd_luma,
 2741|   137k|                                                                              sao_ht_luma
 2742|   137k|                                                                             );
 2743|   137k|                }
 2744|       |
 2745|   138k|                else // if(2 <= ps_sao->b3_y_type_idx)
 2746|   138k|                {
 2747|   138k|                    ai1_offset_y[1] = ps_sao->b4_y_offset_1;
 2748|   138k|                    ai1_offset_y[2] = ps_sao->b4_y_offset_2;
 2749|   138k|                    ai1_offset_y[3] = ps_sao->b4_y_offset_3;
 2750|   138k|                    ai1_offset_y[4] = ps_sao->b4_y_offset_4;
 2751|       |
 2752|  1.24M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2752:32): [True: 1.10M, False: 138k]
  ------------------
 2753|  1.10M|                    {
 2754|  1.10M|                        au1_avail_luma[i] = 255;
 2755|  1.10M|                        au1_tile_slice_boundary[i] = 0;
 2756|  1.10M|                        au4_idx_c[i] = 0;
 2757|  1.10M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 2758|  1.10M|                    }
 2759|       |                    /******************************************************************
 2760|       |                     * Derive the  Top-left CTB's neighbour pixel's slice indices.
 2761|       |                     *
 2762|       |                     *
 2763|       |                     *          ____________
 2764|       |                     *         |    |       |
 2765|       |                     *         |    | C_T   |
 2766|       |                     *         |____|_______|____
 2767|       |                     *         |    |       |    |
 2768|       |                     *         | C_L|   C   | C_R|
 2769|       |                     *         |____|_______|    |
 2770|       |                     *              |  C_D       |
 2771|       |                     *              |            |
 2772|       |                     *              |____________|
 2773|       |                     *
 2774|       |                     *****************************************************************/
 2775|       |
 2776|       |                    /*In case of slices*/
 2777|   138k|                    {
 2778|   138k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2778:28): [True: 110, False: 138k]
  |  Branch (2778:75): [True: 2.59k, False: 135k]
  ------------------
 2779|  2.83k|                        {
 2780|  2.83k|                            ctbx_c_t = ps_sao_ctxt->i4_ctb_x;
 2781|  2.83k|                            ctby_c_t = ps_sao_ctxt->i4_ctb_y - 1;
 2782|       |
 2783|  2.83k|                            ctbx_c_l = ps_sao_ctxt->i4_ctb_x - 1;
 2784|  2.83k|                            ctby_c_l = ps_sao_ctxt->i4_ctb_y;
 2785|       |
 2786|  2.83k|                            ctbx_c_r = ps_sao_ctxt->i4_ctb_x;
 2787|  2.83k|                            ctby_c_r = ps_sao_ctxt->i4_ctb_y;
 2788|       |
 2789|  2.83k|                            ctbx_c_d =  ps_sao_ctxt->i4_ctb_x;
 2790|  2.83k|                            ctby_c_d =  ps_sao_ctxt->i4_ctb_y;
 2791|       |
 2792|  2.83k|                            ctbx_c = ps_sao_ctxt->i4_ctb_x;
 2793|  2.83k|                            ctby_c = ps_sao_ctxt->i4_ctb_y;
 2794|       |
 2795|  2.83k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (2795:32): [True: 235, False: 2.59k]
  ------------------
 2796|    235|                            {
 2797|    235|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2797:36): [True: 6, False: 229]
  ------------------
 2798|      6|                                {
 2799|      6|                                    au4_idx_c[6] = -1;
 2800|      6|                                    au4_idx_c[0] = -1;
 2801|      6|                                    au4_idx_c[4] = -1;
 2802|      6|                                }
 2803|    229|                                else
 2804|    229|                                {
 2805|    229|                                    au4_idx_c[0] =  au4_idx_c[6] = pu1_slice_idx[ctbx_c_l + (ctby_c_l * ps_sps->i2_pic_wd_in_ctb)];
 2806|    229|                                }
 2807|       |
 2808|    235|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2808:36): [True: 86, False: 149]
  ------------------
 2809|     86|                                {
 2810|     86|                                    au4_idx_c[2] = -1;
 2811|     86|                                    au4_idx_c[5] = -1;
 2812|     86|                                    au4_idx_c[4] = -1;
 2813|     86|                                }
 2814|    149|                                else
 2815|    149|                                {
 2816|    149|                                    au4_idx_c[4] =  pu1_slice_idx[ctbx_c_t - 1 + (ctby_c_t  * ps_sps->i2_pic_wd_in_ctb)];
 2817|    149|                                    au4_idx_c[2] = au4_idx_c[5] = pu1_slice_idx[ctbx_c_t + (ctby_c_t * ps_sps->i2_pic_wd_in_ctb)];
 2818|    149|                                }
 2819|    235|                                idx_c   = pu1_slice_idx[ctbx_c + (ctby_c * ps_sps->i2_pic_wd_in_ctb)];
 2820|    235|                                au4_idx_c[1] = au4_idx_c[7] = pu1_slice_idx[ctbx_c_r + (ctby_c_r * ps_sps->i2_pic_wd_in_ctb)];
 2821|    235|                                au4_idx_c[3] = pu1_slice_idx[ctbx_c_d + (ctby_c_d * ps_sps->i2_pic_wd_in_ctb)];
 2822|       |
 2823|    235|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2823:36): [True: 6, False: 229]
  ------------------
 2824|      6|                                {
 2825|      6|                                    au4_ilf_across_tile_slice_enable[6] = 0;
 2826|      6|                                    au4_ilf_across_tile_slice_enable[0] = 0;
 2827|      6|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 2828|      6|                                }
 2829|    229|                                else
 2830|    229|                                {
 2831|    229|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + au4_idx_c[6])->i1_slice_loop_filter_across_slices_enabled_flag;
 2832|    229|                                    au4_ilf_across_tile_slice_enable[0] = (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;;
 2833|    229|                                }
 2834|    235|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2834:36): [True: 86, False: 149]
  ------------------
 2835|     86|                                {
 2836|     86|                                    au4_ilf_across_tile_slice_enable[2] = 0;
 2837|     86|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 2838|     86|                                    au4_ilf_across_tile_slice_enable[5] = 0;
 2839|     86|                                }
 2840|    149|                                else
 2841|    149|                                {
 2842|    149|                                    au4_ilf_across_tile_slice_enable[2] = (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;
 2843|    149|                                    au4_ilf_across_tile_slice_enable[5] = au4_ilf_across_tile_slice_enable[4] = au4_ilf_across_tile_slice_enable[2];
 2844|    149|                                }
 2845|    235|                                au4_ilf_across_tile_slice_enable[1] = (ps_slice_hdr_base + au4_idx_c[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 2846|    235|                                au4_ilf_across_tile_slice_enable[3] = (ps_slice_hdr_base + au4_idx_c[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 2847|    235|                                au4_ilf_across_tile_slice_enable[7] = (ps_slice_hdr_base + au4_idx_c[7])->i1_slice_loop_filter_across_slices_enabled_flag;
 2848|       |
 2849|    235|                                if(au4_idx_c[6] < idx_c)
  ------------------
  |  Branch (2849:36): [True: 52, False: 183]
  ------------------
 2850|     52|                                {
 2851|     52|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;
 2852|     52|                                }
 2853|       |
 2854|       |                                /*
 2855|       |                                 * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
 2856|       |                                 * of the pixel having a greater address is checked. Accordingly, set the availability flags
 2857|       |                                 */
 2858|  2.11k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2858:44): [True: 1.88k, False: 235]
  ------------------
 2859|  1.88k|                                {
 2860|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 2861|  1.88k|                                    if(au4_idx_c[i] != idx_c)
  ------------------
  |  Branch (2861:40): [True: 536, False: 1.34k]
  ------------------
 2862|    536|                                    {
 2863|    536|                                        au1_tile_slice_boundary[i] = 1;
 2864|    536|                                    }
 2865|  1.34k|                                    else
 2866|  1.34k|                                    {
 2867|  1.34k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 2868|  1.34k|                                    }
 2869|  1.88k|                                }
 2870|       |                                /*Reset indices*/
 2871|  2.11k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2871:44): [True: 1.88k, False: 235]
  ------------------
 2872|  1.88k|                                {
 2873|  1.88k|                                    au4_idx_c[i] = 0;
 2874|  1.88k|                                }
 2875|    235|                            }
 2876|       |
 2877|  2.83k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (2877:32): [True: 2.59k, False: 235]
  ------------------
 2878|  2.59k|                            {
 2879|       |                                /* Calculate availability flags at slice boundary */
 2880|  2.59k|                                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 (2880:37): [True: 666, False: 1.93k]
  |  Branch (2880:85): [True: 1.35k, False: 573]
  |  Branch (2880:137): [True: 2.02k, False: 2]
  |  Branch (2880:165): [True: 1.17k, False: 847]
  ------------------
 2881|    849|                                {
 2882|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 2883|    849|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (2883:40): [True: 847, False: 2]
  ------------------
 2884|    847|                                    {
 2885|    847|                                        if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2885:44): [True: 160, False: 687]
  ------------------
 2886|    160|                                        {
 2887|    160|                                            au4_idx_c[6] = -1;
 2888|    160|                                            au4_idx_c[0] = -1;
 2889|    160|                                            au4_idx_c[4] = -1;
 2890|    160|                                        }
 2891|    687|                                        else
 2892|    687|                                        {
 2893|    687|                                            au4_idx_c[0] =  au4_idx_c[6] = pu1_tile_idx[ctbx_c_l + (ctby_c_l * ps_sps->i2_pic_wd_in_ctb)];
 2894|    687|                                        }
 2895|       |
 2896|    847|                                        if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2896:44): [True: 0, False: 847]
  ------------------
 2897|      0|                                        {
 2898|      0|                                            au4_idx_c[2] = -1;
 2899|      0|                                            au4_idx_c[5] = -1;
 2900|      0|                                            au4_idx_c[4] = -1;
 2901|      0|                                        }
 2902|    847|                                        else
 2903|    847|                                        {
 2904|    847|                                            au4_idx_c[4] =  pu1_tile_idx[ctbx_c_t - 1 + (ctby_c_t  * ps_sps->i2_pic_wd_in_ctb)];
 2905|    847|                                            au4_idx_c[2] = au4_idx_c[5] = pu1_tile_idx[ctbx_c_t + (ctby_c_t * ps_sps->i2_pic_wd_in_ctb)];
 2906|    847|                                        }
 2907|    847|                                        idx_c   = pu1_tile_idx[ctbx_c + (ctby_c * ps_sps->i2_pic_wd_in_ctb)];
 2908|    847|                                        au4_idx_c[1] = au4_idx_c[7] = pu1_tile_idx[ctbx_c_r + (ctby_c_r * ps_sps->i2_pic_wd_in_ctb)];
 2909|    847|                                        au4_idx_c[3] = pu1_tile_idx[ctbx_c_d + (ctby_c_d * ps_sps->i2_pic_wd_in_ctb)];
 2910|       |
 2911|  7.62k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2911:52): [True: 6.77k, False: 847]
  ------------------
 2912|  6.77k|                                        {
 2913|       |                                            /*Sets the edges that lie on the slice/tile boundary*/
 2914|  6.77k|                                            if(au4_idx_c[i] != idx_c)
  ------------------
  |  Branch (2914:48): [True: 2.63k, False: 4.14k]
  ------------------
 2915|  2.63k|                                            {
 2916|  2.63k|                                                au1_tile_slice_boundary[i] |= 1;
 2917|  2.63k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag; //=0
 2918|  2.63k|                                            }
 2919|  6.77k|                                        }
 2920|    847|                                    }
 2921|    849|                                }
 2922|  2.59k|                            }
 2923|       |
 2924|  25.4k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (2924:40): [True: 22.6k, False: 2.83k]
  ------------------
 2925|  22.6k|                            {
 2926|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 2927|  22.6k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (2927:36): [True: 3.17k, False: 19.4k]
  |  Branch (2927:68): [True: 2.94k, False: 230]
  ------------------
 2928|  2.94k|                                {
 2929|  2.94k|                                    au1_avail_luma[i] = 0;
 2930|  2.94k|                                }
 2931|  22.6k|                            }
 2932|       |
 2933|  2.83k|                        }
 2934|   138k|                    }
 2935|   138k|                    if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (2935:24): [True: 9.62k, False: 128k]
  ------------------
 2936|  9.62k|                    {
 2937|  9.62k|                        au1_avail_luma[0] = 0;
 2938|  9.62k|                        au1_avail_luma[4] = 0;
 2939|  9.62k|                        au1_avail_luma[6] = 0;
 2940|  9.62k|                    }
 2941|       |
 2942|   138k|                    if(ps_sps->i2_pic_width_in_luma_samples - (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) <= sao_wd_luma)
  ------------------
  |  Branch (2942:24): [True: 9.39k, False: 129k]
  ------------------
 2943|  9.39k|                    {
 2944|  9.39k|                        au1_avail_luma[1] = 0;
 2945|  9.39k|                        au1_avail_luma[5] = 0;
 2946|  9.39k|                        au1_avail_luma[7] = 0;
 2947|  9.39k|                    }
 2948|       |
 2949|   138k|                    if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (2949:24): [True: 14.6k, False: 123k]
  ------------------
 2950|  14.6k|                    {
 2951|  14.6k|                        au1_avail_luma[2] = 0;
 2952|  14.6k|                        au1_avail_luma[4] = 0;
 2953|  14.6k|                        au1_avail_luma[5] = 0;
 2954|  14.6k|                    }
 2955|       |
 2956|   138k|                    if(ps_sps->i2_pic_height_in_luma_samples - (ps_sao_ctxt->i4_ctb_y  << log2_ctb_size) <= sao_ht_luma)
  ------------------
  |  Branch (2956:24): [True: 4.47k, False: 133k]
  ------------------
 2957|  4.47k|                    {
 2958|  4.47k|                        au1_avail_luma[3] = 0;
 2959|  4.47k|                        au1_avail_luma[6] = 0;
 2960|  4.47k|                        au1_avail_luma[7] = 0;
 2961|  4.47k|                    }
 2962|       |
 2963|   138k|                    {
 2964|   138k|                        au1_src_top_right[0] = pu1_src_luma[sao_wd_luma - src_strd];
 2965|   138k|                        u1_sao_src_top_left_luma_bot_left = pu1_src_luma[sao_ht_luma * src_strd - 1];
 2966|       |
 2967|   138k|                        ps_codec->apf_sao_luma[ps_sao->b3_y_type_idx - 2](pu1_src_luma,
 2968|   138k|                                                                          src_strd,
 2969|   138k|                                                                          pu1_src_left_luma,
 2970|   138k|                                                                          pu1_src_top_luma,
 2971|   138k|                                                                          pu1_sao_src_top_left_luma_curr_ctb,
 2972|   138k|                                                                          au1_src_top_right,
 2973|   138k|                                                                          &u1_sao_src_top_left_luma_bot_left,
 2974|   138k|                                                                          au1_avail_luma,
 2975|   138k|                                                                          ai1_offset_y,
 2976|   138k|                                                                          sao_wd_luma,
 2977|   138k|                                                                          sao_ht_luma);
 2978|   138k|                    }
 2979|   138k|                    pu1_sao_src_top_left_luma_top_right[0] = pu1_src_luma[(sao_ht_luma - 1) * src_strd + sao_wd_luma];
 2980|   138k|                    pu1_sao_src_top_left_luma_bot_left[0] = pu1_src_luma[(sao_ht_luma)*src_strd + sao_wd_luma - 1];
 2981|   138k|                }
 2982|  2.88M|            }
 2983|  4.60M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (2983:21): [True: 2.20M, False: 2.39M]
  |  Branch (2983:68): [True: 23.7k, False: 2.37M]
  ------------------
 2984|  2.23M|            {
 2985|       |                /* Update left, top and top-left */
 2986|  21.4M|                for(row = 0; row < sao_ht_luma; row++)
  ------------------
  |  Branch (2986:30): [True: 19.2M, False: 2.23M]
  ------------------
 2987|  19.2M|                {
 2988|  19.2M|                    pu1_src_left_luma[row] = pu1_src_luma[row * src_strd + (sao_wd_luma - 1)];
 2989|  19.2M|                }
 2990|  2.23M|                pu1_sao_src_top_left_luma_curr_ctb[0] = pu1_src_top_luma[sao_wd_luma - 1];
 2991|       |
 2992|  2.23M|                ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_luma, &pu1_src_luma[(sao_ht_luma - 1) * src_strd], sao_wd_luma);
 2993|       |
 2994|  2.23M|                pu1_sao_src_top_left_luma_top_right[0] = pu1_src_luma[(sao_ht_luma - 1) * src_strd + sao_wd_luma];
 2995|  2.23M|            }
 2996|  7.49M|        }
 2997|       |
 2998|  7.49M|        if((0 != sao_wd_chroma) && (0 != sao_ht_chroma))
  ------------------
  |  Branch (2998:12): [True: 3.04M, False: 4.44M]
  |  Branch (2998:36): [True: 2.71M, False: 336k]
  ------------------
 2999|  2.71M|        {
 3000|  2.71M|            if(ps_sao_ctxt->ps_slice_hdr->i1_slice_sao_chroma_flag)
  ------------------
  |  Branch (3000:16): [True: 561k, False: 2.15M]
  ------------------
 3001|   561k|            {
 3002|   561k|                if(0 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (3002:20): [True: 293k, False: 267k]
  ------------------
 3003|   293k|                {
 3004|  6.29M|                    for(row = 0; row < sao_ht_chroma; row++)
  ------------------
  |  Branch (3004:34): [True: 6.00M, False: 293k]
  ------------------
 3005|  6.00M|                    {
 3006|  6.00M|                        pu1_src_left_chroma[2 * row] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 2)];
 3007|  6.00M|                        pu1_src_left_chroma[2 * row + 1] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 1)];
 3008|  6.00M|                    }
 3009|   293k|                    pu1_sao_src_top_left_chroma_curr_ctb[0] = pu1_src_top_chroma[sao_wd_chroma - 2];
 3010|   293k|                    pu1_sao_src_top_left_chroma_curr_ctb[1] = pu1_src_top_chroma[sao_wd_chroma - 1];
 3011|       |
 3012|   293k|                    ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_chroma, &pu1_src_chroma[(sao_ht_chroma - 1) * src_strd], sao_wd_chroma);
 3013|       |
 3014|   293k|                    pu1_sao_src_top_left_chroma_top_right[0] = pu1_src_chroma[(sao_ht_chroma - 1) * src_strd + sao_wd_chroma];
 3015|   293k|                    pu1_sao_src_top_left_chroma_top_right[1] = pu1_src_chroma[(sao_ht_chroma - 1) * src_strd + sao_wd_chroma + 1];
 3016|   293k|                }
 3017|       |
 3018|   267k|                else if(1 == ps_sao->b3_cb_type_idx)
  ------------------
  |  Branch (3018:25): [True: 141k, False: 126k]
  ------------------
 3019|   141k|                {
 3020|   141k|                    ai1_offset_cb[1] = ps_sao->b4_cb_offset_1;
 3021|   141k|                    ai1_offset_cb[2] = ps_sao->b4_cb_offset_2;
 3022|   141k|                    ai1_offset_cb[3] = ps_sao->b4_cb_offset_3;
 3023|   141k|                    ai1_offset_cb[4] = ps_sao->b4_cb_offset_4;
 3024|       |
 3025|   141k|                    ai1_offset_cr[1] = ps_sao->b4_cr_offset_1;
 3026|   141k|                    ai1_offset_cr[2] = ps_sao->b4_cr_offset_2;
 3027|   141k|                    ai1_offset_cr[3] = ps_sao->b4_cr_offset_3;
 3028|   141k|                    ai1_offset_cr[4] = ps_sao->b4_cr_offset_4;
 3029|       |
 3030|   141k|                    if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (3030:24): [True: 59.8k, False: 81.2k]
  ------------------
 3031|  59.8k|                    {
 3032|  59.8k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(pu1_src_chroma,
 3033|  59.8k|                                                                                    src_strd,
 3034|  59.8k|                                                                                    pu1_src_left_chroma,
 3035|  59.8k|                                                                                    pu1_src_top_chroma,
 3036|  59.8k|                                                                                    pu1_sao_src_top_left_chroma_curr_ctb,
 3037|  59.8k|                                                                                    ps_sao->b5_cr_band_pos,
 3038|  59.8k|                                                                                    ps_sao->b5_cb_band_pos,
 3039|  59.8k|                                                                                    ai1_offset_cr,
 3040|  59.8k|                                                                                    ai1_offset_cb,
 3041|  59.8k|                                                                                    sao_wd_chroma,
 3042|  59.8k|                                                                                    sao_ht_chroma
 3043|  59.8k|                                                                                   );
 3044|  59.8k|                    }
 3045|  81.2k|                    else
 3046|  81.2k|                    {
 3047|  81.2k|                        ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr(pu1_src_chroma,
 3048|  81.2k|                                                                                    src_strd,
 3049|  81.2k|                                                                                    pu1_src_left_chroma,
 3050|  81.2k|                                                                                    pu1_src_top_chroma,
 3051|  81.2k|                                                                                    pu1_sao_src_top_left_chroma_curr_ctb,
 3052|  81.2k|                                                                                    ps_sao->b5_cb_band_pos,
 3053|  81.2k|                                                                                    ps_sao->b5_cr_band_pos,
 3054|  81.2k|                                                                                    ai1_offset_cb,
 3055|  81.2k|                                                                                    ai1_offset_cr,
 3056|  81.2k|                                                                                    sao_wd_chroma,
 3057|  81.2k|                                                                                    sao_ht_chroma
 3058|  81.2k|                                                                                   );
 3059|  81.2k|                    }
 3060|   141k|                }
 3061|       |
 3062|   126k|                else // if(2 <= ps_sao->b3_cb_type_idx)
 3063|   126k|                {
 3064|   126k|                    ai1_offset_cb[1] = ps_sao->b4_cb_offset_1;
 3065|   126k|                    ai1_offset_cb[2] = ps_sao->b4_cb_offset_2;
 3066|   126k|                    ai1_offset_cb[3] = ps_sao->b4_cb_offset_3;
 3067|   126k|                    ai1_offset_cb[4] = ps_sao->b4_cb_offset_4;
 3068|       |
 3069|   126k|                    ai1_offset_cr[1] = ps_sao->b4_cr_offset_1;
 3070|   126k|                    ai1_offset_cr[2] = ps_sao->b4_cr_offset_2;
 3071|   126k|                    ai1_offset_cr[3] = ps_sao->b4_cr_offset_3;
 3072|   126k|                    ai1_offset_cr[4] = ps_sao->b4_cr_offset_4;
 3073|       |
 3074|  1.14M|                    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (3074:32): [True: 1.01M, False: 126k]
  ------------------
 3075|  1.01M|                    {
 3076|  1.01M|                        au1_avail_chroma[i] = 255;
 3077|  1.01M|                        au1_tile_slice_boundary[i] = 0;
 3078|  1.01M|                        au4_idx_c[i] = 0;
 3079|  1.01M|                        au4_ilf_across_tile_slice_enable[i] = 1;
 3080|  1.01M|                    }
 3081|   126k|                    {
 3082|   126k|                        if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (3082:28): [True: 343, False: 126k]
  |  Branch (3082:75): [True: 1.78k, False: 124k]
  ------------------
 3083|  2.26k|                        {
 3084|  2.26k|                            ctbx_c_t = ps_sao_ctxt->i4_ctb_x;
 3085|  2.26k|                            ctby_c_t = ps_sao_ctxt->i4_ctb_y - 1;
 3086|       |
 3087|  2.26k|                            ctbx_c_l = ps_sao_ctxt->i4_ctb_x - 1;
 3088|  2.26k|                            ctby_c_l = ps_sao_ctxt->i4_ctb_y;
 3089|       |
 3090|  2.26k|                            ctbx_c_r = ps_sao_ctxt->i4_ctb_x;
 3091|  2.26k|                            ctby_c_r = ps_sao_ctxt->i4_ctb_y;
 3092|       |
 3093|  2.26k|                            ctbx_c_d =  ps_sao_ctxt->i4_ctb_x;
 3094|  2.26k|                            ctby_c_d =  ps_sao_ctxt->i4_ctb_y;
 3095|       |
 3096|  2.26k|                            ctbx_c = ps_sao_ctxt->i4_ctb_x;
 3097|  2.26k|                            ctby_c = ps_sao_ctxt->i4_ctb_y;
 3098|       |
 3099|  2.26k|                            if(!ps_slice_hdr->i1_first_slice_in_pic_flag)
  ------------------
  |  Branch (3099:32): [True: 475, False: 1.78k]
  ------------------
 3100|    475|                            {
 3101|    475|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (3101:36): [True: 5, False: 470]
  ------------------
 3102|      5|                                {
 3103|      5|                                    au4_idx_c[0] = -1;
 3104|      5|                                    au4_idx_c[4] = -1;
 3105|      5|                                    au4_idx_c[6] = -1;
 3106|      5|                                }
 3107|    470|                                else
 3108|    470|                                {
 3109|    470|                                    au4_idx_c[0] =  au4_idx_c[6] = pu1_slice_idx[ctbx_c_l + (ctby_c_l * ps_sps->i2_pic_wd_in_ctb)];
 3110|    470|                                }
 3111|       |
 3112|    475|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (3112:36): [True: 134, False: 341]
  ------------------
 3113|    134|                                {
 3114|    134|                                    au4_idx_c[2] = -1;
 3115|    134|                                    au4_idx_c[4] = -1;
 3116|    134|                                    au4_idx_c[5] = -1;
 3117|    134|                                }
 3118|    341|                                else
 3119|    341|                                {
 3120|    341|                                    au4_idx_c[2] = au4_idx_c[5] = pu1_slice_idx[ctbx_c_t + (ctby_c_t * ps_sps->i2_pic_wd_in_ctb)];
 3121|    341|                                    au4_idx_c[4] =  pu1_slice_idx[ctbx_c_t - 1 + (ctby_c_t  * ps_sps->i2_pic_wd_in_ctb)];
 3122|    341|                                }
 3123|    475|                                idx_c = pu1_slice_idx[ctbx_c + (ctby_c * ps_sps->i2_pic_wd_in_ctb)];
 3124|    475|                                au4_idx_c[1] = au4_idx_c[7] = pu1_slice_idx[ctbx_c_r + (ctby_c_r * ps_sps->i2_pic_wd_in_ctb)];
 3125|    475|                                au4_idx_c[3] = pu1_slice_idx[ctbx_c_d + (ctby_c_d * ps_sps->i2_pic_wd_in_ctb)];
 3126|       |
 3127|    475|                                if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (3127:36): [True: 5, False: 470]
  ------------------
 3128|      5|                                {
 3129|      5|                                    au4_ilf_across_tile_slice_enable[0] = 0;
 3130|      5|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 3131|      5|                                    au4_ilf_across_tile_slice_enable[6] = 0;
 3132|      5|                                }
 3133|    470|                                else
 3134|    470|                                {
 3135|    470|                                    au4_ilf_across_tile_slice_enable[6] &= (ps_slice_hdr_base + au4_idx_c[6])->i1_slice_loop_filter_across_slices_enabled_flag;
 3136|    470|                                    au4_ilf_across_tile_slice_enable[0] &= (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;
 3137|    470|                                }
 3138|       |
 3139|    475|                                if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (3139:36): [True: 134, False: 341]
  ------------------
 3140|    134|                                {
 3141|    134|                                    au4_ilf_across_tile_slice_enable[2] = 0;
 3142|    134|                                    au4_ilf_across_tile_slice_enable[4] = 0;
 3143|    134|                                    au4_ilf_across_tile_slice_enable[5] = 0;
 3144|    134|                                }
 3145|    341|                                else
 3146|    341|                                {
 3147|    341|                                    au4_ilf_across_tile_slice_enable[2] &= (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;
 3148|    341|                                    au4_ilf_across_tile_slice_enable[5] = au4_ilf_across_tile_slice_enable[4] = au4_ilf_across_tile_slice_enable[2];
 3149|    341|                                }
 3150|       |
 3151|    475|                                au4_ilf_across_tile_slice_enable[1] &= (ps_slice_hdr_base + au4_idx_c[1])->i1_slice_loop_filter_across_slices_enabled_flag;
 3152|    475|                                au4_ilf_across_tile_slice_enable[3] &= (ps_slice_hdr_base + au4_idx_c[3])->i1_slice_loop_filter_across_slices_enabled_flag;
 3153|    475|                                au4_ilf_across_tile_slice_enable[7] &= (ps_slice_hdr_base + au4_idx_c[7])->i1_slice_loop_filter_across_slices_enabled_flag;
 3154|       |
 3155|    475|                                if(idx_c > au4_idx_c[6])
  ------------------
  |  Branch (3155:36): [True: 147, False: 328]
  ------------------
 3156|    147|                                {
 3157|    147|                                    au4_ilf_across_tile_slice_enable[6] = (ps_slice_hdr_base + idx_c)->i1_slice_loop_filter_across_slices_enabled_flag;
 3158|    147|                                }
 3159|       |
 3160|       |                                /*
 3161|       |                                 * Between each neighbor and the current CTB, the i1_slice_loop_filter_across_slices_enabled_flag
 3162|       |                                 * of the pixel having a greater address is checked. Accordingly, set the availability flags
 3163|       |                                 */
 3164|  4.27k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (3164:44): [True: 3.80k, False: 475]
  ------------------
 3165|  3.80k|                                {
 3166|       |                                    /*Sets the edges that lie on the slice/tile boundary*/
 3167|  3.80k|                                    if(au4_idx_c[i] != idx_c)
  ------------------
  |  Branch (3167:40): [True: 867, False: 2.93k]
  ------------------
 3168|    867|                                    {
 3169|    867|                                        au1_tile_slice_boundary[i] = 1;
 3170|    867|                                    }
 3171|  2.93k|                                    else
 3172|  2.93k|                                    {
 3173|  2.93k|                                        au4_ilf_across_tile_slice_enable[i] = 1;
 3174|  2.93k|                                    }
 3175|  3.80k|                                }
 3176|       |                                /*Reset indices*/
 3177|  4.27k|                                for(i = 0; i < 8; i++)
  ------------------
  |  Branch (3177:44): [True: 3.80k, False: 475]
  ------------------
 3178|  3.80k|                                {
 3179|  3.80k|                                    au4_idx_c[i] = 0;
 3180|  3.80k|                                }
 3181|    475|                            }
 3182|       |
 3183|  2.26k|                            if(ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (3183:32): [True: 1.91k, False: 349]
  ------------------
 3184|  1.91k|                            {
 3185|       |                                /* Calculate availability flags at slice boundary */
 3186|  1.91k|                                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 (3186:37): [True: 1.25k, False: 660]
  |  Branch (3186:85): [True: 439, False: 221]
  |  Branch (3186:137): [True: 1.06k, False: 630]
  |  Branch (3186:165): [True: 758, False: 304]
  ------------------
 3187|    934|                                {
 3188|       |                                    /*If ilf across tiles is enabled, boundary availability for tiles is not checked. */
 3189|    934|                                    if(!ps_pps->i1_loop_filter_across_tiles_enabled_flag)
  ------------------
  |  Branch (3189:40): [True: 808, False: 126]
  ------------------
 3190|    808|                                    {
 3191|    808|                                        if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (3191:44): [True: 40, False: 768]
  ------------------
 3192|     40|                                        {
 3193|     40|                                            au4_idx_c[6] = -1;
 3194|     40|                                            au4_idx_c[0] = -1;
 3195|     40|                                            au4_idx_c[4] = -1;
 3196|     40|                                        }
 3197|    768|                                        else
 3198|    768|                                        {
 3199|    768|                                            au4_idx_c[0] =  au4_idx_c[6] = pu1_tile_idx[ctbx_c_l + (ctby_c_l * ps_sps->i2_pic_wd_in_ctb)];
 3200|    768|                                        }
 3201|       |
 3202|    808|                                        if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (3202:44): [True: 380, False: 428]
  ------------------
 3203|    380|                                        {
 3204|    380|                                            au4_idx_c[2] = -1;
 3205|    380|                                            au4_idx_c[5] = -1;
 3206|    380|                                            au4_idx_c[4] = -1;
 3207|    380|                                        }
 3208|    428|                                        else
 3209|    428|                                        {
 3210|    428|                                            au4_idx_c[4] =  pu1_tile_idx[ctbx_c_t - 1 + (ctby_c_t  * ps_sps->i2_pic_wd_in_ctb)];
 3211|    428|                                            au4_idx_c[2] = au4_idx_c[5] = pu1_tile_idx[ctbx_c_t + (ctby_c_t * ps_sps->i2_pic_wd_in_ctb)];
 3212|    428|                                        }
 3213|    808|                                        idx_c   = pu1_tile_idx[ctbx_c + (ctby_c * ps_sps->i2_pic_wd_in_ctb)];
 3214|    808|                                        au4_idx_c[1] = au4_idx_c[7] = pu1_tile_idx[ctbx_c_r + (ctby_c_r * ps_sps->i2_pic_wd_in_ctb)];
 3215|    808|                                        au4_idx_c[3] = pu1_tile_idx[ctbx_c_d + (ctby_c_d * ps_sps->i2_pic_wd_in_ctb)];
 3216|       |
 3217|  7.27k|                                        for(i = 0; i < 8; i++)
  ------------------
  |  Branch (3217:52): [True: 6.46k, False: 808]
  ------------------
 3218|  6.46k|                                        {
 3219|       |                                            /*Sets the edges that lie on the slice/tile boundary*/
 3220|  6.46k|                                            if(au4_idx_c[i] != idx_c)
  ------------------
  |  Branch (3220:48): [True: 3.18k, False: 3.28k]
  ------------------
 3221|  3.18k|                                            {
 3222|  3.18k|                                                au1_tile_slice_boundary[i] |= 1;
 3223|  3.18k|                                                au4_ilf_across_tile_slice_enable[i] &= ps_pps->i1_loop_filter_across_tiles_enabled_flag; //=0
 3224|  3.18k|                                            }
 3225|  6.46k|                                        }
 3226|    808|                                    }
 3227|    934|                                }
 3228|  1.91k|                            }
 3229|       |
 3230|  20.3k|                            for(i = 0; i < 8; i++)
  ------------------
  |  Branch (3230:40): [True: 18.0k, False: 2.26k]
  ------------------
 3231|  18.0k|                            {
 3232|       |                                /*Sets the edges that lie on the slice/tile boundary*/
 3233|  18.0k|                                if((au1_tile_slice_boundary[i]) && !(au4_ilf_across_tile_slice_enable[i]))
  ------------------
  |  Branch (3233:36): [True: 4.04k, False: 14.0k]
  |  Branch (3233:68): [True: 3.59k, False: 455]
  ------------------
 3234|  3.59k|                                {
 3235|  3.59k|                                    au1_avail_chroma[i] = 0;
 3236|  3.59k|                                }
 3237|  18.0k|                            }
 3238|  2.26k|                        }
 3239|   126k|                    }
 3240|       |
 3241|   126k|                    if(0 == ps_sao_ctxt->i4_ctb_x)
  ------------------
  |  Branch (3241:24): [True: 6.68k, False: 120k]
  ------------------
 3242|  6.68k|                    {
 3243|  6.68k|                        au1_avail_chroma[0] = 0;
 3244|  6.68k|                        au1_avail_chroma[4] = 0;
 3245|  6.68k|                        au1_avail_chroma[6] = 0;
 3246|  6.68k|                    }
 3247|       |
 3248|   126k|                    if(ps_sps->i2_pic_width_in_luma_samples - (ps_sao_ctxt->i4_ctb_x << log2_ctb_size) <= sao_wd_chroma)
  ------------------
  |  Branch (3248:24): [True: 6.94k, False: 119k]
  ------------------
 3249|  6.94k|                    {
 3250|  6.94k|                        au1_avail_chroma[1] = 0;
 3251|  6.94k|                        au1_avail_chroma[5] = 0;
 3252|  6.94k|                        au1_avail_chroma[7] = 0;
 3253|  6.94k|                    }
 3254|       |
 3255|   126k|                    if(0 == ps_sao_ctxt->i4_ctb_y)
  ------------------
  |  Branch (3255:24): [True: 9.68k, False: 117k]
  ------------------
 3256|  9.68k|                    {
 3257|  9.68k|                        au1_avail_chroma[2] = 0;
 3258|  9.68k|                        au1_avail_chroma[4] = 0;
 3259|  9.68k|                        au1_avail_chroma[5] = 0;
 3260|  9.68k|                    }
 3261|       |
 3262|   126k|                    if(ps_sps->i2_pic_height_in_luma_samples / 2 - (ps_sao_ctxt->i4_ctb_y  << (log2_ctb_size - 1)) <= sao_ht_chroma)
  ------------------
  |  Branch (3262:24): [True: 4.68k, False: 122k]
  ------------------
 3263|  4.68k|                    {
 3264|  4.68k|                        au1_avail_chroma[3] = 0;
 3265|  4.68k|                        au1_avail_chroma[6] = 0;
 3266|  4.68k|                        au1_avail_chroma[7] = 0;
 3267|  4.68k|                    }
 3268|       |
 3269|   126k|                    {
 3270|   126k|                        au1_src_top_right[0] = pu1_src_chroma[sao_wd_chroma - src_strd];
 3271|   126k|                        au1_src_top_right[1] = pu1_src_chroma[sao_wd_chroma - src_strd + 1];
 3272|       |
 3273|   126k|                        au1_sao_src_top_left_chroma_bot_left[0] = pu1_src_chroma[sao_ht_chroma * src_strd - 2];
 3274|   126k|                        au1_sao_src_top_left_chroma_bot_left[1] = pu1_src_chroma[sao_ht_chroma * src_strd - 1];
 3275|       |
 3276|   126k|                        if(chroma_yuv420sp_vu)
  ------------------
  |  Branch (3276:28): [True: 52.2k, False: 74.4k]
  ------------------
 3277|  52.2k|                        {
 3278|  52.2k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 3279|  52.2k|                                                                                 src_strd,
 3280|  52.2k|                                                                                 pu1_src_left_chroma,
 3281|  52.2k|                                                                                 pu1_src_top_chroma,
 3282|  52.2k|                                                                                 pu1_sao_src_top_left_chroma_curr_ctb,
 3283|  52.2k|                                                                                 au1_src_top_right,
 3284|  52.2k|                                                                                 au1_sao_src_top_left_chroma_bot_left,
 3285|  52.2k|                                                                                 au1_avail_chroma,
 3286|  52.2k|                                                                                 ai1_offset_cr,
 3287|  52.2k|                                                                                 ai1_offset_cb,
 3288|  52.2k|                                                                                 sao_wd_chroma,
 3289|  52.2k|                                                                                 sao_ht_chroma);
 3290|  52.2k|                        }
 3291|  74.4k|                        else
 3292|  74.4k|                        {
 3293|  74.4k|                            ps_codec->apf_sao_chroma[ps_sao->b3_cb_type_idx - 2](pu1_src_chroma,
 3294|  74.4k|                                                                                 src_strd,
 3295|  74.4k|                                                                                 pu1_src_left_chroma,
 3296|  74.4k|                                                                                 pu1_src_top_chroma,
 3297|  74.4k|                                                                                 pu1_sao_src_top_left_chroma_curr_ctb,
 3298|  74.4k|                                                                                 au1_src_top_right,
 3299|  74.4k|                                                                                 au1_sao_src_top_left_chroma_bot_left,
 3300|  74.4k|                                                                                 au1_avail_chroma,
 3301|  74.4k|                                                                                 ai1_offset_cb,
 3302|  74.4k|                                                                                 ai1_offset_cr,
 3303|  74.4k|                                                                                 sao_wd_chroma,
 3304|  74.4k|                                                                                 sao_ht_chroma);
 3305|  74.4k|                        }
 3306|   126k|                    }
 3307|       |
 3308|   126k|                }
 3309|   561k|                pu1_sao_src_top_left_chroma_top_right[0] = pu1_src_chroma[(sao_ht_chroma - 1) * src_strd + sao_wd_chroma];
 3310|   561k|                pu1_sao_src_top_left_chroma_top_right[1] = pu1_src_chroma[(sao_ht_chroma - 1) * src_strd + sao_wd_chroma + 1];
 3311|       |
 3312|   561k|                pu1_sao_src_top_left_chroma_bot_left[0] = pu1_src_chroma[(sao_ht_chroma)*src_strd + sao_wd_chroma - 2];
 3313|   561k|                pu1_sao_src_top_left_chroma_bot_left[1] = pu1_src_chroma[(sao_ht_chroma)*src_strd + sao_wd_chroma - 1];
 3314|   561k|            }
 3315|  2.15M|            else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))
  ------------------
  |  Branch (3315:21): [True: 7.24k, False: 2.14M]
  |  Branch (3315:68): [True: 20.3k, False: 2.12M]
  ------------------
 3316|  27.6k|            {
 3317|   630k|                for(row = 0; row < sao_ht_chroma; row++)
  ------------------
  |  Branch (3317:30): [True: 602k, False: 27.6k]
  ------------------
 3318|   602k|                {
 3319|   602k|                    pu1_src_left_chroma[2 * row] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 2)];
 3320|   602k|                    pu1_src_left_chroma[2 * row + 1] = pu1_src_chroma[row * src_strd + (sao_wd_chroma - 1)];
 3321|   602k|                }
 3322|  27.6k|                pu1_sao_src_top_left_chroma_curr_ctb[0] = pu1_src_top_chroma[sao_wd_chroma - 2];
 3323|  27.6k|                pu1_sao_src_top_left_chroma_curr_ctb[1] = pu1_src_top_chroma[sao_wd_chroma - 1];
 3324|       |
 3325|  27.6k|                ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_chroma, &pu1_src_chroma[(sao_ht_chroma - 1) * src_strd], sao_wd_chroma);
 3326|       |
 3327|  27.6k|                pu1_sao_src_top_left_chroma_top_right[0] = pu1_src_chroma[(sao_ht_chroma - 1) * src_strd + sao_wd_chroma];
 3328|  27.6k|                pu1_sao_src_top_left_chroma_top_right[1] = pu1_src_chroma[(sao_ht_chroma - 1) * src_strd + sao_wd_chroma + 1];
 3329|  27.6k|            }
 3330|       |
 3331|  2.71M|        }
 3332|  7.49M|    }
 3333|       |
 3334|       |
 3335|       |
 3336|       |
 3337|       |/* If no loop filter is enabled copy the backed up values */
 3338|  7.49M|    {
 3339|       |        /* Luma */
 3340|  7.49M|        if(no_loop_filter_enabled_luma)
  ------------------
  |  Branch (3340:12): [True: 29.4k, False: 7.46M]
  ------------------
 3341|  29.4k|        {
 3342|  29.4k|            UWORD32 u4_no_loop_filter_flag;
 3343|  29.4k|            WORD32 loop_filter_bit_pos;
 3344|  29.4k|            WORD32 log2_min_cu = 3;
 3345|  29.4k|            WORD32 min_cu = (1 << log2_min_cu);
 3346|  29.4k|            UWORD8 *pu1_src_tmp_luma = pu1_src_luma;
 3347|  29.4k|            WORD32 sao_blk_ht = ctb_size - SAO_SHIFT_CTB;
  ------------------
  |  |   78|  29.4k|#define SAO_SHIFT_CTB    8
  ------------------
 3348|  29.4k|            WORD32 sao_blk_wd = ctb_size;
 3349|  29.4k|            WORD32 remaining_rows;
 3350|  29.4k|            WORD32 remaining_cols;
 3351|       |
 3352|  29.4k|            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|  29.4k|#define SAO_SHIFT_CTB    8
  ------------------
 3353|  29.4k|            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|  29.4k|#define SAO_SHIFT_CTB    8
  ------------------
 3354|  29.4k|            if(remaining_rows <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  29.4k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3354:16): [True: 836, False: 28.5k]
  ------------------
 3355|    836|                sao_blk_ht += remaining_rows;
 3356|  29.4k|            if(remaining_cols <= SAO_SHIFT_CTB)
  ------------------
  |  |   78|  29.4k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3356:16): [True: 962, False: 28.4k]
  ------------------
 3357|    962|                sao_blk_wd += remaining_cols;
 3358|       |
 3359|  29.4k|            pu1_src_tmp_luma -= ps_sao_ctxt->i4_ctb_x ? SAO_SHIFT_CTB : 0;
  ------------------
  |  |   78|  27.0k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3359:33): [True: 27.0k, False: 2.38k]
  ------------------
 3360|  29.4k|            pu1_src_tmp_luma -= ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB * src_strd : 0;
  ------------------
  |  |   78|  16.2k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3360:33): [True: 16.2k, False: 13.1k]
  ------------------
 3361|       |
 3362|  29.4k|            pu1_src_backup_luma = ps_sao_ctxt->pu1_tmp_buf_luma;
 3363|       |
 3364|  29.4k|            loop_filter_bit_pos = (ps_sao_ctxt->i4_ctb_x << (log2_ctb_size - 3)) +
 3365|  29.4k|                            (ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 3)) * (loop_filter_strd << 3);
 3366|  29.4k|            if(ps_sao_ctxt->i4_ctb_x > 0)
  ------------------
  |  Branch (3366:16): [True: 27.0k, False: 2.38k]
  ------------------
 3367|  27.0k|                loop_filter_bit_pos -= 1;
 3368|       |
 3369|  29.4k|            pu1_no_loop_filter_flag = ps_sao_ctxt->pu1_pic_no_loop_filter_flag +
 3370|  29.4k|                            (loop_filter_bit_pos >> 3);
 3371|       |
 3372|  29.4k|            for(i = -(ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB : 0) >> log2_min_cu;
  ------------------
  |  |   78|  16.2k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3372:23): [True: 16.2k, False: 13.1k]
  ------------------
 3373|   247k|                            i < (sao_blk_ht + (min_cu - 1)) >> log2_min_cu; i++)
  ------------------
  |  Branch (3373:29): [True: 217k, False: 29.4k]
  ------------------
 3374|   217k|            {
 3375|   217k|                WORD32 tmp_wd = sao_blk_wd;
 3376|       |
 3377|   217k|                u4_no_loop_filter_flag = (*(UWORD32 *)(pu1_no_loop_filter_flag + i * loop_filter_strd)) >>
 3378|   217k|                                (loop_filter_bit_pos & 7);
 3379|   217k|                u4_no_loop_filter_flag &= (1 << ((tmp_wd + (min_cu - 1)) >> log2_min_cu)) - 1;
 3380|       |
 3381|   217k|                if(u4_no_loop_filter_flag)
  ------------------
  |  Branch (3381:20): [True: 116k, False: 100k]
  ------------------
 3382|   116k|                {
 3383|   313k|                    while(tmp_wd > 0)
  ------------------
  |  Branch (3383:27): [True: 196k, False: 116k]
  ------------------
 3384|   196k|                    {
 3385|   196k|                        if(CTZ(u4_no_loop_filter_flag))
  ------------------
  |  Branch (3385:28): [True: 70.7k, False: 125k]
  ------------------
 3386|  70.7k|                        {
 3387|  70.7k|                            pu1_src_tmp_luma += MIN(((WORD32)CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|  70.7k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 36.8k, False: 33.9k]
  |  |  ------------------
  ------------------
 3388|  70.7k|                            pu1_src_backup_luma += MIN(((WORD32)CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|  70.7k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 36.8k, False: 33.9k]
  |  |  ------------------
  ------------------
 3389|  70.7k|                            tmp_wd -= (WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu);
 3390|  70.7k|                            u4_no_loop_filter_flag  >>= (CTZ(u4_no_loop_filter_flag));
 3391|  70.7k|                        }
 3392|   125k|                        else
 3393|   125k|                        {
 3394|  1.12M|                            for(row = 0; row < min_cu; row++)
  ------------------
  |  Branch (3394:42): [True: 1.00M, False: 125k]
  ------------------
 3395|  1.00M|                            {
 3396|  42.0M|                                for(col = 0; col < MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd); col++)
  ------------------
  |  |   43|  42.0M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 5.69M, False: 36.3M]
  |  |  ------------------
  ------------------
  |  Branch (3396:46): [True: 41.0M, False: 1.00M]
  ------------------
 3397|  41.0M|                                {
 3398|  41.0M|                                    pu1_src_tmp_luma[row * src_strd + col] = pu1_src_backup_luma[row * backup_strd + col];
 3399|  41.0M|                                }
 3400|  1.00M|                            }
 3401|   125k|                            pu1_src_tmp_luma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|   125k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 43.3k, False: 82.6k]
  |  |  ------------------
  ------------------
 3402|   125k|                            pu1_src_backup_luma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|   125k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 43.3k, False: 82.6k]
  |  |  ------------------
  ------------------
 3403|   125k|                            tmp_wd -= (WORD32)(CTZ(~u4_no_loop_filter_flag) << log2_min_cu);
 3404|   125k|                            u4_no_loop_filter_flag  >>= (CTZ(~u4_no_loop_filter_flag));
 3405|   125k|                        }
 3406|   196k|                    }
 3407|       |
 3408|   116k|                    pu1_src_tmp_luma -= sao_blk_wd;
 3409|   116k|                    pu1_src_backup_luma -= sao_blk_wd;
 3410|   116k|                }
 3411|       |
 3412|   217k|                pu1_src_tmp_luma += (src_strd << log2_min_cu);
 3413|   217k|                pu1_src_backup_luma += (backup_strd << log2_min_cu);
 3414|   217k|            }
 3415|  29.4k|        }
 3416|       |
 3417|       |        /* Chroma */
 3418|  7.49M|        if(no_loop_filter_enabled_chroma)
  ------------------
  |  Branch (3418:12): [True: 28.9k, False: 7.46M]
  ------------------
 3419|  28.9k|        {
 3420|  28.9k|            UWORD32 u4_no_loop_filter_flag;
 3421|  28.9k|            WORD32 loop_filter_bit_pos;
 3422|  28.9k|            WORD32 log2_min_cu = 3;
 3423|  28.9k|            WORD32 min_cu = (1 << log2_min_cu);
 3424|  28.9k|            UWORD8 *pu1_src_tmp_chroma = pu1_src_chroma;
 3425|  28.9k|            WORD32 sao_blk_ht = ctb_size - 2 * SAO_SHIFT_CTB;
  ------------------
  |  |   78|  28.9k|#define SAO_SHIFT_CTB    8
  ------------------
 3426|  28.9k|            WORD32 sao_blk_wd = ctb_size;
 3427|  28.9k|            WORD32 remaining_rows;
 3428|  28.9k|            WORD32 remaining_cols;
 3429|       |
 3430|  28.9k|            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|  28.9k|#define SAO_SHIFT_CTB    8
  ------------------
 3431|  28.9k|            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|  28.9k|#define SAO_SHIFT_CTB    8
  ------------------
 3432|  28.9k|            if(remaining_rows <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|  28.9k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3432:16): [True: 822, False: 28.1k]
  ------------------
 3433|    822|                sao_blk_ht += remaining_rows;
 3434|  28.9k|            if(remaining_cols <= 2 * SAO_SHIFT_CTB)
  ------------------
  |  |   78|  28.9k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3434:16): [True: 936, False: 28.0k]
  ------------------
 3435|    936|                sao_blk_wd += remaining_cols;
 3436|       |
 3437|  28.9k|            pu1_src_tmp_chroma -= ps_sao_ctxt->i4_ctb_x ? SAO_SHIFT_CTB * 2 : 0;
  ------------------
  |  |   78|  26.6k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3437:35): [True: 26.6k, False: 2.34k]
  ------------------
 3438|  28.9k|            pu1_src_tmp_chroma -= ps_sao_ctxt->i4_ctb_y ? SAO_SHIFT_CTB * src_strd : 0;
  ------------------
  |  |   78|  16.0k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3438:35): [True: 16.0k, False: 12.9k]
  ------------------
 3439|       |
 3440|  28.9k|            pu1_src_backup_chroma = ps_sao_ctxt->pu1_tmp_buf_chroma;
 3441|       |
 3442|  28.9k|            loop_filter_bit_pos = (ps_sao_ctxt->i4_ctb_x << (log2_ctb_size - 3)) +
 3443|  28.9k|                            (ps_sao_ctxt->i4_ctb_y << (log2_ctb_size - 3)) * (loop_filter_strd << 3);
 3444|  28.9k|            if(ps_sao_ctxt->i4_ctb_x > 0)
  ------------------
  |  Branch (3444:16): [True: 26.6k, False: 2.34k]
  ------------------
 3445|  26.6k|                loop_filter_bit_pos -= 2;
 3446|       |
 3447|  28.9k|            pu1_no_loop_filter_flag = ps_sao_ctxt->pu1_pic_no_loop_filter_flag +
 3448|  28.9k|                            (loop_filter_bit_pos >> 3);
 3449|       |
 3450|  28.9k|            for(i = -(ps_sao_ctxt->i4_ctb_y ? 2 * SAO_SHIFT_CTB : 0) >> log2_min_cu;
  ------------------
  |  |   78|  16.0k|#define SAO_SHIFT_CTB    8
  ------------------
  |  Branch (3450:23): [True: 16.0k, False: 12.9k]
  ------------------
 3451|   231k|                            i < (sao_blk_ht + (min_cu - 1)) >> log2_min_cu; i++)
  ------------------
  |  Branch (3451:29): [True: 202k, False: 28.9k]
  ------------------
 3452|   202k|            {
 3453|   202k|                WORD32 tmp_wd = sao_blk_wd;
 3454|       |
 3455|   202k|                u4_no_loop_filter_flag = (*(UWORD32 *)(pu1_no_loop_filter_flag + i * loop_filter_strd)) >>
 3456|   202k|                                (loop_filter_bit_pos & 7);
 3457|   202k|                u4_no_loop_filter_flag &= (1 << ((tmp_wd + (min_cu - 1)) >> log2_min_cu)) - 1;
 3458|       |
 3459|   202k|                if(u4_no_loop_filter_flag)
  ------------------
  |  Branch (3459:20): [True: 115k, False: 87.3k]
  ------------------
 3460|   115k|                {
 3461|   303k|                    while(tmp_wd > 0)
  ------------------
  |  Branch (3461:27): [True: 187k, False: 115k]
  ------------------
 3462|   187k|                    {
 3463|   187k|                        if(CTZ(u4_no_loop_filter_flag))
  ------------------
  |  Branch (3463:28): [True: 65.9k, False: 121k]
  ------------------
 3464|  65.9k|                        {
 3465|  65.9k|                            pu1_src_tmp_chroma += MIN(((WORD32)CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|  65.9k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 32.4k, False: 33.4k]
  |  |  ------------------
  ------------------
 3466|  65.9k|                            pu1_src_backup_chroma += MIN(((WORD32)CTZ(u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|  65.9k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 32.4k, False: 33.4k]
  |  |  ------------------
  ------------------
 3467|  65.9k|                            tmp_wd -= (WORD32)(CTZ(u4_no_loop_filter_flag) << log2_min_cu);
 3468|  65.9k|                            u4_no_loop_filter_flag  >>= (CTZ(u4_no_loop_filter_flag));
 3469|  65.9k|                        }
 3470|   121k|                        else
 3471|   121k|                        {
 3472|   607k|                            for(row = 0; row < min_cu / 2; row++)
  ------------------
  |  Branch (3472:42): [True: 485k, False: 121k]
  ------------------
 3473|   485k|                            {
 3474|  21.4M|                                for(col = 0; col < MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd); col++)
  ------------------
  |  |   43|  21.4M|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 3.28M, False: 18.1M]
  |  |  ------------------
  ------------------
  |  Branch (3474:46): [True: 20.9M, False: 485k]
  ------------------
 3475|  20.9M|                                {
 3476|  20.9M|                                    pu1_src_tmp_chroma[row * src_strd + col] = pu1_src_backup_chroma[row * backup_strd + col];
 3477|  20.9M|                                }
 3478|   485k|                            }
 3479|       |
 3480|   121k|                            pu1_src_tmp_chroma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|   121k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 39.8k, False: 81.8k]
  |  |  ------------------
  ------------------
 3481|   121k|                            pu1_src_backup_chroma += MIN(((WORD32)CTZ(~u4_no_loop_filter_flag) << log2_min_cu), tmp_wd);
  ------------------
  |  |   43|   121k|#define MIN(x,y)    (((x) < (y)) ? (x) :(y))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 39.7k, False: 81.8k]
  |  |  ------------------
  ------------------
 3482|   121k|                            tmp_wd -= (WORD32)(CTZ(~u4_no_loop_filter_flag) << log2_min_cu);
 3483|   121k|                            u4_no_loop_filter_flag  >>= (CTZ(~u4_no_loop_filter_flag));
 3484|   121k|                        }
 3485|   187k|                    }
 3486|       |
 3487|   115k|                    pu1_src_tmp_chroma -= sao_blk_wd;
 3488|   115k|                    pu1_src_backup_chroma -= sao_blk_wd;
 3489|   115k|                }
 3490|       |
 3491|   202k|                pu1_src_tmp_chroma += ((src_strd / 2) << log2_min_cu);
 3492|   202k|                pu1_src_backup_chroma += ((backup_strd / 2) << log2_min_cu);
 3493|   202k|            }
 3494|  28.9k|        }
 3495|  7.49M|    }
 3496|       |
 3497|  7.49M|}

ihevcd_get_total_pic_buf_size:
  195|  1.56k|{
  196|  1.56k|    WORD32 size;
  197|  1.56k|    WORD32 num_luma_samples;
  198|  1.56k|    WORD32 max_dpb_size;
  199|  1.56k|    WORD32 num_samples;
  200|       |
  201|       |
  202|  1.56k|    sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id);
  203|       |
  204|       |    /* Get maximum number of buffers for the current picture size */
  205|  1.56k|    max_dpb_size = ps_sps->ai1_sps_max_dec_pic_buffering[ps_sps->i1_sps_max_sub_layers - 1];
  206|       |
  207|  1.56k|    if(ps_codec->e_frm_out_mode != IVD_DECODE_FRAME_OUT)
  ------------------
  |  Branch (207:8): [True: 1.56k, False: 0]
  ------------------
  208|  1.56k|        max_dpb_size += ps_sps->ai1_sps_max_num_reorder_pics[ps_sps->i1_sps_max_sub_layers - 1];
  209|       |
  210|  1.56k|    max_dpb_size++;
  211|       |    /* Allocation is required for
  212|       |     * (Wd + horz_pad) * (Ht + vert_pad) * (2 * max_dpb_size + 1)
  213|       |     */
  214|       |
  215|       |    /* Account for padding area */
  216|  1.56k|    num_luma_samples = (wd + PAD_WD) * (ht + PAD_HT);
  ------------------
  |  |   91|  1.56k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  1.56k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  1.56k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
                  num_luma_samples = (wd + PAD_WD) * (ht + PAD_HT);
  ------------------
  |  |   95|  1.56k|#define PAD_HT      (PAD_TOP  + PAD_BOT)
  |  |  ------------------
  |  |  |  |   72|  1.56k|#define PAD_TOP     80
  |  |  ------------------
  |  |               #define PAD_HT      (PAD_TOP  + PAD_BOT)
  |  |  ------------------
  |  |  |  |   77|  1.56k|#define PAD_BOT     80
  |  |  ------------------
  ------------------
  217|       |
  218|       |    /* Account for chroma */
  219|  1.56k|    num_samples = num_luma_samples * 3 / 2;
  220|       |
  221|       |    /* Number of bytes in reference pictures */
  222|  1.56k|    size = num_samples * max_dpb_size;
  223|       |
  224|       |
  225|  1.56k|    return size;
  226|  1.56k|}
ihevcd_get_pic_mv_bank_size:
  248|  3.24k|{
  249|  3.24k|    WORD32 size;
  250|       |
  251|  3.24k|    WORD32 pic_size;
  252|       |
  253|  3.24k|    WORD32 mv_bank_size;
  254|  3.24k|    WORD32 num_pu;
  255|  3.24k|    WORD32 num_ctb;
  256|  3.24k|    pic_size = num_luma_samples;
  257|       |
  258|       |
  259|  3.24k|    num_pu = pic_size / (MIN_PU_SIZE * MIN_PU_SIZE);
  ------------------
  |  |  357|  3.24k|#define MIN_PU_SIZE         4
  ------------------
                  num_pu = pic_size / (MIN_PU_SIZE * MIN_PU_SIZE);
  ------------------
  |  |  357|  3.24k|#define MIN_PU_SIZE         4
  ------------------
  260|  3.24k|    num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  342|  3.24k|#define MIN_CTB_SIZE        16
  ------------------
                  num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  342|  3.24k|#define MIN_CTB_SIZE        16
  ------------------
  261|       |
  262|  3.24k|    mv_bank_size = 0;
  263|       |
  264|       |    /* Size for storing pu_t start index each CTB */
  265|       |    /* One extra entry is needed to compute number of PUs in the last CTB */
  266|  3.24k|    mv_bank_size += (num_ctb + 1) * sizeof(WORD32);
  267|       |
  268|       |    /* Size for pu_map */
  269|  3.24k|    mv_bank_size += num_pu;
  270|       |
  271|       |    /* Size for storing pu_t for each PU */
  272|  3.24k|    mv_bank_size += num_pu * sizeof(pu_t);
  273|       |
  274|       |    /* Size for storing slice_idx for each CTB */
  275|  3.24k|    mv_bank_size += ALIGN4(num_ctb * sizeof(UWORD16));
  ------------------
  |  |   54|  3.24k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  276|       |
  277|  3.24k|    size =  mv_bank_size;
  278|  3.24k|    return size;
  279|  3.24k|}
ihevcd_get_tu_data_size:
  302|  1.56k|{
  303|       |
  304|       |
  305|  1.56k|    WORD32 tu_data_size;
  306|  1.56k|    WORD32 num_ctb;
  307|  1.56k|    WORD32 num_luma_tu, num_chroma_tu, num_tu;
  308|  1.56k|    num_ctb = num_luma_samples / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
                  num_ctb = num_luma_samples / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  342|  1.56k|#define MIN_CTB_SIZE        16
  ------------------
  309|       |
  310|  1.56k|    num_luma_tu = num_luma_samples / (MIN_TU_SIZE * MIN_TU_SIZE);
  ------------------
  |  |  348|  1.56k|#define MIN_TU_SIZE         4
  ------------------
                  num_luma_tu = num_luma_samples / (MIN_TU_SIZE * MIN_TU_SIZE);
  ------------------
  |  |  348|  1.56k|#define MIN_TU_SIZE         4
  ------------------
  311|  1.56k|    num_chroma_tu = num_luma_tu >> 1;
  312|       |
  313|  1.56k|    num_tu = num_luma_tu + num_chroma_tu;
  314|  1.56k|    tu_data_size = 0;
  315|       |
  316|       |    /* Size for storing tu_t start index each CTB */
  317|       |    /* One extra entry is needed to compute number of TUs in the last CTB */
  318|  1.56k|    tu_data_size += (num_ctb + 1) * sizeof(WORD32);
  319|       |
  320|       |    /* Size for storing tu map */
  321|  1.56k|    tu_data_size += num_luma_tu * sizeof(UWORD8);
  322|       |
  323|       |    /* Size for storing tu_t for each TU */
  324|  1.56k|    tu_data_size += num_tu * sizeof(tu_t);
  325|       |
  326|       |    /* Size for storing number of coded subblocks and scan_idx for each TU */
  327|  1.56k|    tu_data_size += num_tu * (sizeof(WORD8) + sizeof(WORD8));
  328|       |
  329|       |    /* Size for storing coeff data for each TU */
  330|  1.56k|    tu_data_size += num_tu * sizeof(tu_sblk_coeff_data_t);
  331|       |
  332|       |
  333|  1.56k|    return tu_data_size;
  334|  1.56k|}
ihevcd_nctb_cnt:
  338|  9.14k|{
  339|  9.14k|    WORD32 nctb = 1;
  340|  9.14k|    UNUSED(ps_codec);
  ------------------
  |  |   38|  9.14k|#define UNUSED(x) ((void)(x))
  ------------------
  341|       |    //TODO: Currently set to 1
  342|       |    /* If CTB size is less than 32 x 32 then set nCTB as 4 */
  343|  9.14k|    if(ps_sps->i1_log2_ctb_size < 5)
  ------------------
  |  Branch (343:8): [True: 514, False: 8.62k]
  ------------------
  344|    514|        nctb = 1;
  345|       |
  346|  9.14k|    return nctb;
  347|  9.14k|}
ihevcd_get_tile_pos:
  356|   507k|{
  357|       |
  358|   507k|    tile_t *ps_tile_tmp;
  359|   507k|    WORD32 i;
  360|   507k|    WORD32 tile_row, tile_col;
  361|       |
  362|   507k|    if(ctb_x < 0 || ctb_y < 0)
  ------------------
  |  Branch (362:8): [True: 0, False: 507k]
  |  Branch (362:21): [True: 0, False: 507k]
  ------------------
  363|      0|    {
  364|      0|        *pi4_ctb_tile_x = 0;
  365|      0|        *pi4_ctb_tile_y = 0;
  366|      0|        *pi4_tile_idx = 0;
  367|       |
  368|      0|        return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  369|      0|    }
  370|       |
  371|   507k|    tile_row = 0;
  372|   507k|    tile_col = 0;
  373|   507k|    ps_tile_tmp = ps_pps->ps_tile;
  374|   507k|    if(0 == ps_pps->i1_tiles_enabled_flag)
  ------------------
  |  Branch (374:8): [True: 486k, False: 20.6k]
  ------------------
  375|   486k|    {
  376|   486k|        *pi4_ctb_tile_x = ctb_x;
  377|   486k|        *pi4_ctb_tile_y = ctb_y;
  378|   486k|        *pi4_tile_idx = 0;
  379|   486k|    }
  380|  20.6k|    else
  381|  20.6k|    {
  382|   338k|        for(i = 0; i < ps_pps->i1_num_tile_columns; i++)
  ------------------
  |  Branch (382:20): [True: 338k, False: 0]
  ------------------
  383|   338k|        {
  384|   338k|            WORD16 next_tile_ctb_x;
  385|   338k|            ps_tile_tmp = ps_pps->ps_tile + i; //* ps_pps->i1_num_tile_rows;
  386|   338k|            if((ps_pps->i1_num_tile_columns - 1) == i)
  ------------------
  |  Branch (386:16): [True: 4.91k, False: 333k]
  ------------------
  387|  4.91k|            {
  388|  4.91k|                next_tile_ctb_x = ps_sps->i2_pic_wd_in_ctb;
  389|  4.91k|            }
  390|   333k|            else
  391|   333k|            {
  392|   333k|                tile_t *ps_tile_next_tmp;
  393|   333k|                ps_tile_next_tmp = ps_pps->ps_tile + i + 1;
  394|   333k|                next_tile_ctb_x = ps_tile_next_tmp->u1_pos_x;
  395|   333k|            }
  396|   338k|            if((ctb_x >= ps_tile_tmp->u1_pos_x) && (ctb_x < next_tile_ctb_x))
  ------------------
  |  Branch (396:16): [True: 338k, False: 2]
  |  Branch (396:52): [True: 20.6k, False: 317k]
  ------------------
  397|  20.6k|            {
  398|  20.6k|                tile_col = i;
  399|  20.6k|                break;
  400|  20.6k|            }
  401|   338k|        }
  402|  20.6k|        *pi4_ctb_tile_x = ctb_x - ps_tile_tmp->u1_pos_x;
  403|       |
  404|  22.5k|        for(i = 0; i < ps_pps->i1_num_tile_rows; i++)
  ------------------
  |  Branch (404:20): [True: 22.5k, False: 2]
  ------------------
  405|  22.5k|        {
  406|  22.5k|            WORD16 next_tile_ctb_y;
  407|  22.5k|            ps_tile_tmp = ps_pps->ps_tile + i * ps_pps->i1_num_tile_columns;
  408|  22.5k|            if((ps_pps->i1_num_tile_rows - 1) == i)
  ------------------
  |  Branch (408:16): [True: 19.9k, False: 2.59k]
  ------------------
  409|  19.9k|            {
  410|  19.9k|                next_tile_ctb_y = ps_sps->i2_pic_ht_in_ctb;
  411|  19.9k|            }
  412|  2.59k|            else
  413|  2.59k|            {
  414|  2.59k|                tile_t *ps_tile_next_tmp;
  415|  2.59k|                ps_tile_next_tmp = ps_pps->ps_tile + ((i + 1) * ps_pps->i1_num_tile_columns);
  416|  2.59k|                next_tile_ctb_y = ps_tile_next_tmp->u1_pos_y;
  417|  2.59k|            }
  418|  22.5k|            if((ctb_y >= ps_tile_tmp->u1_pos_y) && (ctb_y < next_tile_ctb_y))
  ------------------
  |  Branch (418:16): [True: 22.5k, False: 0]
  |  Branch (418:52): [True: 20.6k, False: 1.89k]
  ------------------
  419|  20.6k|            {
  420|  20.6k|                tile_row = i;
  421|  20.6k|                break;
  422|  20.6k|            }
  423|       |
  424|  22.5k|        }
  425|  20.6k|        *pi4_ctb_tile_y = ctb_y - ps_tile_tmp->u1_pos_y;
  426|  20.6k|        *pi4_tile_idx = tile_row * ps_pps->i1_num_tile_columns
  427|  20.6k|                        + tile_col;
  428|  20.6k|    }
  429|   507k|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  430|   507k|}
ihevcd_pic_buf_mgr_add_bufs:
  454|  1.68k|{
  455|  1.68k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  456|  1.68k|    WORD32 i;
  457|  1.68k|    WORD32 max_dpb_size;
  458|  1.68k|    sps_t *ps_sps;
  459|  1.68k|    UWORD8 *pu1_buf;
  460|  1.68k|    pic_buf_t *ps_pic_buf;
  461|  1.68k|    WORD32 pic_buf_size_allocated;
  462|       |
  463|       |
  464|       |
  465|       |
  466|       |    /* Initialize Pic buffer manager */
  467|  1.68k|    ps_sps = ps_codec->s_parse.ps_sps;
  468|       |
  469|       |    /* Compute the number of Pic buffers needed */
  470|  1.68k|    max_dpb_size = ps_sps->ai1_sps_max_dec_pic_buffering[ps_sps->i1_sps_max_sub_layers - 1];
  471|       |
  472|  1.68k|    if(ps_codec->e_frm_out_mode != IVD_DECODE_FRAME_OUT)
  ------------------
  |  Branch (472:8): [True: 1.68k, False: 0]
  ------------------
  473|  1.68k|        max_dpb_size += ps_sps->ai1_sps_max_num_reorder_pics[ps_sps->i1_sps_max_sub_layers - 1];
  474|       |
  475|       |    /* Allocate one extra picture to handle current frame
  476|       |     * In case of asynchronous parsing and processing, number of buffers should increase here
  477|       |     * based on when parsing and processing threads are synchronized
  478|       |     */
  479|  1.68k|    max_dpb_size++;
  480|       |
  481|       |
  482|  1.68k|    pu1_buf = (UWORD8 *)ps_codec->pu1_ref_pic_buf_base;
  483|       |
  484|  1.68k|    ps_pic_buf = (pic_buf_t *)ps_codec->ps_pic_buf;
  485|       |
  486|       |    /* In case of non-shared mode, add picture buffers to buffer manager
  487|       |     * In case of shared mode buffers are added in the run-time
  488|       |     */
  489|  1.68k|    if(0 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (489:8): [True: 1.68k, False: 0]
  ------------------
  490|  1.68k|    {
  491|  1.68k|        WORD32 buf_ret;
  492|  1.68k|        WORD32 luma_samples;
  493|  1.68k|        WORD32 chroma_samples;
  494|  1.68k|        pic_buf_size_allocated = ps_codec->i4_total_pic_buf_size;
  495|       |
  496|  1.68k|        luma_samples = (ps_codec->i4_strd) *
  497|  1.68k|                        (ps_sps->i2_pic_height_in_luma_samples + PAD_HT);
  ------------------
  |  |   95|  1.68k|#define PAD_HT      (PAD_TOP  + PAD_BOT)
  |  |  ------------------
  |  |  |  |   72|  1.68k|#define PAD_TOP     80
  |  |  ------------------
  |  |               #define PAD_HT      (PAD_TOP  + PAD_BOT)
  |  |  ------------------
  |  |  |  |   77|  1.68k|#define PAD_BOT     80
  |  |  ------------------
  ------------------
  498|       |
  499|  1.68k|        chroma_samples = luma_samples / 2;
  500|       |
  501|       |        /* Try to add as many buffers as possible since memory is already allocated */
  502|       |        /* If the number of buffers that can be added is less than max_num_bufs
  503|       |         * return with an error.
  504|       |         */
  505|  13.9k|        for(i = 0; i < max_dpb_size; i++)
  ------------------
  |  Branch (505:20): [True: 12.4k, False: 1.51k]
  ------------------
  506|  12.4k|        {
  507|  12.4k|            pic_buf_size_allocated -= (luma_samples + chroma_samples);
  508|       |
  509|  12.4k|            if(pic_buf_size_allocated < 0)
  ------------------
  |  Branch (509:16): [True: 166, False: 12.2k]
  ------------------
  510|    166|            {
  511|    166|                ps_codec->s_parse.i4_error_code = IHEVCD_INSUFFICIENT_MEM_PICBUF;
  512|    166|                return IHEVCD_INSUFFICIENT_MEM_PICBUF;
  513|    166|            }
  514|       |
  515|  12.2k|            ps_pic_buf->pu1_luma = pu1_buf + ps_codec->i4_strd * PAD_TOP + PAD_LEFT;
  ------------------
  |  |   72|  12.2k|#define PAD_TOP     80
  ------------------
                          ps_pic_buf->pu1_luma = pu1_buf + ps_codec->i4_strd * PAD_TOP + PAD_LEFT;
  ------------------
  |  |   82|  12.2k|#define PAD_LEFT    80
  ------------------
  516|  12.2k|            pu1_buf += luma_samples;
  517|       |
  518|  12.2k|            ps_pic_buf->pu1_chroma = pu1_buf + ps_codec->i4_strd * (PAD_TOP / 2) + PAD_LEFT;
  ------------------
  |  |   72|  12.2k|#define PAD_TOP     80
  ------------------
                          ps_pic_buf->pu1_chroma = pu1_buf + ps_codec->i4_strd * (PAD_TOP / 2) + PAD_LEFT;
  ------------------
  |  |   82|  12.2k|#define PAD_LEFT    80
  ------------------
  519|  12.2k|            pu1_buf += chroma_samples;
  520|       |
  521|       |            /* Pad boundary pixels (one pixel on all sides) */
  522|       |            /* This ensures SAO does not read uninitialized pixels */
  523|       |            /* Note these are not used in actual processing */
  524|  12.2k|            {
  525|  12.2k|                UWORD8 *pu1_buf;
  526|  12.2k|                WORD32 strd, wd, ht;
  527|  12.2k|                WORD32 i;
  528|  12.2k|                strd = ps_codec->i4_strd;
  529|  12.2k|                wd = ps_codec->i4_wd;
  530|  12.2k|                ht = ps_codec->i4_ht;
  531|       |
  532|  12.2k|                pu1_buf = ps_pic_buf->pu1_luma;
  533|  3.69M|                for(i = 0; i < ht; i++)
  ------------------
  |  Branch (533:28): [True: 3.68M, False: 12.2k]
  ------------------
  534|  3.68M|                {
  535|  3.68M|                    pu1_buf[-1] = 0;
  536|  3.68M|                    pu1_buf[wd] = 0;
  537|  3.68M|                    pu1_buf += strd;
  538|  3.68M|                }
  539|  12.2k|                pu1_buf = ps_pic_buf->pu1_luma;
  540|  12.2k|                memset(pu1_buf - strd - 1, 0, wd + 2);
  541|       |
  542|  12.2k|                pu1_buf += strd * ht;
  543|  12.2k|                memset(pu1_buf - 1, 0, wd + 2);
  544|       |
  545|  12.2k|                pu1_buf = ps_pic_buf->pu1_chroma;
  546|  12.2k|                ht >>= 1;
  547|  1.85M|                for(i = 0; i < ht; i++)
  ------------------
  |  Branch (547:28): [True: 1.84M, False: 12.2k]
  ------------------
  548|  1.84M|                {
  549|  1.84M|                    pu1_buf[-1] = 0;
  550|  1.84M|                    pu1_buf[-2] = 0;
  551|  1.84M|                    pu1_buf[wd] = 0;
  552|  1.84M|                    pu1_buf[wd + 1] = 0;
  553|  1.84M|                    pu1_buf += strd;
  554|  1.84M|                }
  555|  12.2k|                pu1_buf = ps_pic_buf->pu1_chroma;
  556|  12.2k|                memset(pu1_buf - strd - 2, 0, wd + 4);
  557|       |
  558|  12.2k|                pu1_buf += strd * ht;
  559|  12.2k|                memset(pu1_buf - 2, 0, wd + 4);
  560|  12.2k|            }
  561|       |
  562|  12.2k|            buf_ret = ihevc_buf_mgr_add((buf_mgr_t *)ps_codec->pv_pic_buf_mgr, ps_pic_buf, i);
  563|       |
  564|       |
  565|  12.2k|            if(0 != buf_ret)
  ------------------
  |  Branch (565:16): [True: 0, False: 12.2k]
  ------------------
  566|      0|            {
  567|      0|                ps_codec->s_parse.i4_error_code = IHEVCD_BUF_MGR_ERROR;
  568|      0|                return IHEVCD_BUF_MGR_ERROR;
  569|      0|            }
  570|  12.2k|            ps_pic_buf++;
  571|  12.2k|        }
  572|  1.68k|    }
  573|      0|    else
  574|      0|    {
  575|       |        /* In case of shared mode, buffers are added without adjusting for padding.
  576|       |           Update luma and chroma pointers here to account for padding as per stride.
  577|       |           In some cases stride might not be available when set_display_frame is called.
  578|       |           Hence updated luma and chroma pointers here */
  579|       |
  580|      0|        for(i = 0; i < BUF_MGR_MAX_CNT; i++)
  ------------------
  |  |   37|      0|#define BUF_MGR_MAX_CNT 64
  ------------------
  |  Branch (580:20): [True: 0, False: 0]
  ------------------
  581|      0|        {
  582|      0|            ps_pic_buf = ihevc_buf_mgr_get_buf((buf_mgr_t *)ps_codec->pv_pic_buf_mgr, i);
  583|      0|            if((NULL == ps_pic_buf) ||
  ------------------
  |  Branch (583:16): [True: 0, False: 0]
  ------------------
  584|      0|               (NULL == ps_pic_buf->pu1_luma) ||
  ------------------
  |  Branch (584:16): [True: 0, False: 0]
  ------------------
  585|      0|               (NULL == ps_pic_buf->pu1_chroma))
  ------------------
  |  Branch (585:16): [True: 0, False: 0]
  ------------------
  586|      0|            {
  587|      0|                break;
  588|      0|            }
  589|      0|            ps_pic_buf->pu1_luma += ps_codec->i4_strd * PAD_TOP + PAD_LEFT;
  ------------------
  |  |   72|      0|#define PAD_TOP     80
  ------------------
                          ps_pic_buf->pu1_luma += ps_codec->i4_strd * PAD_TOP + PAD_LEFT;
  ------------------
  |  |   82|      0|#define PAD_LEFT    80
  ------------------
  590|      0|            ps_pic_buf->pu1_chroma += ps_codec->i4_strd * (PAD_TOP / 2) + PAD_LEFT;
  ------------------
  |  |   72|      0|#define PAD_TOP     80
  ------------------
                          ps_pic_buf->pu1_chroma += ps_codec->i4_strd * (PAD_TOP / 2) + PAD_LEFT;
  ------------------
  |  |   82|      0|#define PAD_LEFT    80
  ------------------
  591|      0|        }
  592|      0|    }
  593|       |
  594|  1.51k|    return ret;
  595|  1.68k|}
ihevcd_mv_buf_mgr_add_bufs:
  617|  1.68k|{
  618|  1.68k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  619|  1.68k|    WORD32 i;
  620|  1.68k|    WORD32 max_dpb_size;
  621|  1.68k|    WORD32 mv_bank_size_allocated;
  622|  1.68k|    WORD32 pic_mv_bank_size;
  623|       |
  624|  1.68k|    sps_t *ps_sps;
  625|  1.68k|    UWORD8 *pu1_buf;
  626|  1.68k|    mv_buf_t *ps_mv_buf;
  627|       |
  628|       |
  629|       |    /* Initialize MV Bank buffer manager */
  630|  1.68k|    ps_sps = ps_codec->s_parse.ps_sps;
  631|       |
  632|       |
  633|       |    /* Compute the number of MV Bank buffers needed */
  634|  1.68k|    max_dpb_size = ps_sps->ai1_sps_max_dec_pic_buffering[ps_sps->i1_sps_max_sub_layers - 1];
  635|       |
  636|       |    /* Allocate one extra MV Bank to handle current frame
  637|       |     * In case of asynchronous parsing and processing, number of buffers should increase here
  638|       |     * based on when parsing and processing threads are synchronized
  639|       |     */
  640|  1.68k|    max_dpb_size++;
  641|       |
  642|  1.68k|    ps_codec->i4_max_dpb_size = max_dpb_size;
  643|       |
  644|  1.68k|    pu1_buf = (UWORD8 *)ps_codec->pv_mv_bank_buf_base;
  645|       |
  646|  1.68k|    ps_mv_buf = (mv_buf_t *)pu1_buf;
  647|  1.68k|    pu1_buf += max_dpb_size * sizeof(mv_buf_t);
  648|  1.68k|    ps_codec->ps_mv_buf = ps_mv_buf;
  649|  1.68k|    mv_bank_size_allocated = ps_codec->i4_total_mv_bank_size - max_dpb_size  * sizeof(mv_buf_t);
  650|       |
  651|       |    /* Compute MV bank size per picture */
  652|  1.68k|    pic_mv_bank_size = ihevcd_get_pic_mv_bank_size(ALIGN64(ps_sps->i2_pic_width_in_luma_samples) *
  ------------------
  |  |   50|  1.68k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
  653|  1.68k|                                                   ALIGN64(ps_sps->i2_pic_height_in_luma_samples));
  ------------------
  |  |   50|  1.68k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
  654|       |
  655|  12.7k|    for(i = 0; i < max_dpb_size; i++)
  ------------------
  |  Branch (655:16): [True: 11.0k, False: 1.68k]
  ------------------
  656|  11.0k|    {
  657|  11.0k|        WORD32 buf_ret;
  658|  11.0k|        WORD32 num_pu;
  659|  11.0k|        WORD32 num_ctb;
  660|  11.0k|        WORD32 pic_size;
  661|  11.0k|        pic_size = ALIGN64(ps_sps->i2_pic_width_in_luma_samples) *
  ------------------
  |  |   50|  11.0k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
  662|  11.0k|                        ALIGN64(ps_sps->i2_pic_height_in_luma_samples);
  ------------------
  |  |   50|  11.0k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
  663|       |
  664|       |
  665|  11.0k|        num_pu = pic_size / (MIN_PU_SIZE * MIN_PU_SIZE);
  ------------------
  |  |  357|  11.0k|#define MIN_PU_SIZE         4
  ------------------
                      num_pu = pic_size / (MIN_PU_SIZE * MIN_PU_SIZE);
  ------------------
  |  |  357|  11.0k|#define MIN_PU_SIZE         4
  ------------------
  666|  11.0k|        num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  342|  11.0k|#define MIN_CTB_SIZE        16
  ------------------
                      num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  342|  11.0k|#define MIN_CTB_SIZE        16
  ------------------
  667|       |
  668|       |
  669|  11.0k|        mv_bank_size_allocated -= pic_mv_bank_size;
  670|       |
  671|  11.0k|        if(mv_bank_size_allocated < 0)
  ------------------
  |  Branch (671:12): [True: 0, False: 11.0k]
  ------------------
  672|      0|        {
  673|      0|            ps_codec->s_parse.i4_error_code = IHEVCD_INSUFFICIENT_MEM_MVBANK;
  674|      0|            return IHEVCD_INSUFFICIENT_MEM_MVBANK;
  675|      0|        }
  676|       |
  677|  11.0k|        ps_mv_buf->pu4_pic_pu_idx = (UWORD32 *)pu1_buf;
  678|  11.0k|        pu1_buf += (num_ctb + 1) * sizeof(WORD32);
  679|       |
  680|  11.0k|        ps_mv_buf->pu1_pic_pu_map = pu1_buf;
  681|  11.0k|        pu1_buf += num_pu;
  682|       |
  683|  11.0k|        ps_mv_buf->pu1_pic_slice_map = (UWORD16 *)pu1_buf;
  684|  11.0k|        pu1_buf += ALIGN4(num_ctb * sizeof(UWORD16));
  ------------------
  |  |   54|  11.0k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  685|       |
  686|  11.0k|        ps_mv_buf->ps_pic_pu = (pu_t *)pu1_buf;
  687|  11.0k|        pu1_buf += num_pu * sizeof(pu_t);
  688|       |
  689|  11.0k|        buf_ret = ihevc_buf_mgr_add((buf_mgr_t *)ps_codec->pv_mv_buf_mgr, ps_mv_buf, i);
  690|       |
  691|  11.0k|        if(0 != buf_ret)
  ------------------
  |  Branch (691:12): [True: 0, False: 11.0k]
  ------------------
  692|      0|        {
  693|      0|            ps_codec->s_parse.i4_error_code = IHEVCD_BUF_MGR_ERROR;
  694|      0|            return IHEVCD_BUF_MGR_ERROR;
  695|      0|        }
  696|       |
  697|  11.0k|        ps_mv_buf++;
  698|       |
  699|  11.0k|    }
  700|  1.68k|    return ret;
  701|  1.68k|}
ihevcd_check_out_buf_size:
  722|  9.18k|{
  723|  9.18k|    ivd_out_bufdesc_t *ps_out_buffer = ps_codec->ps_out_buffer;
  724|  9.18k|    UWORD32 au4_min_out_buf_size[IVD_VIDDEC_MAX_IO_BUFFERS];
  725|  9.18k|    UWORD32 u4_min_num_out_bufs = 0, i;
  726|  9.18k|    UWORD32 wd, ht;
  727|       |
  728|  9.18k|    if(0 == ps_codec->i4_share_disp_buf)
  ------------------
  |  Branch (728:8): [True: 9.18k, False: 0]
  ------------------
  729|  9.18k|    {
  730|  9.18k|        wd = ps_codec->i4_disp_wd;
  731|  9.18k|        ht = ps_codec->i4_disp_ht;
  732|  9.18k|    }
  733|      0|    else
  734|      0|    {
  735|       |        /* In case of shared mode, do not check validity of ps_codec->ps_out_buffer */
  736|      0|        return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  737|      0|    }
  738|       |
  739|  9.18k|    if(ps_codec->i4_disp_strd > (WORD32)wd)
  ------------------
  |  Branch (739:8): [True: 0, False: 9.18k]
  ------------------
  740|      0|        wd = ps_codec->i4_disp_strd;
  741|       |
  742|  9.18k|    if(ps_codec->e_chroma_fmt == IV_YUV_420P)
  ------------------
  |  Branch (742:8): [True: 3.53k, False: 5.64k]
  ------------------
  743|  3.53k|        u4_min_num_out_bufs = MIN_OUT_BUFS_420;
  ------------------
  |  |  452|  3.53k|#define MIN_OUT_BUFS_420        3
  ------------------
  744|  5.64k|    else if(ps_codec->e_chroma_fmt == IV_YUV_422ILE)
  ------------------
  |  Branch (744:13): [True: 1.20k, False: 4.44k]
  ------------------
  745|  1.20k|        u4_min_num_out_bufs = MIN_OUT_BUFS_422ILE;
  ------------------
  |  |  453|  1.20k|#define MIN_OUT_BUFS_422ILE     1
  ------------------
  746|  4.44k|    else if(ps_codec->e_chroma_fmt == IV_RGB_565)
  ------------------
  |  Branch (746:13): [True: 442, False: 4.00k]
  ------------------
  747|    442|        u4_min_num_out_bufs = MIN_OUT_BUFS_RGB565;
  ------------------
  |  |  454|    442|#define MIN_OUT_BUFS_RGB565     1
  ------------------
  748|  4.00k|    else if(ps_codec->e_chroma_fmt == IV_RGBA_8888)
  ------------------
  |  Branch (748:13): [True: 0, False: 4.00k]
  ------------------
  749|      0|        u4_min_num_out_bufs = MIN_OUT_BUFS_RGBA8888;
  ------------------
  |  |  455|      0|#define MIN_OUT_BUFS_RGBA8888   1
  ------------------
  750|  4.00k|    else if((ps_codec->e_chroma_fmt == IV_YUV_420SP_UV)
  ------------------
  |  Branch (750:13): [True: 1.11k, False: 2.88k]
  ------------------
  751|  4.00k|                    || (ps_codec->e_chroma_fmt == IV_YUV_420SP_VU))
  ------------------
  |  Branch (751:24): [True: 2.88k, False: 0]
  ------------------
  752|  4.00k|        u4_min_num_out_bufs = MIN_OUT_BUFS_420SP;
  ------------------
  |  |  456|  4.00k|#define MIN_OUT_BUFS_420SP      2
  ------------------
  753|       |
  754|  9.18k|    if(ps_codec->e_chroma_fmt == IV_YUV_420P)
  ------------------
  |  Branch (754:8): [True: 3.53k, False: 5.64k]
  ------------------
  755|  3.53k|    {
  756|  3.53k|        au4_min_out_buf_size[0] = (wd * ht);
  757|  3.53k|        au4_min_out_buf_size[1] = (wd * ht) >> 2;
  758|  3.53k|        au4_min_out_buf_size[2] = (wd * ht) >> 2;
  759|  3.53k|    }
  760|  5.64k|    else if(ps_codec->e_chroma_fmt == IV_YUV_422ILE)
  ------------------
  |  Branch (760:13): [True: 1.20k, False: 4.44k]
  ------------------
  761|  1.20k|    {
  762|  1.20k|        au4_min_out_buf_size[0] = (wd * ht) * 2;
  763|  1.20k|        au4_min_out_buf_size[1] =
  764|  1.20k|                        au4_min_out_buf_size[2] = 0;
  765|  1.20k|    }
  766|  4.44k|    else if(ps_codec->e_chroma_fmt == IV_RGB_565)
  ------------------
  |  Branch (766:13): [True: 442, False: 4.00k]
  ------------------
  767|    442|    {
  768|    442|        au4_min_out_buf_size[0] = (wd * ht) * 2;
  769|    442|        au4_min_out_buf_size[1] =
  770|    442|                        au4_min_out_buf_size[2] = 0;
  771|    442|    }
  772|  4.00k|    else if(ps_codec->e_chroma_fmt == IV_RGBA_8888)
  ------------------
  |  Branch (772:13): [True: 0, False: 4.00k]
  ------------------
  773|      0|    {
  774|      0|        au4_min_out_buf_size[0] = (wd * ht) * 4;
  775|      0|        au4_min_out_buf_size[1] =
  776|      0|                        au4_min_out_buf_size[2] = 0;
  777|      0|    }
  778|  4.00k|    else if((ps_codec->e_chroma_fmt == IV_YUV_420SP_UV)
  ------------------
  |  Branch (778:13): [True: 1.11k, False: 2.88k]
  ------------------
  779|  4.00k|                    || (ps_codec->e_chroma_fmt == IV_YUV_420SP_VU))
  ------------------
  |  Branch (779:24): [True: 2.88k, False: 0]
  ------------------
  780|  4.00k|    {
  781|  4.00k|        au4_min_out_buf_size[0] = (wd * ht);
  782|  4.00k|        au4_min_out_buf_size[1] = (wd * ht) >> 1;
  783|  4.00k|        au4_min_out_buf_size[2] = 0;
  784|  4.00k|    }
  785|       |
  786|  9.18k|    if(ps_out_buffer->u4_num_bufs < u4_min_num_out_bufs)
  ------------------
  |  Branch (786:8): [True: 0, False: 9.18k]
  ------------------
  787|      0|    {
  788|      0|        return (IHEVCD_ERROR_T)IV_FAIL;
  789|      0|    }
  790|       |
  791|  29.4k|    for (i = 0 ; i < u4_min_num_out_bufs; i++)
  ------------------
  |  Branch (791:18): [True: 20.2k, False: 9.16k]
  ------------------
  792|  20.2k|    {
  793|  20.2k|        if(ps_out_buffer->u4_min_out_buf_size[i] < au4_min_out_buf_size[i])
  ------------------
  |  Branch (793:12): [True: 16, False: 20.2k]
  ------------------
  794|     16|        {
  795|     16|            return (IHEVCD_ERROR_T)IV_FAIL;
  796|     16|        }
  797|  20.2k|    }
  798|       |
  799|  9.16k|    return (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  800|  9.18k|}
ihevcd_parse_pic_init:
  823|  9.34k|{
  824|  9.34k|    IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS;
  825|  9.34k|    mv_buf_t *ps_mv_buf;
  826|  9.34k|    sps_t *ps_sps;
  827|  9.34k|    WORD32 num_min_cu;
  828|  9.34k|    WORD32 cur_pic_buf_id;
  829|  9.34k|    WORD32 cur_mv_bank_buf_id;
  830|  9.34k|    pic_buf_t *ps_cur_pic;
  831|  9.34k|    slice_header_t *ps_slice_hdr;
  832|  9.34k|    UWORD8 *pu1_cur_pic_luma, *pu1_cur_pic_chroma;
  833|  9.34k|    WORD32 i;
  834|       |
  835|  9.34k|    ps_codec->s_parse.i4_error_code = IHEVCD_SUCCESS;
  836|  9.34k|    ps_sps = ps_codec->s_parse.ps_sps;
  837|  9.34k|    ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
  838|       |
  839|       |    /* Memset picture level intra map and transquant bypass map to zero */
  840|  9.34k|    num_min_cu = ((ps_sps->i2_pic_height_in_luma_samples + 7) / 8) * ((ps_sps->i2_pic_width_in_luma_samples + 63) / 64);
  841|  9.34k|    memset(ps_codec->s_parse.pu1_pic_intra_flag, 0, num_min_cu);
  842|  9.34k|    memset(ps_codec->s_parse.pu1_pic_no_loop_filter_flag, 0, num_min_cu);
  843|       |
  844|       |
  845|       |
  846|  9.34k|    if(0 == ps_codec->s_parse.i4_first_pic_init)
  ------------------
  |  Branch (846:8): [True: 1.68k, False: 7.66k]
  ------------------
  847|  1.68k|    {
  848|  1.68k|        ret = ihevcd_mv_buf_mgr_add_bufs(ps_codec);
  849|  1.68k|        RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  1.68k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 1.68k]
  |  |  ------------------
  ------------------
  850|       |
  851|  1.68k|        ret = ihevcd_pic_buf_mgr_add_bufs(ps_codec);
  852|  1.68k|        RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  1.68k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 166, False: 1.51k]
  |  |  ------------------
  ------------------
  853|       |
  854|  1.51k|        ps_codec->s_parse.i4_first_pic_init = 1;
  855|  1.51k|    }
  856|       |
  857|       |    /* Output buffer check */
  858|  9.18k|    ret = ihevcd_check_out_buf_size(ps_codec);
  859|  9.18k|    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  9.18k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 16, False: 9.16k]
  |  |  ------------------
  ------------------
  860|       |
  861|       |    /* Initialize all the slice headers' slice addresses to zero */
  862|  9.16k|    {
  863|  9.16k|        WORD32 slice_idx;
  864|  9.16k|        WORD32 slice_start_idx;
  865|       |
  866|  9.16k|        slice_start_idx = ps_codec->i4_slice_error ? 2 : 1;
  ------------------
  |  Branch (866:27): [True: 394, False: 8.77k]
  ------------------
  867|       |
  868|  2.34M|        for(slice_idx = slice_start_idx; slice_idx < MAX_SLICE_HDR_CNT; slice_idx++)
  ------------------
  |  |  153|  2.34M|#define MAX_SLICE_HDR_CNT (1 << LOG2_MAX_SLICE_HDR_CNT)
  |  |  ------------------
  |  |  |  |  152|  2.34M|#define LOG2_MAX_SLICE_HDR_CNT 8
  |  |  ------------------
  ------------------
  |  Branch (868:42): [True: 2.33M, False: 9.16k]
  ------------------
  869|  2.33M|        {
  870|  2.33M|            slice_header_t *ps_slice_hdr_tmp = ps_codec->ps_slice_hdr_base + slice_idx;
  871|  2.33M|            ps_slice_hdr_tmp->i2_ctb_x = -1;
  872|  2.33M|            ps_slice_hdr_tmp->i2_ctb_y = -1;
  873|       |
  874|  2.33M|        }
  875|  9.16k|    }
  876|       |
  877|       |    /* Get free MV Bank to hold current picture's motion vector data */
  878|  9.16k|    {
  879|  9.16k|        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);
  880|       |
  881|       |        /* If there are no free buffers then return with an error code.
  882|       |         * If the buffer is to be freed by another thread , change the
  883|       |         * following to call thread yield and wait for buffer to be freed
  884|       |         */
  885|  9.16k|        if(NULL == ps_mv_buf)
  ------------------
  |  Branch (885:12): [True: 8, False: 9.15k]
  ------------------
  886|      8|        {
  887|      8|            ps_codec->s_parse.i4_error_code = IHEVCD_NO_FREE_MVBANK;
  888|      8|            ps_codec->i4_error_code = IHEVCD_NO_FREE_MVBANK;
  889|      8|            return IHEVCD_NO_FREE_MVBANK;
  890|      8|        }
  891|       |
  892|  9.15k|        ps_codec->s_parse.ps_cur_mv_buf = ps_mv_buf;
  893|       |        /* Set current ABS poc to ps_mv_buf, so that while freeing a reference buffer
  894|       |         * corresponding mv buffer can be found by looping through ps_codec->ps_mv_buf array
  895|       |         * and getting a buffer id to free
  896|       |         */
  897|  9.15k|        ps_mv_buf->i4_abs_poc = ps_slice_hdr->i4_abs_pic_order_cnt;
  898|  9.15k|    }
  899|       |
  900|       |    /* Get free picture buffer to hold current picture recon data */
  901|       |    /* TODO: For asynchronous api the following initializations related to picture
  902|       |     * buffer should be moved to processing side
  903|       |     */
  904|      0|    {
  905|       |
  906|  9.15k|        UWORD8 *pu1_buf;
  907|  9.15k|        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);
  908|       |
  909|       |        /* If there are no free buffers then return with an error code.
  910|       |         * TODO: If the buffer is to be freed by another thread , change the
  911|       |         * following to call thread yield and wait for buffer to be freed
  912|       |         */
  913|  9.15k|        if(NULL == ps_cur_pic)
  ------------------
  |  Branch (913:12): [True: 16, False: 9.14k]
  ------------------
  914|     16|        {
  915|     16|            ps_codec->s_parse.i4_error_code = IHEVCD_NO_FREE_PICBUF;
  916|     16|            ps_codec->i4_error_code = IHEVCD_NO_FREE_PICBUF;
  917|     16|            return IHEVCD_NO_FREE_PICBUF;
  918|     16|        }
  919|       |
  920|       |        /* Store input timestamp sent with input buffer */
  921|  9.14k|        ps_cur_pic->u4_ts = ps_codec->u4_ts;
  922|  9.14k|        ps_cur_pic->i4_abs_poc = ps_slice_hdr->i4_abs_pic_order_cnt;
  923|  9.14k|        ps_cur_pic->i4_poc_lsb = ps_slice_hdr->i4_pic_order_cnt_lsb;
  924|  9.14k|        pu1_buf = ps_cur_pic->pu1_luma;
  925|  9.14k|        pu1_cur_pic_luma = pu1_buf;
  926|       |
  927|  9.14k|        pu1_buf = ps_cur_pic->pu1_chroma;
  928|       |
  929|  9.14k|        pu1_cur_pic_chroma = pu1_buf;
  930|       |
  931|  9.14k|        ps_cur_pic->s_sei_params.i1_sei_parameters_present_flag = 0;
  932|  9.14k|        if(ps_codec->s_parse.s_sei_params.i1_sei_parameters_present_flag)
  ------------------
  |  Branch (932:12): [True: 190, False: 8.95k]
  ------------------
  933|    190|        {
  934|    190|            sei_params_t *ps_sei = &ps_codec->s_parse.s_sei_params;
  935|    190|            ps_cur_pic->s_sei_params = ps_codec->s_parse.s_sei_params;
  936|       |
  937|       |            /* Once sei_params is copied to pic_buf,
  938|       |             * mark sei_params in s_parse as not present,
  939|       |             * this ensures that future frames do not use this data again.
  940|       |             */
  941|    190|            ps_sei->i1_sei_parameters_present_flag = 0;
  942|    190|            ps_sei->i1_user_data_registered_present_flag = 0;
  943|    190|            ps_sei->i1_aud_present_flag = 0;
  944|    190|            ps_sei->i1_time_code_present_flag = 0;
  945|    190|            ps_sei->i1_buf_period_params_present_flag = 0;
  946|    190|            ps_sei->i1_pic_timing_params_present_flag = 0;
  947|    190|            ps_sei->i1_recovery_point_params_present_flag = 0;
  948|    190|            ps_sei->i1_active_parameter_set = 0;
  949|    190|            ps_sei->i4_sei_mastering_disp_colour_vol_params_present_flags = 0;
  950|    190|        }
  951|  9.14k|    }
  952|       |
  953|  9.14k|    if(0 == ps_codec->u4_pic_cnt)
  ------------------
  |  Branch (953:8): [True: 1.51k, False: 7.62k]
  ------------------
  954|  1.51k|    {
  955|  1.51k|        memset(ps_cur_pic->pu1_luma, 128, (ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * ps_sps->i2_pic_height_in_luma_samples);
  ------------------
  |  |   91|  1.51k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  1.51k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  1.51k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
  956|  1.51k|        memset(ps_cur_pic->pu1_chroma, 128, (ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * ps_sps->i2_pic_height_in_luma_samples / 2);
  ------------------
  |  |   91|  1.51k|#define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   82|  1.51k|#define PAD_LEFT    80
  |  |  ------------------
  |  |               #define PAD_WD      (PAD_LEFT + PAD_RIGHT)
  |  |  ------------------
  |  |  |  |   87|  1.51k|#define PAD_RIGHT   80
  |  |  ------------------
  ------------------
  957|  1.51k|    }
  958|       |
  959|       |    /* Fill the remaining entries of the reference lists with the nearest POC
  960|       |     * This is done to handle cases where there is a corruption in the reference index */
  961|  9.14k|    {
  962|  9.14k|        pic_buf_t *ps_pic_buf_ref;
  963|  9.14k|        mv_buf_t *ps_mv_buf_ref;
  964|  9.14k|        WORD32 r_idx;
  965|  9.14k|        dpb_mgr_t *ps_dpb_mgr = (dpb_mgr_t *)ps_codec->pv_dpb_mgr;
  966|  9.14k|        buf_mgr_t *ps_mv_buf_mgr = (buf_mgr_t *)ps_codec->pv_mv_buf_mgr;
  967|       |
  968|  9.14k|        ps_pic_buf_ref = ihevc_dpb_mgr_get_ref_by_nearest_poc(ps_dpb_mgr, ps_slice_hdr->i4_abs_pic_order_cnt);
  969|  9.14k|        if(NULL == ps_pic_buf_ref)
  ------------------
  |  Branch (969:12): [True: 7.69k, False: 1.44k]
  ------------------
  970|  7.69k|        {
  971|  7.69k|            WORD32 size;
  972|       |
  973|  7.69k|            WORD32 num_pu;
  974|  7.69k|            WORD32 num_ctb;
  975|  7.69k|            WORD32 pic_size;
  976|       |            /* In case current mv buffer itself is being used as reference mv buffer for colocated
  977|       |             * calculations, then memset all the buffers to zero.
  978|       |             */
  979|  7.69k|            pic_size = ALIGN64(ps_sps->i2_pic_width_in_luma_samples) *
  ------------------
  |  |   50|  7.69k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
  980|  7.69k|                            ALIGN64(ps_sps->i2_pic_height_in_luma_samples);
  ------------------
  |  |   50|  7.69k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
  981|       |
  982|  7.69k|            num_pu = pic_size / (MIN_PU_SIZE * MIN_PU_SIZE);
  ------------------
  |  |  357|  7.69k|#define MIN_PU_SIZE         4
  ------------------
                          num_pu = pic_size / (MIN_PU_SIZE * MIN_PU_SIZE);
  ------------------
  |  |  357|  7.69k|#define MIN_PU_SIZE         4
  ------------------
  983|  7.69k|            num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  342|  7.69k|#define MIN_CTB_SIZE        16
  ------------------
                          num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  342|  7.69k|#define MIN_CTB_SIZE        16
  ------------------
  984|       |
  985|  7.69k|            memset(ps_mv_buf->ai4_l0_collocated_poc, 0, sizeof(ps_mv_buf->ai4_l0_collocated_poc));
  986|  7.69k|            memset(ps_mv_buf->ai1_l0_collocated_poc_lt, 0, sizeof(ps_mv_buf->ai1_l0_collocated_poc_lt));
  987|  7.69k|            memset(ps_mv_buf->ai4_l1_collocated_poc, 0, sizeof(ps_mv_buf->ai4_l1_collocated_poc));
  988|  7.69k|            memset(ps_mv_buf->ai1_l1_collocated_poc_lt, 0, sizeof(ps_mv_buf->ai1_l1_collocated_poc_lt));
  989|       |
  990|  7.69k|            size = (num_ctb + 1) * sizeof(WORD32);
  991|  7.69k|            memset(ps_mv_buf->pu4_pic_pu_idx, 0, size);
  992|       |
  993|  7.69k|            size = num_pu;
  994|  7.69k|            memset(ps_mv_buf->pu1_pic_pu_map, 0, size);
  995|  7.69k|            size = ALIGN4(num_ctb * sizeof(UWORD16));
  ------------------
  |  |   54|  7.69k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  996|  7.69k|            memset(ps_mv_buf->pu1_pic_slice_map, 0, size);
  997|  7.69k|            size = num_pu * sizeof(pu_t);
  998|  7.69k|            memset(ps_mv_buf->ps_pic_pu, 0, size);
  999|       |
 1000|  7.69k|            ps_pic_buf_ref = ps_cur_pic;
 1001|  7.69k|            ps_mv_buf_ref = ps_mv_buf;
 1002|  7.69k|        }
 1003|  1.44k|        else
 1004|  1.44k|        {
 1005|  1.44k|            ps_mv_buf_ref = ihevcd_mv_mgr_get_poc(ps_mv_buf_mgr, ps_pic_buf_ref->i4_abs_poc);
 1006|  1.44k|        }
 1007|       |
 1008|  13.9k|        for(r_idx = 0; r_idx < ps_slice_hdr->i1_num_ref_idx_l0_active; r_idx++)
  ------------------
  |  Branch (1008:24): [True: 4.80k, False: 9.14k]
  ------------------
 1009|  4.80k|        {
 1010|  4.80k|            if(NULL == ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf)
  ------------------
  |  Branch (1010:16): [True: 738, False: 4.07k]
  ------------------
 1011|    738|            {
 1012|    738|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1013|    738|                ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1014|    738|            }
 1015|  4.80k|        }
 1016|       |
 1017|   150k|        for(r_idx = ps_slice_hdr->i1_num_ref_idx_l0_active; r_idx < MAX_DPB_SIZE; r_idx++)
  ------------------
  |  |  281|   150k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (1017:61): [True: 141k, False: 9.14k]
  ------------------
 1018|   141k|        {
 1019|   141k|            ps_slice_hdr->as_ref_pic_list0[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1020|   141k|            ps_slice_hdr->as_ref_pic_list0[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1021|   141k|        }
 1022|       |
 1023|  13.0k|        for(r_idx = 0; r_idx < ps_slice_hdr->i1_num_ref_idx_l1_active; r_idx++)
  ------------------
  |  Branch (1023:24): [True: 3.91k, False: 9.14k]
  ------------------
 1024|  3.91k|        {
 1025|  3.91k|            if(NULL == ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf)
  ------------------
  |  Branch (1025:16): [True: 1.15k, False: 2.76k]
  ------------------
 1026|  1.15k|            {
 1027|  1.15k|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1028|  1.15k|                ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1029|  1.15k|            }
 1030|  3.91k|        }
 1031|       |
 1032|   151k|        for(r_idx = ps_slice_hdr->i1_num_ref_idx_l1_active; r_idx < MAX_DPB_SIZE; r_idx++)
  ------------------
  |  |  281|   151k|#define MAX_DPB_SIZE 16
  ------------------
  |  Branch (1032:61): [True: 142k, False: 9.14k]
  ------------------
 1033|   142k|        {
 1034|   142k|            ps_slice_hdr->as_ref_pic_list1[r_idx].pv_pic_buf = (void *)ps_pic_buf_ref;
 1035|   142k|            ps_slice_hdr->as_ref_pic_list1[r_idx].pv_mv_buf = (void *)ps_mv_buf_ref;
 1036|   142k|        }
 1037|  9.14k|    }
 1038|       |
 1039|       |
 1040|       |    /* Reset the jobq to start of the jobq buffer */
 1041|  9.14k|    ihevcd_jobq_reset((jobq_t *)ps_codec->pv_proc_jobq);
 1042|       |
 1043|  9.14k|    if(ps_codec->i4_threads_active)
  ------------------
  |  Branch (1043:8): [True: 9.14k, False: 0]
  ------------------
 1044|  9.14k|    {
 1045|  9.14k|        ps_codec->i4_break_threads = 0;
 1046|  9.14k|    }
 1047|  9.14k|    ps_codec->s_parse.i4_pic_pu_idx = 0;
 1048|  9.14k|    ps_codec->s_parse.i4_pic_tu_idx = 0;
 1049|       |
 1050|  9.14k|    ps_codec->s_parse.pu1_pic_pu_map = ps_mv_buf->pu1_pic_pu_map;
 1051|  9.14k|    ps_codec->s_parse.ps_pic_pu      = ps_mv_buf->ps_pic_pu;
 1052|  9.14k|    ps_codec->s_parse.pu4_pic_pu_idx = ps_mv_buf->pu4_pic_pu_idx;
 1053|  9.14k|    ps_codec->s_parse.pu1_slice_idx = (UWORD16 *)ps_mv_buf->pu1_pic_slice_map;
 1054|  82.2k|    for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  82.2k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  82.2k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1054:16): [True: 73.1k, False: 9.14k]
  ------------------
 1055|  73.1k|    {
 1056|  73.1k|        ps_codec->as_process[i].pu1_slice_idx = (UWORD16 *)ps_mv_buf->pu1_pic_slice_map;
 1057|  73.1k|    }
 1058|  9.14k|    ps_codec->s_parse.pu1_pu_map = ps_codec->s_parse.pu1_pic_pu_map;
 1059|  9.14k|    ps_codec->s_parse.ps_pu = ps_codec->s_parse.ps_pic_pu;
 1060|       |
 1061|  9.14k|    {
 1062|  9.14k|        UWORD8 *pu1_buf;
 1063|  9.14k|        WORD32 ctb_luma_min_tu_cnt, ctb_chroma_min_tu_cnt, ctb_min_tu_cnt;
 1064|  9.14k|        WORD32 pic_size;
 1065|  9.14k|        WORD32 num_ctb;
 1066|       |
 1067|  9.14k|        pic_size = ALIGN64(ps_sps->i2_pic_width_in_luma_samples) *
  ------------------
  |  |   50|  9.14k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1068|  9.14k|                        ALIGN64(ps_sps->i2_pic_height_in_luma_samples);
  ------------------
  |  |   50|  9.14k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1069|       |
 1070|  9.14k|        ctb_luma_min_tu_cnt = pic_size / (MIN_TU_SIZE * MIN_TU_SIZE);
  ------------------
  |  |  348|  9.14k|#define MIN_TU_SIZE         4
  ------------------
                      ctb_luma_min_tu_cnt = pic_size / (MIN_TU_SIZE * MIN_TU_SIZE);
  ------------------
  |  |  348|  9.14k|#define MIN_TU_SIZE         4
  ------------------
 1071|       |
 1072|  9.14k|        ctb_chroma_min_tu_cnt = ctb_luma_min_tu_cnt >> 1;
 1073|       |
 1074|  9.14k|        ctb_min_tu_cnt = ctb_luma_min_tu_cnt + ctb_chroma_min_tu_cnt;
 1075|       |
 1076|  9.14k|        num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  342|  9.14k|#define MIN_CTB_SIZE        16
  ------------------
                      num_ctb = pic_size / (MIN_CTB_SIZE * MIN_CTB_SIZE);
  ------------------
  |  |  342|  9.14k|#define MIN_CTB_SIZE        16
  ------------------
 1077|  9.14k|        pu1_buf  = (UWORD8 *)ps_codec->pv_tu_data;
 1078|  9.14k|        ps_codec->s_parse.pu4_pic_tu_idx = (UWORD32 *)pu1_buf;
 1079|  9.14k|        pu1_buf += (num_ctb + 1) * sizeof(WORD32);
 1080|       |
 1081|  9.14k|        ps_codec->s_parse.pu1_pic_tu_map = pu1_buf;
 1082|  9.14k|        pu1_buf += ctb_min_tu_cnt;
 1083|       |
 1084|  9.14k|        ps_codec->s_parse.ps_pic_tu = (tu_t *)pu1_buf;
 1085|  9.14k|        pu1_buf += ctb_min_tu_cnt * sizeof(tu_t);
 1086|       |
 1087|  9.14k|        ps_codec->s_parse.pv_pic_tu_coeff_data = pu1_buf;
 1088|       |
 1089|  9.14k|        ps_codec->s_parse.pu1_tu_map = ps_codec->s_parse.pu1_pic_tu_map;
 1090|  9.14k|        ps_codec->s_parse.ps_tu = ps_codec->s_parse.ps_pic_tu;
 1091|  9.14k|        ps_codec->s_parse.pv_tu_coeff_data = ps_codec->s_parse.pv_pic_tu_coeff_data;
 1092|  9.14k|    }
 1093|       |
 1094|  9.14k|    ps_codec->s_parse.s_bs_ctxt.ps_pic_pu = ps_codec->s_parse.ps_pic_pu;
 1095|  9.14k|    ps_codec->s_parse.s_bs_ctxt.pu4_pic_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx;
 1096|  9.14k|    ps_codec->s_parse.s_bs_ctxt.pu4_pic_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx;
 1097|       |
 1098|       |
 1099|       |    /* Set number of CTBs to be processed simultaneously */
 1100|  9.14k|    ps_codec->i4_proc_nctb = ihevcd_nctb_cnt(ps_codec, ps_sps);
 1101|       |
 1102|       |    /* Memset Parse Map and process map at the start of frame */
 1103|       |    //TODO: In case of asynchronous API proc_map can not be set to zero here
 1104|  9.14k|    {
 1105|  9.14k|        WORD32 num_ctb;
 1106|       |
 1107|  9.14k|        num_ctb = ps_sps->i4_pic_size_in_ctb;
 1108|       |
 1109|  9.14k|        memset(ps_codec->pu1_parse_map, 0, num_ctb);
 1110|       |
 1111|  9.14k|        memset(ps_codec->pu1_proc_map, 0, num_ctb);
 1112|  9.14k|    }
 1113|       |
 1114|       |
 1115|       |
 1116|       |    /* Initialize disp buf id to -1, this will be updated at the end of frame if there is
 1117|       |     * buffer to be displayed
 1118|       |     */
 1119|  9.14k|    ps_codec->i4_disp_buf_id = -1;
 1120|  9.14k|    ps_codec->ps_disp_buf = NULL;
 1121|       |
 1122|  9.14k|    ps_codec->i4_disable_deblk_pic  = 0;
 1123|  9.14k|    ps_codec->i4_disable_sao_pic    = 0;
 1124|  9.14k|    ps_codec->i4_fullpel_inter_pred = 0;
 1125|  9.14k|    ps_codec->i4_mv_frac_mask       = 0x7FFFFFFF;
 1126|       |
 1127|       |    /* If degrade is enabled, set the degrade flags appropriately */
 1128|  9.14k|    if(ps_codec->i4_degrade_type && ps_codec->i4_degrade_pics)
  ------------------
  |  Branch (1128:8): [True: 0, False: 9.14k]
  |  Branch (1128:37): [True: 0, False: 0]
  ------------------
 1129|      0|    {
 1130|      0|        WORD32 degrade_pic;
 1131|      0|        ps_codec->i4_degrade_pic_cnt++;
 1132|      0|        degrade_pic = 0;
 1133|       |
 1134|       |        /* If degrade is to be done in all frames, then do not check further */
 1135|      0|        switch(ps_codec->i4_degrade_pics)
  ------------------
  |  Branch (1135:16): [True: 0, False: 0]
  ------------------
 1136|      0|        {
 1137|      0|            case 4:
  ------------------
  |  Branch (1137:13): [True: 0, False: 0]
  ------------------
 1138|      0|            {
 1139|      0|                degrade_pic = 1;
 1140|      0|                break;
 1141|      0|            }
 1142|      0|            case 3:
  ------------------
  |  Branch (1142:13): [True: 0, False: 0]
  ------------------
 1143|      0|            {
 1144|      0|                if(ps_slice_hdr->i1_slice_type != ISLICE)
  ------------------
  |  Branch (1144:20): [True: 0, False: 0]
  ------------------
 1145|      0|                    degrade_pic = 1;
 1146|       |
 1147|      0|                break;
 1148|      0|            }
 1149|      0|            case 2:
  ------------------
  |  Branch (1149:13): [True: 0, False: 0]
  ------------------
 1150|      0|            {
 1151|       |
 1152|       |                /* If pic count hits non-degrade interval or it is an islice, then do not degrade */
 1153|      0|                if((ps_slice_hdr->i1_slice_type != ISLICE) &&
  ------------------
  |  Branch (1153:20): [True: 0, False: 0]
  ------------------
 1154|      0|                   (ps_codec->i4_degrade_pic_cnt != ps_codec->i4_nondegrade_interval))
  ------------------
  |  Branch (1154:20): [True: 0, False: 0]
  ------------------
 1155|      0|                    degrade_pic = 1;
 1156|       |
 1157|      0|                break;
 1158|      0|            }
 1159|      0|            case 1:
  ------------------
  |  Branch (1159:13): [True: 0, False: 0]
  ------------------
 1160|      0|            {
 1161|       |                /* Check if the current picture is non-ref */
 1162|      0|                if((ps_slice_hdr->i1_nal_unit_type < NAL_BLA_W_LP) &&
  ------------------
  |  Branch (1162:20): [True: 0, False: 0]
  ------------------
 1163|      0|                   (ps_slice_hdr->i1_nal_unit_type % 2 == 0))
  ------------------
  |  Branch (1163:20): [True: 0, False: 0]
  ------------------
 1164|      0|                {
 1165|      0|                    degrade_pic = 1;
 1166|      0|                }
 1167|      0|                break;
 1168|      0|            }
 1169|       |
 1170|       |
 1171|      0|        }
 1172|      0|        if(degrade_pic)
  ------------------
  |  Branch (1172:12): [True: 0, False: 0]
  ------------------
 1173|      0|        {
 1174|      0|            if(ps_codec->i4_degrade_type & 0x1)
  ------------------
  |  Branch (1174:16): [True: 0, False: 0]
  ------------------
 1175|      0|                ps_codec->i4_disable_sao_pic = 1;
 1176|       |
 1177|      0|            if(ps_codec->i4_degrade_type & 0x2)
  ------------------
  |  Branch (1177:16): [True: 0, False: 0]
  ------------------
 1178|      0|                ps_codec->i4_disable_deblk_pic = 1;
 1179|       |
 1180|       |            /* MC degrading is done only for non-ref pictures */
 1181|      0|            if((ps_slice_hdr->i1_nal_unit_type < NAL_BLA_W_LP) &&
  ------------------
  |  Branch (1181:16): [True: 0, False: 0]
  ------------------
 1182|      0|               (ps_slice_hdr->i1_nal_unit_type % 2 == 0))
  ------------------
  |  Branch (1182:16): [True: 0, False: 0]
  ------------------
 1183|      0|            {
 1184|      0|                if(ps_codec->i4_degrade_type & 0x4)
  ------------------
  |  Branch (1184:20): [True: 0, False: 0]
  ------------------
 1185|      0|                    ps_codec->i4_mv_frac_mask = 0;
 1186|       |
 1187|      0|                if(ps_codec->i4_degrade_type & 0x8)
  ------------------
  |  Branch (1187:20): [True: 0, False: 0]
  ------------------
 1188|      0|                    ps_codec->i4_mv_frac_mask = 0;
 1189|      0|            }
 1190|      0|        }
 1191|      0|        else
 1192|      0|            ps_codec->i4_degrade_pic_cnt = 0;
 1193|      0|    }
 1194|       |
 1195|       |
 1196|  9.14k|    {
 1197|  9.14k|        WORD32 i;
 1198|  82.2k|        for(i = 0; i < MAX_PROCESS_THREADS; i++)
  ------------------
  |  |  121|  82.2k|#define MAX_PROCESS_THREADS MAX_NUM_CORES
  |  |  ------------------
  |  |  |  |  116|  82.2k|#define MAX_NUM_CORES       8
  |  |  ------------------
  ------------------
  |  Branch (1198:20): [True: 73.1k, False: 9.14k]
  ------------------
 1199|  73.1k|        {
 1200|  73.1k|            ps_codec->as_process[i].pu4_pic_pu_idx = ps_codec->s_parse.pu4_pic_pu_idx;
 1201|  73.1k|            ps_codec->as_process[i].ps_pic_pu = ps_codec->s_parse.ps_pic_pu;
 1202|  73.1k|            ps_codec->as_process[i].pu1_pic_pu_map = ps_codec->s_parse.pu1_pic_pu_map;
 1203|  73.1k|            ps_codec->as_process[i].pu4_pic_tu_idx = ps_codec->s_parse.pu4_pic_tu_idx;
 1204|  73.1k|            ps_codec->as_process[i].ps_pic_tu = ps_codec->s_parse.ps_pic_tu;
 1205|  73.1k|            ps_codec->as_process[i].pu1_pic_tu_map = ps_codec->s_parse.pu1_pic_tu_map;
 1206|  73.1k|            ps_codec->as_process[i].pv_pic_tu_coeff_data = ps_codec->s_parse.pv_pic_tu_coeff_data;
 1207|  73.1k|            ps_codec->as_process[i].i4_cur_mv_bank_buf_id = cur_mv_bank_buf_id;
 1208|  73.1k|            ps_codec->as_process[i].s_sao_ctxt.pu1_slice_idx = ps_codec->as_process[i].pu1_slice_idx;
 1209|  73.1k|            ps_codec->as_process[i].s_sao_ctxt.pu1_tile_idx = ps_codec->as_process[i].pu1_tile_idx;
 1210|       |
 1211|       |            /* TODO: For asynchronous api the following initializations related to picture
 1212|       |             * buffer should be moved to processing side
 1213|       |             */
 1214|  73.1k|            ps_codec->as_process[i].pu1_cur_pic_luma = pu1_cur_pic_luma;
 1215|  73.1k|            ps_codec->as_process[i].pu1_cur_pic_chroma = pu1_cur_pic_chroma;
 1216|  73.1k|            ps_codec->as_process[i].ps_cur_pic = ps_cur_pic;
 1217|  73.1k|            ps_codec->as_process[i].i4_cur_pic_buf_id = cur_pic_buf_id;
 1218|       |
 1219|  73.1k|            ps_codec->as_process[i].ps_out_buffer = ps_codec->ps_out_buffer;
 1220|  73.1k|            if(1 < ps_codec->i4_num_cores)
  ------------------
  |  Branch (1220:16): [True: 55.5k, False: 17.5k]
  ------------------
 1221|  55.5k|            {
 1222|  55.5k|                ps_codec->as_process[i].i4_check_parse_status = 1;
 1223|  55.5k|                ps_codec->as_process[i].i4_check_proc_status = 1;
 1224|  55.5k|            }
 1225|  17.5k|            else
 1226|  17.5k|            {
 1227|  17.5k|                ps_codec->as_process[i].i4_check_parse_status = 0;
 1228|  17.5k|                ps_codec->as_process[i].i4_check_proc_status = 0;
 1229|  17.5k|            }
 1230|  73.1k|            ps_codec->as_process[i].pu1_pic_intra_flag = ps_codec->s_parse.pu1_pic_intra_flag;
 1231|  73.1k|            ps_codec->as_process[i].pu1_pic_no_loop_filter_flag = ps_codec->s_parse.pu1_pic_no_loop_filter_flag;
 1232|  73.1k|            ps_codec->as_process[i].i4_init_done = 0;
 1233|       |
 1234|  73.1k|            ps_codec->as_process[i].s_bs_ctxt.pu4_pic_tu_idx = ps_codec->as_process[i].pu4_pic_tu_idx;
 1235|  73.1k|            ps_codec->as_process[i].s_bs_ctxt.pu4_pic_pu_idx = ps_codec->as_process[i].pu4_pic_pu_idx;
 1236|  73.1k|            ps_codec->as_process[i].s_bs_ctxt.ps_pic_pu = ps_codec->as_process[i].ps_pic_pu;
 1237|  73.1k|            ps_codec->as_process[i].s_deblk_ctxt.pu1_pic_no_loop_filter_flag = ps_codec->s_parse.pu1_pic_no_loop_filter_flag;
 1238|  73.1k|            ps_codec->as_process[i].s_deblk_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma;
 1239|  73.1k|            ps_codec->as_process[i].s_deblk_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma;
 1240|  73.1k|            ps_codec->as_process[i].s_sao_ctxt.pu1_pic_no_loop_filter_flag = ps_codec->s_parse.pu1_pic_no_loop_filter_flag;
 1241|  73.1k|            ps_codec->as_process[i].s_sao_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma;
 1242|  73.1k|            ps_codec->as_process[i].s_sao_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma;
 1243|  73.1k|            if(i < (ps_codec->i4_num_cores - 1))
  ------------------
  |  Branch (1243:16): [True: 10.2k, False: 62.8k]
  ------------------
 1244|  10.2k|            {
 1245|  10.2k|                if (!ps_codec->ai4_process_thread_created[i])
  ------------------
  |  Branch (1245:21): [True: 903, False: 9.34k]
  ------------------
 1246|    903|                {
 1247|    903|                    ithread_create(ps_codec->apv_process_thread_handle[i], NULL,
 1248|    903|                                (void *)ihevcd_process_thread,
 1249|    903|                                (void *)&ps_codec->as_process[i]);
 1250|    903|                    ps_codec->ai4_process_thread_created[i] = 1;
 1251|    903|                }
 1252|  10.2k|                if(ps_codec->i4_threads_active)
  ------------------
  |  Branch (1252:20): [True: 10.2k, False: 0]
  ------------------
 1253|  10.2k|                {
 1254|  10.2k|                    ret = ithread_mutex_lock(ps_codec->apv_proc_start_mutex[i]);
 1255|  10.2k|                    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  10.2k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 10.2k]
  |  |  ------------------
  ------------------
 1256|       |
 1257|  10.2k|                    ps_codec->ai4_process_start[i] = 1;
 1258|  10.2k|                    ithread_cond_signal(ps_codec->apv_proc_start_condition[i]);
 1259|       |
 1260|  10.2k|                    ret = ithread_mutex_unlock(ps_codec->apv_proc_start_mutex[i]);
 1261|  10.2k|                    RETURN_IF((ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS), ret);
  ------------------
  |  |   37|  10.2k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (37:36): [True: 0, False: 10.2k]
  |  |  ------------------
  ------------------
 1262|  10.2k|                }
 1263|  10.2k|            }
 1264|  62.8k|            else
 1265|  62.8k|            {
 1266|  62.8k|                ps_codec->ai4_process_thread_created[i] = 0;
 1267|  62.8k|            }
 1268|       |
 1269|  73.1k|        }
 1270|  9.14k|        if(ps_codec->u1_enable_cu_info)
  ------------------
  |  Branch (1270:12): [True: 0, False: 9.14k]
  ------------------
 1271|      0|        {
 1272|      0|            ps_codec->as_buf_id_info_map[cur_pic_buf_id].pu1_qp_map =
 1273|      0|                ps_codec->pu1_qp_map_base + (cur_pic_buf_id * ps_codec->u4_num_8x8_blks);
 1274|      0|            ps_codec->as_buf_id_info_map[cur_pic_buf_id].pu1_cu_type_map =
 1275|      0|                ps_codec->pu1_cu_type_map_base + (cur_pic_buf_id * ps_codec->u4_num_8x8_blks);
 1276|      0|            memset(ps_codec->as_buf_id_info_map[cur_pic_buf_id].pu1_qp_map,
 1277|      0|                0, ps_codec->u4_num_8x8_blks);
 1278|      0|            memset(ps_codec->as_buf_id_info_map[cur_pic_buf_id].pu1_qp_map,
 1279|      0|                0, ps_codec->u4_num_8x8_blks);
 1280|      0|        }
 1281|       |
 1282|  9.14k|        ps_codec->s_parse.s_deblk_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma;
 1283|  9.14k|        ps_codec->s_parse.s_deblk_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma;
 1284|       |
 1285|  9.14k|        ps_codec->s_parse.s_sao_ctxt.pu1_cur_pic_luma = pu1_cur_pic_luma;
 1286|  9.14k|        ps_codec->s_parse.s_sao_ctxt.pu1_cur_pic_chroma = pu1_cur_pic_chroma;
 1287|  9.14k|    }
 1288|       |    /* Since any input bitstream buffer that contains slice data will be sent to output(even in
 1289|       |     * case of error, this buffer is added to display queue and next buffer in the display queue
 1290|       |     * will be returned as the display buffer.
 1291|       |     * Note: If format conversion (or frame copy) is used and is scheduled
 1292|       |     * in a different thread then it has to check if the processing for the current row is complete before
 1293|       |     * it copies/converts a given row. In case of low delay or in case of B pictures, current frame being decoded has to be
 1294|       |     * returned, which requires a status check to ensure that the current row is reconstructed before copying.
 1295|       |     */
 1296|       |    /* Add current picture to display manager */
 1297|      0|    {
 1298|  9.14k|        WORD32 abs_poc;
 1299|  9.14k|        slice_header_t *ps_slice_hdr;
 1300|  9.14k|        ps_slice_hdr = ps_codec->s_parse.ps_slice_hdr;
 1301|  9.14k|        abs_poc = ps_slice_hdr->i4_abs_pic_order_cnt;
 1302|  9.14k|        ihevc_disp_mgr_add((disp_mgr_t *)ps_codec->pv_disp_buf_mgr,
 1303|  9.14k|                           ps_codec->as_process[0].i4_cur_pic_buf_id,
 1304|  9.14k|                           abs_poc,
 1305|  9.14k|                           ps_codec->as_process[0].ps_cur_pic);
 1306|  9.14k|    }
 1307|  9.14k|    ps_codec->ps_disp_buf = NULL;
 1308|       |    /* Get picture to be displayed if number of pictures decoded is more than max allowed reorder */
 1309|       |    /* Since the current will be decoded, check is fore >= instead of > */
 1310|  9.14k|    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 (1310:8): [True: 8.50k, False: 634]
  ------------------
 1311|  9.14k|       (ps_codec->e_frm_out_mode == IVD_DECODE_FRAME_OUT))
  ------------------
  |  Branch (1311:8): [True: 0, False: 634]
  ------------------
 1312|       |
 1313|  8.50k|    {
 1314|  8.50k|        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);
 1315|  8.50k|        ps_codec->u4_disp_cnt++;
 1316|  8.50k|    }
 1317|       |
 1318|  9.14k|    ps_codec->s_fmt_conv.i4_cur_row = 0;
 1319|       |    /* Set number of rows to be processed at a time */
 1320|  9.14k|    ps_codec->s_fmt_conv.i4_num_rows = 4;
 1321|       |
 1322|  9.14k|    if(ps_codec->u4_enable_fmt_conv_ahead && (ps_codec->i4_num_cores > 1))
  ------------------
  |  Branch (1322:8): [True: 0, False: 9.14k]
  |  Branch (1322:46): [True: 0, False: 0]
  ------------------
 1323|      0|    {
 1324|      0|        process_ctxt_t *ps_proc;
 1325|       |
 1326|       |        /* i4_num_cores - 1 contexts are currently being used by other threads */
 1327|      0|        ps_proc = &ps_codec->as_process[ps_codec->i4_num_cores - 1];
 1328|       |
 1329|       |        /* If the frame being decoded and displayed are different, schedule format conversion jobs
 1330|       |         * this will keep the proc threads busy and lets parse thread decode few CTBs ahead
 1331|       |         * If the frame being decoded and displayed are same, then format conversion is scheduled later.
 1332|       |         */
 1333|      0|        if((ps_codec->ps_disp_buf) && (ps_codec->i4_disp_buf_id != ps_proc->i4_cur_pic_buf_id) &&
  ------------------
  |  Branch (1333:12): [True: 0, False: 0]
  |  Branch (1333:39): [True: 0, False: 0]
  ------------------
 1334|      0|           ((0 == ps_codec->i4_share_disp_buf) || (IV_YUV_420P == ps_codec->e_chroma_fmt)))
  ------------------
  |  Branch (1334:13): [True: 0, False: 0]
  |  Branch (1334:51): [True: 0, False: 0]
  ------------------
 1335|      0|        {
 1336|       |
 1337|      0|            for(i = 0; i < ps_sps->i2_pic_ht_in_ctb; i++)
  ------------------
  |  Branch (1337:24): [True: 0, False: 0]
  ------------------
 1338|      0|            {
 1339|      0|                proc_job_t s_job;
 1340|      0|                IHEVCD_ERROR_T ret;
 1341|      0|                s_job.i4_cmd = CMD_FMTCONV;
 1342|      0|                s_job.i2_ctb_cnt = 0;
 1343|      0|                s_job.i2_ctb_x = 0;
 1344|      0|                s_job.i2_ctb_y = i;
 1345|      0|                s_job.i2_slice_idx = 0;
 1346|      0|                s_job.i4_tu_coeff_data_ofst = 0;
 1347|      0|                ret = ihevcd_jobq_queue((jobq_t *)ps_codec->s_parse.pv_proc_jobq,
 1348|      0|                                        &s_job, sizeof(proc_job_t), 1);
 1349|      0|                if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS)
  ------------------
  |  Branch (1349:20): [True: 0, False: 0]
  ------------------
 1350|      0|                    return ret;
 1351|      0|            }
 1352|      0|        }
 1353|      0|    }
 1354|       |
 1355|       |    /* If parse_pic_init is called, then slice data is present in the input bitstrea stream */
 1356|  9.14k|    ps_codec->i4_pic_present = 1;
 1357|       |
 1358|  9.14k|    return ret;
 1359|  9.14k|}

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

ihevcd_init_function_ptr:
   62|  2.42k|{
   63|  2.42k|    codec_t *ps_codec = (codec_t *)pv_codec;
   64|  2.42k|    switch(ps_codec->e_processor_arch)
   65|  2.42k|    {
   66|    542|        case ARCH_X86_GENERIC:
  ------------------
  |  Branch (66:9): [True: 542, False: 1.87k]
  ------------------
   67|    542|            ihevcd_init_function_ptr_generic(pv_codec);
   68|    542|            break;
   69|     19|        case ARCH_X86_SSSE3:
  ------------------
  |  Branch (69:9): [True: 19, False: 2.40k]
  ------------------
   70|     19|            ihevcd_init_function_ptr_ssse3(pv_codec);
   71|     19|            break;
   72|  1.67k|        case ARCH_X86_SSE42:
  ------------------
  |  Branch (72:9): [True: 1.67k, False: 743]
  ------------------
   73|  1.67k|            ihevcd_init_function_ptr_sse42(pv_codec);
   74|  1.67k|            break;
   75|      0|        case ARCH_X86_AVX2:
  ------------------
  |  Branch (75:9): [True: 0, False: 2.42k]
  ------------------
   76|       |#ifndef DISABLE_AVX2
   77|       |            ihevcd_init_function_ptr_avx2(pv_codec);
   78|       |#else
   79|      0|            ihevcd_init_function_ptr_sse42(pv_codec);
   80|      0|#endif
   81|      0|            break;
   82|    182|        default:
  ------------------
  |  Branch (82:9): [True: 182, False: 2.23k]
  ------------------
   83|    182|            ihevcd_init_function_ptr_ssse3(pv_codec);
   84|    182|            break;
   85|  2.42k|    }
   86|  2.42k|}
ihevcd_init_arch:
   89|  1.62k|{
   90|  1.62k|    codec_t *ps_codec = (codec_t *)pv_codec;
   91|       |
   92|  1.62k|#ifdef DEFAULT_ARCH
   93|       |#if DEFAULT_ARCH == D_ARCH_X86_GENERIC
   94|       |    ps_codec->e_processor_arch = ARCH_X86_GENERIC;
   95|       |#elif DEFAULT_ARCH == D_ARCH_X86_SSE42
   96|  1.62k|    ps_codec->e_processor_arch = ARCH_X86_SSE42;
   97|       |#elif DEFAULT_ARCH == D_ARCH_X86_AVX2
   98|       |    ps_codec->e_processor_arch = ARCH_X86_AVX2;
   99|       |#else
  100|       |    ps_codec->e_processor_arch = ARCH_X86_SSSE3;
  101|       |#endif
  102|       |#else
  103|       |    ps_codec->e_processor_arch = ARCH_X86_SSSE3;
  104|       |#endif
  105|  1.62k|}

ihevcd_init_function_ptr_generic:
   62|    542|{
   63|    542|    codec_t *ps_codec = (codec_t *)pv_codec;
   64|       |
   65|    542|    ps_codec->s_func_selector.ihevc_deblk_chroma_horz_fptr                      =  &ihevc_deblk_chroma_horz;
   66|    542|    ps_codec->s_func_selector.ihevc_deblk_chroma_vert_fptr                      =  &ihevc_deblk_chroma_vert;
   67|    542|    ps_codec->s_func_selector.ihevc_deblk_luma_vert_fptr                        =  &ihevc_deblk_luma_vert;
   68|    542|    ps_codec->s_func_selector.ihevc_deblk_luma_horz_fptr                        =  &ihevc_deblk_luma_horz;
   69|    542|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_fptr                 =  &ihevc_inter_pred_chroma_copy;
   70|    542|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_w16out_fptr          =  &ihevc_inter_pred_chroma_copy_w16out;
   71|    542|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_fptr                 =  &ihevc_inter_pred_chroma_horz;
   72|    542|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr          =  &ihevc_inter_pred_chroma_horz_w16out;
   73|    542|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_fptr                 =  &ihevc_inter_pred_chroma_vert;
   74|    542|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_fptr          =  &ihevc_inter_pred_chroma_vert_w16inp;
   75|    542|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr   =  &ihevc_inter_pred_chroma_vert_w16inp_w16out;
   76|    542|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16out_fptr          =  &ihevc_inter_pred_chroma_vert_w16out;
   77|    542|    ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_fptr                   =  &ihevc_inter_pred_luma_horz;
   78|    542|    ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_fptr                   =  &ihevc_inter_pred_luma_vert;
   79|    542|    ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16out_fptr            =  &ihevc_inter_pred_luma_vert_w16out;
   80|    542|    ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_fptr            =  &ihevc_inter_pred_luma_vert_w16inp;
   81|    542|    ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_fptr                   =  &ihevc_inter_pred_luma_copy;
   82|    542|    ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_w16out_fptr            =  &ihevc_inter_pred_luma_copy_w16out;
   83|    542|    ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr            =  &ihevc_inter_pred_luma_horz_w16out;
   84|    542|    ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_w16out_fptr     =  &ihevc_inter_pred_luma_vert_w16inp_w16out;
   85|    542|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr     =  &ihevc_intra_pred_chroma_ref_substitution;
   86|    542|    ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr       =  &ihevc_intra_pred_luma_ref_substitution;
   87|    542|    ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_subst_all_avlble_fptr   =  &ihevc_intra_pred_luma_ref_subst_all_avlble;
   88|    542|    ps_codec->s_func_selector.ihevc_intra_pred_ref_filtering_fptr               =  &ihevc_intra_pred_ref_filtering;
   89|    542|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_dc_fptr                   =  &ihevc_intra_pred_chroma_dc;
   90|    542|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_horz_fptr                 =  &ihevc_intra_pred_chroma_horz;
   91|    542|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode2_fptr                =  &ihevc_intra_pred_chroma_mode2;
   92|    542|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_18_34_fptr           =  &ihevc_intra_pred_chroma_mode_18_34;
   93|    542|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_27_to_33_fptr        =  &ihevc_intra_pred_chroma_mode_27_to_33;
   94|    542|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_3_to_9_fptr          =  &ihevc_intra_pred_chroma_mode_3_to_9;
   95|    542|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_planar_fptr               =  &ihevc_intra_pred_chroma_planar;
   96|    542|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_ver_fptr                  =  &ihevc_intra_pred_chroma_ver;
   97|    542|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_11_to_17_fptr        =  &ihevc_intra_pred_chroma_mode_11_to_17;
   98|    542|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_19_to_25_fptr        =  &ihevc_intra_pred_chroma_mode_19_to_25;
   99|    542|    ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_11_to_17_fptr          =  &ihevc_intra_pred_luma_mode_11_to_17;
  100|    542|    ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_19_to_25_fptr          =  &ihevc_intra_pred_luma_mode_19_to_25;
  101|    542|    ps_codec->s_func_selector.ihevc_intra_pred_luma_dc_fptr                     =  &ihevc_intra_pred_luma_dc;
  102|    542|    ps_codec->s_func_selector.ihevc_intra_pred_luma_horz_fptr                   =  &ihevc_intra_pred_luma_horz;
  103|    542|    ps_codec->s_func_selector.ihevc_intra_pred_luma_mode2_fptr                  =  &ihevc_intra_pred_luma_mode2;
  104|    542|    ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_18_34_fptr             =  &ihevc_intra_pred_luma_mode_18_34;
  105|    542|    ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_27_to_33_fptr          =  &ihevc_intra_pred_luma_mode_27_to_33;
  106|    542|    ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_3_to_9_fptr            =  &ihevc_intra_pred_luma_mode_3_to_9;
  107|    542|    ps_codec->s_func_selector.ihevc_intra_pred_luma_planar_fptr                 =  &ihevc_intra_pred_luma_planar;
  108|    542|    ps_codec->s_func_selector.ihevc_intra_pred_luma_ver_fptr                    =  &ihevc_intra_pred_luma_ver;
  109|    542|    ps_codec->s_func_selector.ihevc_itrans_4x4_ttype1_fptr                      =  &ihevc_itrans_4x4_ttype1;
  110|    542|    ps_codec->s_func_selector.ihevc_itrans_4x4_fptr                             =  &ihevc_itrans_4x4;
  111|    542|    ps_codec->s_func_selector.ihevc_itrans_8x8_fptr                             =  &ihevc_itrans_8x8;
  112|    542|    ps_codec->s_func_selector.ihevc_itrans_16x16_fptr                           =  &ihevc_itrans_16x16;
  113|    542|    ps_codec->s_func_selector.ihevc_itrans_32x32_fptr                           =  &ihevc_itrans_32x32;
  114|    542|    ps_codec->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr                =  &ihevc_itrans_recon_4x4_ttype1;
  115|    542|    ps_codec->s_func_selector.ihevc_itrans_recon_4x4_fptr                       =  &ihevc_itrans_recon_4x4;
  116|    542|    ps_codec->s_func_selector.ihevc_itrans_recon_8x8_fptr                       =  &ihevc_itrans_recon_8x8;
  117|    542|    ps_codec->s_func_selector.ihevc_itrans_recon_16x16_fptr                     =  &ihevc_itrans_recon_16x16;
  118|    542|    ps_codec->s_func_selector.ihevc_itrans_recon_32x32_fptr                     =  &ihevc_itrans_recon_32x32;
  119|    542|    ps_codec->s_func_selector.ihevc_chroma_itrans_recon_4x4_fptr                =  &ihevc_chroma_itrans_recon_4x4;
  120|    542|    ps_codec->s_func_selector.ihevc_chroma_itrans_recon_8x8_fptr                =  &ihevc_chroma_itrans_recon_8x8;
  121|    542|    ps_codec->s_func_selector.ihevc_chroma_itrans_recon_16x16_fptr              =  &ihevc_chroma_itrans_recon_16x16;
  122|    542|    ps_codec->s_func_selector.ihevc_recon_4x4_ttype1_fptr                       =  &ihevc_recon_4x4_ttype1;
  123|    542|    ps_codec->s_func_selector.ihevc_recon_4x4_fptr                              =  &ihevc_recon_4x4;
  124|    542|    ps_codec->s_func_selector.ihevc_recon_8x8_fptr                              =  &ihevc_recon_8x8;
  125|    542|    ps_codec->s_func_selector.ihevc_recon_16x16_fptr                            =  &ihevc_recon_16x16;
  126|    542|    ps_codec->s_func_selector.ihevc_recon_32x32_fptr                            =  &ihevc_recon_32x32;
  127|    542|    ps_codec->s_func_selector.ihevc_chroma_recon_4x4_fptr                       =  &ihevc_chroma_recon_4x4;
  128|    542|    ps_codec->s_func_selector.ihevc_chroma_recon_8x8_fptr                       =  &ihevc_chroma_recon_8x8;
  129|    542|    ps_codec->s_func_selector.ihevc_chroma_recon_16x16_fptr                     =  &ihevc_chroma_recon_16x16;
  130|    542|    ps_codec->s_func_selector.ihevc_memcpy_mul_8_fptr                           =  &ihevc_memcpy_mul_8;
  131|    542|    ps_codec->s_func_selector.ihevc_memcpy_fptr                                 =  &ihevc_memcpy;
  132|    542|    ps_codec->s_func_selector.ihevc_memset_mul_8_fptr                           =  &ihevc_memset_mul_8;
  133|    542|    ps_codec->s_func_selector.ihevc_memset_fptr                                 =  &ihevc_memset;
  134|    542|    ps_codec->s_func_selector.ihevc_memset_16bit_mul_8_fptr                     =  &ihevc_memset_16bit_mul_8;
  135|    542|    ps_codec->s_func_selector.ihevc_memset_16bit_fptr                           =  &ihevc_memset_16bit;
  136|    542|    ps_codec->s_func_selector.ihevc_pad_left_luma_fptr                          =  &ihevc_pad_left_luma;
  137|    542|    ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr                        =  &ihevc_pad_left_chroma;
  138|    542|    ps_codec->s_func_selector.ihevc_pad_right_luma_fptr                         =  &ihevc_pad_right_luma;
  139|    542|    ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr                       =  &ihevc_pad_right_chroma;
  140|    542|    ps_codec->s_func_selector.ihevc_weighted_pred_bi_fptr                       =  &ihevc_weighted_pred_bi;
  141|    542|    ps_codec->s_func_selector.ihevc_weighted_pred_bi_default_fptr               =  &ihevc_weighted_pred_bi_default;
  142|    542|    ps_codec->s_func_selector.ihevc_weighted_pred_uni_fptr                      =  &ihevc_weighted_pred_uni;
  143|    542|    ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr                =  &ihevc_weighted_pred_chroma_bi;
  144|    542|    ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_default_fptr        =  &ihevc_weighted_pred_chroma_bi_default;
  145|    542|    ps_codec->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr               =  &ihevc_weighted_pred_chroma_uni;
  146|    542|    ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr                   =  &ihevc_sao_band_offset_luma;
  147|    542|    ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr                 =  &ihevc_sao_band_offset_chroma;
  148|    542|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_fptr                 =  &ihevc_sao_edge_offset_class0;
  149|    542|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_chroma_fptr          =  &ihevc_sao_edge_offset_class0_chroma;
  150|    542|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_fptr                 =  &ihevc_sao_edge_offset_class1;
  151|    542|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_chroma_fptr          =  &ihevc_sao_edge_offset_class1_chroma;
  152|    542|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_fptr                 =  &ihevc_sao_edge_offset_class2;
  153|    542|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_chroma_fptr          =  &ihevc_sao_edge_offset_class2_chroma;
  154|    542|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_fptr                 =  &ihevc_sao_edge_offset_class3;
  155|    542|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_chroma_fptr          =  &ihevc_sao_edge_offset_class3_chroma;
  156|    542|    ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgba8888_fptr            =  &ihevcd_fmt_conv_420sp_to_rgba8888;
  157|    542|    ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgb565_fptr              =  &ihevcd_fmt_conv_420sp_to_rgb565;
  158|    542|    ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420sp_fptr               =  &ihevcd_fmt_conv_420sp_to_420sp;
  159|    542|    ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420p_fptr                =  &ihevcd_fmt_conv_420sp_to_420p;
  160|    542|    ps_codec->s_func_selector.ihevcd_itrans_recon_dc_luma_fptr                  =  &ihevcd_itrans_recon_dc_luma;
  161|    542|    ps_codec->s_func_selector.ihevcd_itrans_recon_dc_chroma_fptr                =  &ihevcd_itrans_recon_dc_chroma;
  162|    542|}

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

ihevcd_init_function_ptr_ssse3:
   62|    201|{
   63|    201|    codec_t *ps_codec = (codec_t *)pv_codec;
   64|       |
   65|    201|    ps_codec->s_func_selector.ihevc_deblk_chroma_horz_fptr                      =  &ihevc_deblk_chroma_horz_ssse3;
   66|    201|    ps_codec->s_func_selector.ihevc_deblk_chroma_vert_fptr                      =  &ihevc_deblk_chroma_vert_ssse3;
   67|    201|    ps_codec->s_func_selector.ihevc_deblk_luma_vert_fptr                        =  &ihevc_deblk_luma_vert_ssse3;
   68|    201|    ps_codec->s_func_selector.ihevc_deblk_luma_horz_fptr                        =  &ihevc_deblk_luma_horz_ssse3;
   69|    201|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_fptr                 =  &ihevc_inter_pred_chroma_copy_ssse3;
   70|    201|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_w16out_fptr          =  &ihevc_inter_pred_chroma_copy_w16out_ssse3;
   71|    201|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_fptr                 =  &ihevc_inter_pred_chroma_horz_ssse3;
   72|    201|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr          =  &ihevc_inter_pred_chroma_horz_w16out_ssse3;
   73|    201|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_fptr                 =  &ihevc_inter_pred_chroma_vert_ssse3;
   74|    201|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_fptr          =  &ihevc_inter_pred_chroma_vert_w16inp_ssse3;
   75|    201|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr   =  &ihevc_inter_pred_chroma_vert_w16inp_w16out_ssse3;
   76|    201|    ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16out_fptr          =  &ihevc_inter_pred_chroma_vert_w16out_ssse3;
   77|    201|    ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_fptr                   =  &ihevc_inter_pred_luma_horz_ssse3;
   78|    201|    ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_fptr                   =  &ihevc_inter_pred_luma_vert_ssse3;
   79|    201|    ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16out_fptr            =  &ihevc_inter_pred_luma_vert_w16out_ssse3;
   80|    201|    ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_fptr            =  &ihevc_inter_pred_luma_vert_w16inp_ssse3;
   81|    201|    ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_fptr                   =  &ihevc_inter_pred_luma_copy_ssse3;
   82|    201|    ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_w16out_fptr            =  &ihevc_inter_pred_luma_copy_w16out_ssse3;
   83|    201|    ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr            =  &ihevc_inter_pred_luma_horz_w16out_ssse3;
   84|    201|    ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_w16out_fptr     =  &ihevc_inter_pred_luma_vert_w16inp_w16out_ssse3;
   85|    201|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr     =  &ihevc_intra_pred_chroma_ref_substitution;
   86|    201|    ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr       =  &ihevc_intra_pred_luma_ref_substitution;
   87|    201|    ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_subst_all_avlble_fptr   =  &ihevc_intra_pred_luma_ref_subst_all_avlble;
   88|    201|    ps_codec->s_func_selector.ihevc_intra_pred_ref_filtering_fptr               =  &ihevc_intra_pred_ref_filtering_ssse3;
   89|    201|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_dc_fptr                   =  &ihevc_intra_pred_chroma_dc_ssse3;
   90|    201|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_horz_fptr                 =  &ihevc_intra_pred_chroma_horz_ssse3;
   91|    201|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode2_fptr                =  &ihevc_intra_pred_chroma_mode2_ssse3;
   92|    201|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_18_34_fptr           =  &ihevc_intra_pred_chroma_mode_18_34_ssse3;
   93|    201|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_27_to_33_fptr        =  &ihevc_intra_pred_chroma_mode_27_to_33_ssse3;
   94|    201|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_3_to_9_fptr          =  &ihevc_intra_pred_chroma_mode_3_to_9_ssse3;
   95|    201|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_planar_fptr               =  &ihevc_intra_pred_chroma_planar_ssse3;
   96|    201|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_ver_fptr                  =  &ihevc_intra_pred_chroma_ver_ssse3;
   97|    201|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_11_to_17_fptr        =  &ihevc_intra_pred_chroma_mode_11_to_17_ssse3;
   98|    201|    ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_19_to_25_fptr        =  &ihevc_intra_pred_chroma_mode_19_to_25_ssse3;
   99|    201|    ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_11_to_17_fptr          =  &ihevc_intra_pred_luma_mode_11_to_17_ssse3;
  100|    201|    ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_19_to_25_fptr          =  &ihevc_intra_pred_luma_mode_19_to_25_ssse3;
  101|    201|    ps_codec->s_func_selector.ihevc_intra_pred_luma_dc_fptr                     =  &ihevc_intra_pred_luma_dc_ssse3;
  102|    201|    ps_codec->s_func_selector.ihevc_intra_pred_luma_horz_fptr                   =  &ihevc_intra_pred_luma_horz_ssse3;
  103|    201|    ps_codec->s_func_selector.ihevc_intra_pred_luma_mode2_fptr                  =  &ihevc_intra_pred_luma_mode2_ssse3;
  104|    201|    ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_18_34_fptr             =  &ihevc_intra_pred_luma_mode_18_34_ssse3;
  105|    201|    ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_27_to_33_fptr          =  &ihevc_intra_pred_luma_mode_27_to_33_ssse3;
  106|    201|    ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_3_to_9_fptr            =  &ihevc_intra_pred_luma_mode_3_to_9_ssse3;
  107|    201|    ps_codec->s_func_selector.ihevc_intra_pred_luma_planar_fptr                 =  &ihevc_intra_pred_luma_planar_ssse3;
  108|    201|    ps_codec->s_func_selector.ihevc_intra_pred_luma_ver_fptr                    =  &ihevc_intra_pred_luma_ver_ssse3;
  109|    201|    ps_codec->s_func_selector.ihevc_itrans_4x4_ttype1_fptr                      =  &ihevc_itrans_4x4_ttype1;
  110|    201|    ps_codec->s_func_selector.ihevc_itrans_4x4_fptr                             =  &ihevc_itrans_4x4;
  111|    201|    ps_codec->s_func_selector.ihevc_itrans_8x8_fptr                             =  &ihevc_itrans_8x8;
  112|    201|    ps_codec->s_func_selector.ihevc_itrans_16x16_fptr                           =  &ihevc_itrans_16x16;
  113|    201|    ps_codec->s_func_selector.ihevc_itrans_32x32_fptr                           =  &ihevc_itrans_32x32;
  114|    201|    ps_codec->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr                =  &ihevc_itrans_recon_4x4_ttype1_ssse3;
  115|    201|    ps_codec->s_func_selector.ihevc_itrans_recon_4x4_fptr                       =  &ihevc_itrans_recon_4x4_ssse3;
  116|    201|    ps_codec->s_func_selector.ihevc_itrans_recon_8x8_fptr                       =  &ihevc_itrans_recon_8x8_ssse3;
  117|    201|    ps_codec->s_func_selector.ihevc_itrans_recon_16x16_fptr                     =  &ihevc_itrans_recon_16x16_ssse3;
  118|    201|    ps_codec->s_func_selector.ihevc_itrans_recon_32x32_fptr                     =  &ihevc_itrans_recon_32x32_ssse3;
  119|    201|    ps_codec->s_func_selector.ihevc_chroma_itrans_recon_4x4_fptr                =  &ihevc_chroma_itrans_recon_4x4;
  120|    201|    ps_codec->s_func_selector.ihevc_chroma_itrans_recon_8x8_fptr                =  &ihevc_chroma_itrans_recon_8x8;
  121|    201|    ps_codec->s_func_selector.ihevc_chroma_itrans_recon_16x16_fptr              =  &ihevc_chroma_itrans_recon_16x16;
  122|    201|    ps_codec->s_func_selector.ihevc_recon_4x4_ttype1_fptr                       =  &ihevc_recon_4x4_ttype1;
  123|    201|    ps_codec->s_func_selector.ihevc_recon_4x4_fptr                              =  &ihevc_recon_4x4;
  124|    201|    ps_codec->s_func_selector.ihevc_recon_8x8_fptr                              =  &ihevc_recon_8x8;
  125|    201|    ps_codec->s_func_selector.ihevc_recon_16x16_fptr                            =  &ihevc_recon_16x16;
  126|    201|    ps_codec->s_func_selector.ihevc_recon_32x32_fptr                            =  &ihevc_recon_32x32;
  127|    201|    ps_codec->s_func_selector.ihevc_chroma_recon_4x4_fptr                       =  &ihevc_chroma_recon_4x4;
  128|    201|    ps_codec->s_func_selector.ihevc_chroma_recon_8x8_fptr                       =  &ihevc_chroma_recon_8x8;
  129|    201|    ps_codec->s_func_selector.ihevc_chroma_recon_16x16_fptr                     =  &ihevc_chroma_recon_16x16;
  130|    201|    ps_codec->s_func_selector.ihevc_memcpy_mul_8_fptr                           =  &ihevc_memcpy_mul_8;
  131|    201|    ps_codec->s_func_selector.ihevc_memcpy_fptr                                 =  &ihevc_memcpy;
  132|    201|    ps_codec->s_func_selector.ihevc_memset_mul_8_fptr                           =  &ihevc_memset_mul_8;
  133|    201|    ps_codec->s_func_selector.ihevc_memset_fptr                                 =  &ihevc_memset;
  134|    201|    ps_codec->s_func_selector.ihevc_memset_16bit_mul_8_fptr                     =  &ihevc_memset_16bit_mul_8;
  135|    201|    ps_codec->s_func_selector.ihevc_memset_16bit_fptr                           =  &ihevc_memset_16bit;
  136|    201|    ps_codec->s_func_selector.ihevc_pad_left_luma_fptr                          =  &ihevc_pad_left_luma;
  137|    201|    ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr                        =  &ihevc_pad_left_chroma;
  138|    201|    ps_codec->s_func_selector.ihevc_pad_right_luma_fptr                         =  &ihevc_pad_right_luma;
  139|    201|    ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr                       =  &ihevc_pad_right_chroma;
  140|    201|    ps_codec->s_func_selector.ihevc_weighted_pred_bi_fptr                       =  &ihevc_weighted_pred_bi_ssse3;
  141|    201|    ps_codec->s_func_selector.ihevc_weighted_pred_bi_default_fptr               =  &ihevc_weighted_pred_bi_default_ssse3;
  142|    201|    ps_codec->s_func_selector.ihevc_weighted_pred_uni_fptr                      =  &ihevc_weighted_pred_uni_ssse3;
  143|    201|    ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr                =  &ihevc_weighted_pred_chroma_bi_ssse3;
  144|    201|    ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_default_fptr        =  &ihevc_weighted_pred_chroma_bi_default_ssse3;
  145|    201|    ps_codec->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr               =  &ihevc_weighted_pred_chroma_uni_ssse3;
  146|    201|    ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr                   =  &ihevc_sao_band_offset_luma_ssse3;
  147|    201|    ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr                 =  &ihevc_sao_band_offset_chroma_ssse3;
  148|    201|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_fptr                 =  &ihevc_sao_edge_offset_class0_ssse3;
  149|    201|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_chroma_fptr          =  &ihevc_sao_edge_offset_class0_chroma_ssse3;
  150|    201|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_fptr                 =  &ihevc_sao_edge_offset_class1_ssse3;
  151|    201|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_chroma_fptr          =  &ihevc_sao_edge_offset_class1_chroma_ssse3;
  152|    201|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_fptr                 =  &ihevc_sao_edge_offset_class2_ssse3;
  153|    201|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_chroma_fptr          =  &ihevc_sao_edge_offset_class2_chroma_ssse3;
  154|    201|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_fptr                 =  &ihevc_sao_edge_offset_class3_ssse3;
  155|    201|    ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_chroma_fptr          =  &ihevc_sao_edge_offset_class3_chroma_ssse3;
  156|    201|    ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgba8888_fptr            =  &ihevcd_fmt_conv_420sp_to_rgba8888;
  157|    201|    ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgb565_fptr              =  &ihevcd_fmt_conv_420sp_to_rgb565;
  158|    201|    ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420sp_fptr               =  &ihevcd_fmt_conv_420sp_to_420sp;
  159|    201|    ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420p_fptr                =  &ihevcd_fmt_conv_420sp_to_420p;
  160|    201|    ps_codec->s_func_selector.ihevcd_itrans_recon_dc_luma_fptr                  =  &ihevcd_itrans_recon_dc_luma_ssse3;
  161|    201|    ps_codec->s_func_selector.ihevcd_itrans_recon_dc_chroma_fptr                =  &ihevcd_itrans_recon_dc_chroma_ssse3;
  162|    201|}

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

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

_Z17iv_aligned_mallocPvii:
   60|  44.5k|void *iv_aligned_malloc(void *ctxt, WORD32 alignment, WORD32 size) {
   61|  44.5k|  void *buf = NULL;
   62|  44.5k|  (void)ctxt;
   63|  44.5k|  if (0 != posix_memalign(&buf, alignment, size)) {
  ------------------
  |  Branch (63:7): [True: 0, False: 44.5k]
  ------------------
   64|      0|      return NULL;
   65|      0|  }
   66|  44.5k|  return buf;
   67|  44.5k|}
_Z15iv_aligned_freePvS_:
   69|  42.1k|void iv_aligned_free(void *ctxt, void *buf) {
   70|  42.1k|  (void)ctxt;
   71|  42.1k|  free(buf);
   72|  42.1k|}
_ZN5CodecC2E17IV_COLOR_FORMAT_Tm:
  100|    797|Codec::Codec(IV_COLOR_FORMAT_T colorFormat, size_t numCores) {
  101|    797|  mColorFormat = colorFormat;
  102|    797|  mNumCores = numCores;
  103|    797|  mCodec = nullptr;
  104|    797|  mWidth = 0;
  105|    797|  mHeight = 0;
  106|       |
  107|    797|  memset(&mOutBufHandle, 0, sizeof(mOutBufHandle));
  108|    797|}
_ZN5CodecD2Ev:
  110|    797|Codec::~Codec() {}
_ZN5Codec11createCodecEv:
  112|    797|void Codec::createCodec() {
  113|    797|  IV_API_CALL_STATUS_T ret;
  114|    797|  ihevcd_cxa_create_ip_t create_ip{};
  115|    797|  ihevcd_cxa_create_op_t create_op{};
  116|    797|  void *fxns = (void *)&ivd_api_function;
  ------------------
  |  |   36|    797|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  117|       |
  118|    797|  create_ip.s_ivd_create_ip_t.e_cmd = IVD_CMD_CREATE;
  119|    797|  create_ip.s_ivd_create_ip_t.u4_share_disp_buf = 0;
  120|    797|  create_ip.s_ivd_create_ip_t.e_output_format = mColorFormat;
  121|    797|  create_ip.u4_keep_threads_active = 1;
  122|    797|  create_ip.s_ivd_create_ip_t.pf_aligned_alloc = iv_aligned_malloc;
  123|    797|  create_ip.s_ivd_create_ip_t.pf_aligned_free = iv_aligned_free;
  124|    797|  create_ip.s_ivd_create_ip_t.pv_mem_ctxt = NULL;
  125|    797|  create_ip.s_ivd_create_ip_t.u4_size = sizeof(ihevcd_cxa_create_ip_t);
  126|    797|  create_op.s_ivd_create_op_t.u4_size = sizeof(ihevcd_cxa_create_op_t);
  127|       |
  128|    797|  ret = ivd_api_function(NULL, (void *)&create_ip, (void *)&create_op);
  ------------------
  |  |   36|    797|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  129|    797|  if (ret != IV_SUCCESS) {
  ------------------
  |  Branch (129:7): [True: 0, False: 797]
  ------------------
  130|      0|    return;
  131|      0|  }
  132|    797|  mCodec = (iv_obj_t *)create_op.s_ivd_create_op_t.pv_handle;
  133|    797|  mCodec->pv_fxns = fxns;
  134|    797|  mCodec->u4_size = sizeof(iv_obj_t);
  135|    797|}
_ZN5Codec11deleteCodecEv:
  137|    797|void Codec::deleteCodec() {
  138|    797|  ivd_delete_ip_t delete_ip{};
  139|    797|  ivd_delete_op_t delete_op{};
  140|       |
  141|    797|  delete_ip.e_cmd = IVD_CMD_DELETE;
  142|    797|  delete_ip.u4_size = sizeof(ivd_delete_ip_t);
  143|    797|  delete_op.u4_size = sizeof(ivd_delete_op_t);
  144|       |
  145|    797|  ivd_api_function(mCodec, (void *)&delete_ip, (void *)&delete_op);
  ------------------
  |  |   36|    797|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  146|    797|}
_ZN5Codec10resetCodecEv:
  148|    826|void Codec::resetCodec() {
  149|    826|  ivd_ctl_reset_ip_t s_ctl_ip{};
  150|    826|  ivd_ctl_reset_op_t s_ctl_op{};
  151|       |
  152|    826|  s_ctl_ip.e_cmd = IVD_CMD_VIDEO_CTL;
  153|    826|  s_ctl_ip.e_sub_cmd = IVD_CMD_CTL_RESET;
  154|    826|  s_ctl_ip.u4_size = sizeof(ivd_ctl_reset_ip_t);
  155|    826|  s_ctl_op.u4_size = sizeof(ivd_ctl_reset_op_t);
  156|       |
  157|    826|  ivd_api_function(mCodec, (void *)&s_ctl_ip, (void *)&s_ctl_op);
  ------------------
  |  |   36|    826|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  158|    826|}
_ZN5Codec8setCoresEv:
  160|    797|void Codec::setCores() {
  161|    797|  ihevcd_cxa_ctl_set_num_cores_ip_t s_ctl_ip{};
  162|    797|  ihevcd_cxa_ctl_set_num_cores_op_t s_ctl_op{};
  163|       |
  164|    797|  s_ctl_ip.e_cmd = IVD_CMD_VIDEO_CTL;
  165|    797|  s_ctl_ip.e_sub_cmd =
  166|    797|      (IVD_CONTROL_API_COMMAND_TYPE_T)IHEVCD_CXA_CMD_CTL_SET_NUM_CORES;
  167|    797|  s_ctl_ip.u4_num_cores = mNumCores;
  168|    797|  s_ctl_ip.u4_size = sizeof(ihevcd_cxa_ctl_set_num_cores_ip_t);
  169|    797|  s_ctl_op.u4_size = sizeof(ihevcd_cxa_ctl_set_num_cores_op_t);
  170|       |
  171|    797|  ivd_api_function(mCodec, (void *)&s_ctl_ip, (void *)&s_ctl_op);
  ------------------
  |  |   36|    797|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  172|    797|}
_ZN5Codec9setParamsE23IVD_VIDEO_DECODE_MODE_T:
  174|  1.59k|void Codec::setParams(IVD_VIDEO_DECODE_MODE_T mode) {
  175|  1.59k|  ivd_ctl_set_config_ip_t s_ctl_ip{};
  176|  1.59k|  ivd_ctl_set_config_op_t s_ctl_op{};
  177|       |
  178|  1.59k|  s_ctl_ip.u4_disp_wd = 0;
  179|  1.59k|  s_ctl_ip.e_frm_skip_mode = IVD_SKIP_NONE;
  180|  1.59k|  s_ctl_ip.e_frm_out_mode = IVD_DISPLAY_FRAME_OUT;
  181|  1.59k|  s_ctl_ip.e_vid_dec_mode = mode;
  182|  1.59k|  s_ctl_ip.e_cmd = IVD_CMD_VIDEO_CTL;
  183|  1.59k|  s_ctl_ip.e_sub_cmd = IVD_CMD_CTL_SETPARAMS;
  184|  1.59k|  s_ctl_ip.u4_size = sizeof(ivd_ctl_set_config_ip_t);
  185|  1.59k|  s_ctl_op.u4_size = sizeof(ivd_ctl_set_config_op_t);
  186|       |
  187|  1.59k|  ivd_api_function(mCodec, (void *)&s_ctl_ip, (void *)&s_ctl_op);
  ------------------
  |  |   36|  1.59k|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  188|  1.59k|}
_ZN5Codec15setArchitectureE10IVD_ARCH_T:
  190|    797|void Codec::setArchitecture(IVD_ARCH_T arch) {
  191|    797|  ihevcd_cxa_ctl_set_processor_ip_t s_ctl_ip{};
  192|    797|  ihevcd_cxa_ctl_set_processor_op_t s_ctl_op{};
  193|       |
  194|    797|  s_ctl_ip.e_cmd = IVD_CMD_VIDEO_CTL;
  195|    797|  s_ctl_ip.e_sub_cmd =
  196|    797|      (IVD_CONTROL_API_COMMAND_TYPE_T)IHEVCD_CXA_CMD_CTL_SET_PROCESSOR;
  197|    797|  s_ctl_ip.u4_arch = arch;
  198|    797|  s_ctl_ip.u4_soc = SOC_GENERIC;
  199|    797|  s_ctl_ip.u4_size = sizeof(ihevcd_cxa_ctl_set_processor_ip_t);
  200|    797|  s_ctl_op.u4_size = sizeof(ihevcd_cxa_ctl_set_processor_op_t);
  201|       |
  202|    797|  ivd_api_function(mCodec, (void *)&s_ctl_ip, (void *)&s_ctl_op);
  ------------------
  |  |   36|    797|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  203|    797|}
_ZN5Codec9freeFrameEv:
  204|  1.96k|void Codec::freeFrame() {
  205|  4.28k|  for (int i = 0; i < mOutBufHandle.u4_num_bufs; i++) {
  ------------------
  |  Branch (205:19): [True: 2.32k, False: 1.96k]
  ------------------
  206|  2.32k|    if (mOutBufHandle.pu1_bufs[i]) {
  ------------------
  |  Branch (206:9): [True: 2.32k, False: 0]
  ------------------
  207|  2.32k|      free(mOutBufHandle.pu1_bufs[i]);
  208|  2.32k|      mOutBufHandle.pu1_bufs[i] = nullptr;
  209|  2.32k|    }
  210|  2.32k|  }
  211|  1.96k|}
_ZN5Codec10allocFrameEv:
  213|  1.16k|void Codec::allocFrame() {
  214|  1.16k|  size_t sizes[4] = {0};
  215|  1.16k|  size_t num_bufs = 0;
  216|       |
  217|  1.16k|  freeFrame();
  218|       |
  219|  1.16k|  memset(&mOutBufHandle, 0, sizeof(mOutBufHandle));
  220|       |
  221|  1.16k|  switch (mColorFormat) {
  222|    100|    case IV_YUV_420SP_UV:
  ------------------
  |  Branch (222:5): [True: 100, False: 1.06k]
  ------------------
  223|    100|      [[fallthrough]];
  224|    439|    case IV_YUV_420SP_VU:
  ------------------
  |  Branch (224:5): [True: 339, False: 826]
  ------------------
  225|    439|      sizes[0] = mWidth * mHeight;
  226|    439|      sizes[1] = mWidth * mHeight >> 1;
  227|    439|      num_bufs = 2;
  228|    439|      break;
  229|    315|    case IV_YUV_422ILE:
  ------------------
  |  Branch (229:5): [True: 315, False: 850]
  ------------------
  230|    315|      sizes[0] = mWidth * mHeight * 2;
  231|    315|      num_bufs = 1;
  232|    315|      break;
  233|     50|    case IV_RGB_565:
  ------------------
  |  Branch (233:5): [True: 50, False: 1.11k]
  ------------------
  234|     50|      sizes[0] = mWidth * mHeight * 2;
  235|     50|      num_bufs = 1;
  236|     50|      break;
  237|      0|    case IV_RGBA_8888:
  ------------------
  |  Branch (237:5): [True: 0, False: 1.16k]
  ------------------
  238|      0|      sizes[0] = mWidth * mHeight * 4;
  239|      0|      num_bufs = 1;
  240|      0|      break;
  241|    361|    case IV_YUV_420P:
  ------------------
  |  Branch (241:5): [True: 361, False: 804]
  ------------------
  242|    361|      [[fallthrough]];
  243|    361|    default:
  ------------------
  |  Branch (243:5): [True: 0, False: 1.16k]
  ------------------
  244|    361|      sizes[0] = mWidth * mHeight;
  245|    361|      sizes[1] = mWidth * mHeight >> 2;
  246|    361|      sizes[2] = mWidth * mHeight >> 2;
  247|    361|      num_bufs = 3;
  248|    361|      break;
  249|  1.16k|  }
  250|  1.16k|  mOutBufHandle.u4_num_bufs = num_bufs;
  251|  3.49k|  for (int i = 0; i < num_bufs; i++) {
  ------------------
  |  Branch (251:19): [True: 2.32k, False: 1.16k]
  ------------------
  252|  2.32k|    mOutBufHandle.u4_min_out_buf_size[i] = sizes[i];
  253|  2.32k|    mOutBufHandle.pu1_bufs[i] = (UWORD8 *)iv_aligned_malloc(NULL, 16, sizes[i]);
  254|  2.32k|  }
  255|  1.16k|}
_ZN5Codec12decodeHeaderEPKhm:
  257|    797|void Codec::decodeHeader(const uint8_t *data, size_t size) {
  258|    797|  setParams(IVD_DECODE_HEADER);
  259|       |
  260|    797|  size_t numDecodeCalls = 0;
  261|       |
  262|  21.3k|  while (size > 0 && numDecodeCalls < kMaxNumDecodeCalls) {
  ------------------
  |  Branch (262:10): [True: 21.2k, False: 46]
  |  Branch (262:22): [True: 21.1k, False: 86]
  ------------------
  263|  21.1k|    IV_API_CALL_STATUS_T ret;
  264|  21.1k|    ivd_video_decode_ip_t dec_ip{};
  265|  21.1k|    ivd_video_decode_op_t dec_op{};
  266|  21.1k|    size_t bytes_consumed;
  267|       |
  268|  21.1k|    memset(&dec_ip, 0, sizeof(dec_ip));
  269|  21.1k|    memset(&dec_op, 0, sizeof(dec_op));
  270|       |
  271|  21.1k|    dec_ip.e_cmd = IVD_CMD_VIDEO_DECODE;
  272|  21.1k|    dec_ip.u4_ts = 0;
  273|  21.1k|    dec_ip.pv_stream_buffer = (void *)data;
  274|  21.1k|    dec_ip.u4_num_Bytes = size;
  275|  21.1k|    dec_ip.u4_size = sizeof(ivd_video_decode_ip_t);
  276|  21.1k|    dec_op.u4_size = sizeof(ivd_video_decode_op_t);
  277|       |
  278|  21.1k|    ret = ivd_api_function(mCodec, (void *)&dec_ip, (void *)&dec_op);
  ------------------
  |  |   36|  21.1k|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  279|       |
  280|  21.1k|    bytes_consumed = dec_op.u4_num_bytes_consumed;
  281|       |    /* If no bytes are consumed, then consume 4 bytes to ensure fuzzer proceeds
  282|       |     * to feed next data */
  283|  21.1k|    if (!bytes_consumed) bytes_consumed = 4;
  ------------------
  |  Branch (283:9): [True: 15.8k, False: 5.38k]
  ------------------
  284|       |
  285|  21.1k|    bytes_consumed = std::min(size, bytes_consumed);
  286|       |
  287|  21.1k|    data += bytes_consumed;
  288|  21.1k|    size -= bytes_consumed;
  289|  21.1k|    numDecodeCalls++;
  290|       |
  291|  21.1k|    mWidth = std::min(dec_op.u4_pic_wd, (UWORD32)10240);
  292|  21.1k|    mHeight = std::min(dec_op.u4_pic_ht, (UWORD32)10240);
  293|       |
  294|       |    /* Break after successful header decode */
  295|  21.1k|    if (mWidth && mHeight) {
  ------------------
  |  Branch (295:9): [True: 665, False: 20.5k]
  |  Branch (295:19): [True: 665, False: 0]
  ------------------
  296|    665|      break;
  297|    665|    }
  298|  21.1k|  }
  299|       |  /* if width / height are invalid, set them to defaults */
  300|    797|  if (!mWidth) mWidth = 1920;
  ------------------
  |  Branch (300:7): [True: 132, False: 665]
  ------------------
  301|    797|  if (!mHeight) mHeight = 1088;
  ------------------
  |  Branch (301:7): [True: 132, False: 665]
  ------------------
  302|    797|}
_ZN5Codec11decodeFrameEPKhmPm:
  305|  27.8k|                                        size_t *bytesConsumed) {
  306|  27.8k|  IV_API_CALL_STATUS_T ret;
  307|  27.8k|  ivd_video_decode_ip_t dec_ip{};
  308|  27.8k|  ivd_video_decode_op_t dec_op{};
  309|       |
  310|  27.8k|  memset(&dec_ip, 0, sizeof(dec_ip));
  311|  27.8k|  memset(&dec_op, 0, sizeof(dec_op));
  312|       |
  313|  27.8k|  dec_ip.e_cmd = IVD_CMD_VIDEO_DECODE;
  314|  27.8k|  dec_ip.u4_ts = 0;
  315|  27.8k|  dec_ip.pv_stream_buffer = (void *)data;
  316|  27.8k|  dec_ip.u4_num_Bytes = size;
  317|  27.8k|  dec_ip.u4_size = sizeof(ivd_video_decode_ip_t);
  318|  27.8k|  dec_ip.s_out_buffer = mOutBufHandle;
  319|       |
  320|  27.8k|  dec_op.u4_size = sizeof(ivd_video_decode_op_t);
  321|       |
  322|  27.8k|  ret = ivd_api_function(mCodec, (void *)&dec_ip, (void *)&dec_op);
  ------------------
  |  |   36|  27.8k|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  323|       |
  324|       |  /* In case of change in resolution, reset codec and feed the same data again
  325|       |   */
  326|  27.8k|  if (IVD_RES_CHANGED == (dec_op.u4_error_code & 0xFF)) {
  ------------------
  |  Branch (326:7): [True: 826, False: 26.9k]
  ------------------
  327|    826|    resetCodec();
  328|    826|    ret = ivd_api_function(mCodec, (void *)&dec_ip, (void *)&dec_op);
  ------------------
  |  |   36|    826|#define ivd_api_function ihevcd_cxa_api_function
  ------------------
  329|    826|  }
  330|  27.8k|  *bytesConsumed = dec_op.u4_num_bytes_consumed;
  331|       |
  332|       |  /* If no bytes are consumed, then consume 4 bytes to ensure fuzzer proceeds
  333|       |   * to feed next data */
  334|  27.8k|  if (!*bytesConsumed) *bytesConsumed = 4;
  ------------------
  |  Branch (334:7): [True: 96, False: 27.7k]
  ------------------
  335|       |
  336|  27.8k|  if (dec_op.u4_pic_wd && dec_op.u4_pic_ht &&
  ------------------
  |  Branch (336:7): [True: 25.7k, False: 2.05k]
  |  Branch (336:27): [True: 25.7k, False: 0]
  ------------------
  337|  27.8k|      (mWidth != dec_op.u4_pic_wd || mHeight != dec_op.u4_pic_ht)) {
  ------------------
  |  Branch (337:8): [True: 150, False: 25.6k]
  |  Branch (337:38): [True: 218, False: 25.3k]
  ------------------
  338|    368|    mWidth = std::min(dec_op.u4_pic_wd, (UWORD32)10240);
  339|    368|    mHeight = std::min(dec_op.u4_pic_ht, (UWORD32)10240);
  340|    368|    allocFrame();
  341|    368|  }
  342|       |
  343|  27.8k|  return ret;
  344|  27.8k|}
LLVMFuzzerTestOneInput:
  346|    797|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  347|    797|  if (size < 1) {
  ------------------
  |  Branch (347:7): [True: 0, False: 797]
  ------------------
  348|      0|    return 0;
  349|      0|  }
  350|    797|  size_t colorFormatOfst = std::min((size_t)OFFSET_COLOR_FORMAT, size - 1);
  351|    797|  size_t numCoresOfst = std::min((size_t)OFFSET_NUM_CORES, size - 1);
  352|    797|  size_t architectureOfst = std::min((size_t)OFFSET_ARCH, size - 1);
  353|    797|  size_t architectureIdx = data[architectureOfst] % kSupportedArchitectures;
  354|    797|  IVD_ARCH_T arch = (IVD_ARCH_T)supportedArchitectures[architectureIdx];
  355|    797|  size_t colorFormatIdx = data[colorFormatOfst] % kSupportedColorFormats;
  356|    797|  IV_COLOR_FORMAT_T colorFormat =
  357|    797|      (IV_COLOR_FORMAT_T)(supportedColorFormats[colorFormatIdx]);
  358|    797|  uint32_t numCores = (data[numCoresOfst] % kMaxCores) + 1;
  359|    797|  size_t numDecodeCalls = 0;
  360|    797|  Codec *codec = new Codec(colorFormat, numCores);
  361|    797|  codec->createCodec();
  362|    797|  codec->setArchitecture(arch);
  363|    797|  codec->setCores();
  364|    797|  codec->decodeHeader(data, size);
  365|    797|  codec->setParams(IVD_DECODE_FRAME);
  366|    797|  codec->allocFrame();
  367|       |
  368|  28.6k|  while (size > 0 && numDecodeCalls < kMaxNumDecodeCalls) {
  ------------------
  |  Branch (368:10): [True: 27.8k, False: 734]
  |  Branch (368:22): [True: 27.8k, False: 63]
  ------------------
  369|  27.8k|    IV_API_CALL_STATUS_T ret;
  370|  27.8k|    size_t bytesConsumed;
  371|  27.8k|    ret = codec->decodeFrame(data, size, &bytesConsumed);
  372|       |
  373|  27.8k|    bytesConsumed = std::min(size, bytesConsumed);
  374|  27.8k|    data += bytesConsumed;
  375|  27.8k|    size -= bytesConsumed;
  376|  27.8k|    numDecodeCalls++;
  377|  27.8k|  }
  378|       |
  379|    797|  codec->freeFrame();
  380|    797|  codec->deleteCodec();
  381|    797|  delete codec;
  382|    797|  return 0;
  383|    797|}

